* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 1.6em;
    margin-bottom: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 0.85em;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.search-section {
    margin-bottom: 15px;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#ipInput {
    flex: 1;
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

#ipInput:focus {
    outline: none;
    border-color: #667eea;
}

#analyzeBtn {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#analyzeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#analyzeBtn:active {
    transform: translateY(0);
}

.quick-tests {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.85em;
}

.quick-tests p {
    color: #666;
    margin-right: 5px;
}

.test-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8em;
}

.test-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 10px;
}

.result-header h2 {
    font-size: 1em;
    margin: 0;
}

.execution-time {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
}

.risk-banner {
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 0.85em;
}

.risk-score {
    font-size: 1.3em;
    margin: 0;
}

.risk-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
}

.risk-factors {
    margin-top: 15px;
    text-align: left;
    background: rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 5px;
}

.risk-factors ul {
    list-style: none;
}

.risk-factors li {
    padding: 5px 0;
    padding-left: 25px;
    position: relative;
}

.risk-factors li:before {
    content: "⚠️";
    position: absolute;
    left: 0;
}

.results-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 10px;
    align-items: start;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-card {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    font-size: 0.85em;
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 6px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.8em;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 600;
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.source-tag {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e9ecef;
    color: #6c757d;
    margin-left: 5px;
    font-weight: normal;
}

.card-source {
    font-size: 0.65em;
    color: #999;
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px dashed #e9ecef;
}

#map {
    height: 100%;
    min-height: 180px;
    border-radius: 6px;
}

.data-source {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    color: #666;
    font-size: 0.9em;
    margin-top: 20px;
}

.data-source strong {
    color: #667eea;
}

footer {
    text-align: center;
    color: white;
    margin-top: 10px;
    padding: 8px;
    font-size: 0.75em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

footer p {
    margin: 2px 0;
    opacity: 0.9;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #dc3545;
    margin: 10px 0;
    font-size: 0.9em;
}

.error-message h3 {
    margin-bottom: 5px;
}

@media (max-width: 1000px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
    
    #map {
        height: 150px;
        min-height: 150px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.3em;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .risk-banner {
        flex-direction: column;
        text-align: center;
    }
}
