* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-card: #ffffff;
    --text-primary: #2d3561;
    --text-secondary: #6b7199;
    --border-color: #e8eaf2;
    --accent-color: #2d3561;
    --accent-hover: #1f2644;
    --coral: #EF5A5A;
    --navy: #2d3561;
    --gold: #F6B352;
    --success-color: #10b981;
    --warning-color: #F6B352;
    --danger-color: #EF5A5A;
    --shadow: 0 4px 6px -1px rgba(45, 53, 97, 0.1), 0 2px 4px -1px rgba(45, 53, 97, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(45, 53, 97, 0.1), 0 4px 6px -2px rgba(45, 53, 97, 0.05);
}

body.dark-mode {
    --bg-primary: #1a1d35;
    --bg-secondary: #0f1419;
    --bg-card: #252a45;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #3d4466;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fc 0%, #e8eaf2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

body.dark-mode {
    background: linear-gradient(135deg, #0f1419 0%, #1a1d35 100%);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, var(--navy) 0%, #1f2644 100%);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--gold);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(246, 179, 82, 0.15) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

h1 {
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    color: var(--gold);
    font-size: 1rem;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 1.2rem;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body.dark-mode .dark-mode-toggle {
    background: #252a45;
    border-color: var(--gold);
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-lg);
}

.language-toggle {
    position: fixed;
    top: 20px;
    right: 100px;
    background: var(--bg-card);
    border: 2px solid var(--gold);
    border-radius: 50px;
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body.dark-mode .language-toggle {
    background: #252a45;
    color: var(--gold);
    border-color: var(--gold);
}

.language-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    background: var(--gold);
    color: var(--navy);
}

body.dark-mode .language-toggle:hover {
    background: var(--gold);
    color: #1a1d35;
}

.card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 35px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .card {
    background-color: #252a45;
    border-color: #3d4466;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(45, 53, 97, 0.15), 0 10px 10px -5px rgba(45, 53, 97, 0.08);
    border-color: var(--gold);
}

body.dark-mode .card:hover {
    box-shadow: 0 20px 25px -5px rgba(246, 179, 82, 0.2), 0 10px 10px -5px rgba(246, 179, 82, 0.1);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

body.dark-mode label {
    color: #f7fafc;
}

select, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

body.dark-mode select,
body.dark-mode input[type="number"],
body.dark-mode input[type="text"] {
    background-color: #1a1d35;
    color: #f7fafc;
    border-color: #3d4466;
}

body.dark-mode select option {
    background-color: #1a1d35;
    color: #f7fafc;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(246, 179, 82, 0.1);
    transform: translateY(-1px);
}

select:hover, input:hover {
    border-color: var(--gold);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy) 0%, #1f2644 100%);
    color: white;
    border: 2px solid var(--gold);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1f2644 0%, var(--navy) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(246, 179, 82, 0.4);
    border-color: var(--gold);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-secondary) 0%, #555b7a 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #555b7a 0%, var(--text-secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 113, 153, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--coral) 0%, #e04545 100%);
    color: white;
    border: 2px solid var(--gold);
}

.btn-success:hover {
    background: linear-gradient(135deg, #e04545 0%, var(--coral) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 90, 90, 0.4);
}

.hidden {
    display: none;
}

.result-card {
    background: linear-gradient(135deg, var(--navy) 0%, #1f2644 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin-top: 25px;
    box-shadow: 0 20px 25px -5px rgba(45, 53, 97, 0.3), 0 10px 10px -5px rgba(45, 53, 97, 0.2);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--gold);
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(246, 179, 82, 0.15) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-percentage {
    font-size: 4rem;
    font-weight: 800;
    margin: 25px 0;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    letter-spacing: -2px;
    color: var(--gold);
}

.result-category {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(246, 179, 82, 0.2);
    border-radius: 12px;
    position: relative;
    z-index: 1;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
}

.result-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(246, 179, 82, 0.3);
}

.result-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--gold);
}

.result-details p {
    margin: 12px 0;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #ffffff;
}

body.dark-mode .result-details p {
    color: #f7fafc;
}

body.dark-mode .result-details strong {
    color: var(--gold);
}

.disclaimer {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 20px;
    border-radius: 12px;
    border-left: 5px solid var(--warning-color);
    margin-top: 25px;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
}

body.dark-mode .disclaimer {
    background: linear-gradient(135deg, rgba(246, 179, 82, 0.2) 0%, rgba(246, 179, 82, 0.15) 100%);
    color: #fef3c7;
    border-left-color: var(--gold);
}

body.dark-mode .disclaimer strong {
    color: var(--gold);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

body.dark-mode .help-text {
    color: #cbd5e0;
}

@media print {
    body {
        background: white;
    }
    .dark-mode-toggle, .btn, .card:not(.result-card) {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .result-percentage {
        font-size: 3rem;
    }
    
    .dark-mode-toggle {
        top: 10px;
        right: 10px;
        padding: 10px 20px;
        font-size: 1rem;
    }

    .language-toggle {
        top: 10px;
        right: 70px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .btn {
        width: 100%;
        margin-right: 0;
    }

    .card {
        padding: 25px;
    }
}

.severity-indicator {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.severity-mild {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.severity-moderate {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.severity-severe {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
}

body.dark-mode .severity-mild {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: #a7f3d0;
    border: 1px solid #10b981;
}

body.dark-mode .severity-moderate {
    background: linear-gradient(135deg, rgba(246, 179, 82, 0.3) 0%, rgba(246, 179, 82, 0.2) 100%);
    color: #fef3c7;
    border: 1px solid var(--gold);
}

body.dark-mode .severity-severe {
    background: linear-gradient(135deg, rgba(239, 90, 90, 0.3) 0%, rgba(239, 90, 90, 0.2) 100%);
    color: #fecaca;
    border: 1px solid var(--coral);
}

h3 {
    color: var(--navy);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}

body.dark-mode h3 {
    color: var(--gold);
}

.info-note {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

body.dark-mode .info-note {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #dbeafe;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content strong {
    color: #1e40af;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

body.dark-mode .info-content strong {
    color: #bfdbfe;
}

.info-content p {
    margin: 8px 0;
    line-height: 1.6;
    color: #1e3a8a;
}

body.dark-mode .info-content p {
    color: #dbeafe;
}

.formula-box {
    background: rgba(255, 255, 255, 0.5);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    border: 2px dashed #3b82f6;
    text-align: center;
}

body.dark-mode .formula-box {
    background: rgba(0, 0, 0, 0.2);
    border-color: #60a5fa;
}

.note-small {
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 10px;
    opacity: 0.9;
}

body.dark-mode .note-small {
    color: #fef9f3;
    opacity: 0.95;
}