* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px 50px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: #2c3e50;
    color: white;
    margin-bottom: 30px;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-content > div:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    pointer-events: none;
}

.header-content > div:first-child * {
    pointer-events: auto;
}

.language-selector {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    z-index: 10;
}

.lang-button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.lang-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    padding: 10px 0px;
    cursor: pointer;
    color: #2c3e50;
    transition: background 0.2s ease;
}

.lang-option:first-child {
    border-radius: 6px 6px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 6px 6px;
}

.lang-option:hover {
    background: #ecf0f1;
}

.lang-option.active {
    background: #34495e;
    color: white;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

nav {
    background: white;
    padding: 15px;
    margin: 20px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

nav a {
    color: #2c3e50;
    text-decoration: none;
    padding: 10px 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background: #34495e;
    color: white;
}

section {
    background: white;
    margin: 30px 0;
    padding: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 300;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
}

.timeline {
    position: relative;
    padding: 40px 0;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-track {
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #34495e;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    margin-left: 0;
    text-align: right;
    padding-right: 40px;
    width: calc(50% - 20px);
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
    padding-left: 40px;
    width: calc(50% - 20px);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid #34495e;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    background: #34495e;
}

.timeline-content {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timeline-date {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.timeline-symptom {
    font-size: 0.95em;
    color: #4a5568;
    line-height: 1.5;
}

@media (min-width: 769px) and (max-width: 900px) {
    .container {
        padding: 0px 20px;
    }

    .lang-button {
        font-size: 0.75em;
        padding: 10px 5px;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 10px;
    }
    
    nav a {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        border-bottom: 1px solid #ecf0f1;
    }
    
    nav a:last-child {
        border-bottom: none;
    }

    .header-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .header-content > div:first-child {
        text-align: center;
    }
    
    .language-selector {
        justify-self: auto;
    }
    
    .lang-button {
        width: 100%;
        justify-content: center;
        font-size: 0.9em;
    }
    
    .lang-dropdown {
        right: auto;
        left: 0;
        width: 100%;
        min-width: 150px;
        font-size: 1em;
    }

    section {
        padding: 15px;
    }
    
    .timeline-line {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 50px;
        margin-right: 0;
        text-align: left;
        padding-left: 20px;
        padding-right: 20px;
        width: calc(100% - 50px);
    }
    
    .timeline-dot {
        left: 20px;
    }

    .container {
        padding: 0px;
    }

    .chart-container canvas {
        font-size: 12px;
    }

    .tooltip,
    .header-tooltip {
        display: none !important;
    }
}

.text-content h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.text-content p {
    margin-bottom: 15px;
    color: #4a5568;
    text-align: justify;
}

.text-content ul li {
    color: #4a5568;
    margin-left: 15px;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

th, td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f9f9f9;
}

.grade-0 { background-color: #9df !important; }
.grade-1 { background-color: #9e9 !important; }
.grade-2 { background-color: #7d7 !important; }
.grade-3 { background-color: #feb !important; }
.grade-4 { background-color: #fe9 !important; }
.grade-5 { background-color: #fd7 !important; }
.grade-6 { background-color: #fa4 !important; }
.grade-7 { background-color: #e11 !important; color: #fff !important; }
.grade-8 { background-color: #d11 !important; color: #fff !important; }
.grade-9 { background-color: #a11 !important; color: #fff !important; }
.grade-10 { background-color: #700 !important; color: #fff !important; }

td:nth-child(7),
td:nth-child(12),
td:nth-child(17),
td:nth-child(22),
td:nth-child(27),
td:nth-child(28) 
{
    border-right: 2px solid #2c3e50 !important;
}

.small-text {
    font-size: 0.75em;
}

#langToggle:hover {
    background: #2c3e50 !important;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 15px 0px 50px;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.subnote {
    display: block;
    margin: -5px 0px 0px;
    font-size: 0.4em;
    color: #aaa;
}

.note-icon {
    cursor: help;
    font-size: 1.2em;
    position: relative;
}

.note-icon:hover {
    color: #2980b9;
}

.tooltip {
    display: none;
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 1000;
    white-space: pre-line;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    left: 100%;
    bottom: 0;
    margin-left: 10px;
}

.tooltip::after {
    content: '';
    position: absolute;
    right: 100%;
    bottom: 5px;
    border: 5px solid transparent;
    border-right-color: #2c3e50;
}

.note-icon:hover .tooltip {
    display: block;
    width: 300px;
}

.header-tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.header-tooltip {
    display: none;
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    z-index: 1000;
    white-space: pre-line;
    max-width: 250px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    margin-top: 5px;
}

.header-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #2c3e50;
}

.header-tooltip-container:hover .header-tooltip {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
    color: #2c3e50;
}

.modal-text {
    color: #2c3e50;
    font-size: 1.1em;
    line-height: 1.6;
    margin-top: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}