/* ====================================
   CSS RESET & VARIABLES
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Mode Colors */
    --bg-color: #ffffff;
    --surface-color: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #333333;
    --marker-color: #1a1a1a;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

body.dark-mode {
    /* Dark Mode Colors */
    --bg-color: #1a1a1a;
    --surface-color: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --accent-color: #e0e0e0;
    --marker-color: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ====================================
   HEADER
   ==================================== */

.header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    transition: var(--transition);
    min-height: 32px;
    box-sizing: border-box;
}

.lang-btn:hover {
    background-color: var(--surface-color);
}

.lang-btn.active {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.theme-toggle {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: var(--transition);
    min-height: 32px;
    box-sizing: border-box;
}

.theme-text {
    display: inline;
    line-height: inherit;
}

.theme-toggle:hover {
    background-color: var(--surface-color);
    color: var(--text-primary);
}


/* ====================================
   TIMELINE
   ==================================== */

.timeline-container {
    padding: 4rem 0;
    min-height: calc(100vh - 200px);
}

.timeline-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 30px;
    bottom: -30px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--marker-color);
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 0 3px var(--border-color);
    z-index: 1;
}

.timeline-item.current .timeline-marker {
    width: 24px;
    height: 24px;
    left: -2px;
    top: 6px;
    box-shadow: 0 0 0 4px var(--accent-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px var(--accent-color);
    }
    50% {
        box-shadow: 0 0 0 8px var(--accent-color);
    }
}

.timeline-content {
    display: block;
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

body.dark-mode .timeline-content:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.timeline-year {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* ====================================
   FOOTER
   ==================================== */

.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}


/* ====================================
   DETAIL VIEWS
   ==================================== */

.detail-view {
    display: none;
    min-height: 100vh;
    padding: 2rem 0 4rem;
    background-color: var(--surface-color);
    position: relative;
}

.detail-view:target {
    display: block;
}

/* Hide timeline and footer when detail view is active */
body:has(.detail-view:target) #timeline-view,
body:has(.detail-view:target) .footer {
    display: none;
}

.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    position: relative;
}

body.dark-mode .detail-container {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.back-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text-primary);
    background-color: var(--surface-color);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.back-btn:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 1rem;
}

.detail-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.detail-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.detail-content h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.detail-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.detail-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.detail-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}


/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 640px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-marker {
        width: 16px;
        height: 16px;
        left: 1px;
    }
    
    .timeline-item::before {
        left: 9px;
    }
    
    .detail-title {
        font-size: 2rem;
    }
    
    .back-btn {
        top: 1rem;
        right: 1rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
    
    .detail-container {
        padding: 2rem 1.5rem;
        padding-top: 4rem;
    }
    
    .detail-content h3 {
        font-size: 1.25rem;
    }
    
    .detail-content h4 {
        font-size: 1.1rem;
    }
}


/* ====================================
   ACCESSIBILITY
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

*:focus-visible,
button:focus-visible,
.lang-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
