* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== HEADER ==================== */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: slideDown 0.6s ease;
}

/* Logo in header */
.site-logo {
    display: block;
    margin: 0 auto 12px;
    width: 120px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.03);
}

@media (max-width: 480px) {
    .site-logo { width: 86px; }
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    font-weight: 700;
}

.header .subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ==================== INFO BOX ==================== */
.info-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: slideUp 0.6s ease 0.1s both;
}

.info-box p {
    margin: 0;
    line-height: 1.6;
    color: #555;
    font-size: 0.95em;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    animation: slideUp 0.6s ease 0.2s both;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    color: #666;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-btn:hover {
    background: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ==================== TAB CONTENT ==================== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* ==================== CARD ==================== */
.card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease both;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.16);
}

.card h3 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.guide-card {
    background: rgba(255, 255, 255, 0.98);
}

.guide-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.guide-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide-section h4 {
    color: #667eea;
    font-size: 1.1em;
    margin-bottom: 12px;
    font-weight: 600;
}

.guide-section ul {
    list-style-position: inside;
    margin-left: 0;
}

.guide-section li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
    font-size: 0.95em;
}

/* ==================== INPUT GROUP ==================== */
.input-group {
    margin-bottom: 15px;
}

.input-group > div {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 600;
    font-size: 0.95em;
}

.input-field {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95em;
    transition: all 0.3s ease;
    color: #333;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: rgba(102, 126, 234, 0.02);
}

textarea.input-field {
    resize: vertical;
    min-height: 120px;
    font-family: 'Courier New', monospace;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==================== RESULT ==================== */
.result {
    margin-top: 25px;
    padding: 20px;
    border-radius: 12px;
    animation: slideUp 0.4s ease;
    border-left: 5px solid #667eea;
}

.result-critical {
    background: linear-gradient(135deg, #ffebee 0%, #ffcccc 100%);
    border-left-color: #d32f2f;
}

.result-high {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcccc 100%);
    border-left-color: #ff6f00;
}

.result-medium {
    background: linear-gradient(135deg, #fff9c4 0%, #fff3cd 100%);
    border-left-color: #fbc02d;
}

.result-low {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left-color: #f57f17;
}

.result-safe {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left-color: #388e3c;
}

.result-header {
    background: rgba(0,0,0,0.08);
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.05em;
}

.risk-score {
    color: #333;
}

.risk-label {
    font-size: 0.9em;
    background: rgba(0,0,0,0.05);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.result-critical .risk-label { color: #d32f2f; }
.result-high .risk-label { color: #ff6f00; }
.result-medium .risk-label { color: #f57f17; }
.result-low .risk-label { color: #f57f17; }
.result-safe .risk-label { color: #388e3c; }

.detections {
    margin-bottom: 15px;
}

.detections h4 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1em;
}

.detections ul {
    margin-left: 0;
    padding-left: 20px;
}

.detections li {
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95em;
    color: #555;
}

.recommendation {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    background: rgba(0,0,0,0.05);
    line-height: 1.6;
    font-size: 0.95em;
}

.recommendation strong {
    display: block;
    margin-bottom: 10px;
    font-size: 1.05em;
}

/* ==================== ALERT ==================== */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.alert-warning {
    background: #fff3cd;
    border-left: 5px solid #fbc02d;
    color: #856404;
}

/* ==================== DETAILS BOX ==================== */
.details-box {
    background: rgba(0,0,0,0.03);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
}

.details-box h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.details-box p {
    margin: 8px 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
}

/* ==================== STATISTICS ==================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 40px;
    margin-bottom: 30px;
}

.stat {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: slideUp 0.6s ease 0.4s both;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-number {
    display: block;
    font-size: 2.2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    color: #666;
    font-weight: 500;
    font-size: 0.95em;
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 40px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease 0.5s both;
}

.footer p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.9em;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2em;
    }
    
    .header .subtitle {
        font-size: 1em;
    }
    
    .tabs {
        gap: 8px;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 12px 16px;
        font-size: 0.85em;
    }
    
    .card {
        padding: 20px;
    }
    
    .card h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .result-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .risk-label {
        align-self: flex-start;
    }
    
    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header .subtitle {
        font-size: 0.9em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        min-width: auto;
    }
    
    .card {
        padding: 15px;
    }
    
    .info-box {
        padding: 15px;
        font-size: 0.85em;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        font-size: 0.9em;
    }
}