/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Inspired by Moldova flag (blue, yellow, red) */
    --primary-blue: #003893;
    --primary-yellow: #FFD400;
    --primary-red: #CE1126;
    
    /* Neutral Colors */
    --dark-navy: #1a2332;
    --medium-gray: #5a6c7d;
    --light-gray: #f5f7fa;
    --white: #ffffff;
    --off-white: #fafbfc;
    
    /* Accent Colors */
    --accent-blue: #2563eb;
    --accent-light-blue: #dbeafe;
    
    /* Typography */
    --font-sans: 'Noto Sans JP', sans-serif;
    --font-serif: 'Noto Serif JP', serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Layout */
    --max-width: 1200px;
    --nav-height: 70px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.8;
    color: var(--dark-navy);
    background-color: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* ==========================================
   Navigation
   ========================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--medium-gray);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-blue);
    background-color: var(--accent-light-blue);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1e40af 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 212, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(206, 17, 38, 0.1) 0%, transparent 50%);
    animation: heroAnimation 20s ease-in-out infinite;
}

@keyframes heroAnimation {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.hero-content {
    position: relative;
    text-align: center;
    color: var(--white);
    z-index: 2;
    padding: var(--spacing-md);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 2px;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 300;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--primary-yellow);
    color: var(--dark-navy);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.4s backwards;
    box-shadow: 0 4px 15px rgba(255, 212, 0, 0.3);
}

.hero-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 212, 0, 0.4);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Main Content & Sections
   ========================================== */
.main-content {
    margin-top: var(--nav-height);
}

.chapter {
    padding: var(--spacing-xl) 0;
    background-color: var(--white);
}

.chapter-alt {
    background-color: var(--light-gray);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.chapter-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.8s ease-out;
}

.chapter-number {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
    background-color: var(--accent-light-blue);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 1px;
}

.chapter-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--dark-navy);
    margin-bottom: var(--spacing-sm);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==========================================
   Content Grid & Blocks
   ========================================== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

.content-block {
    background-color: var(--white);
    padding: var(--spacing-lg);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.chapter-alt .content-block {
    background-color: var(--white);
}

.content-block:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.content-block.full-width {
    grid-column: 1 / -1;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-yellow);
    display: inline-block;
}

.subsection {
    margin-bottom: var(--spacing-md);
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-navy);
    margin-bottom: var(--spacing-sm);
    padding-left: 1rem;
    border-left: 4px solid var(--primary-red);
}

.text-content {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--dark-navy);
    margin-bottom: var(--spacing-sm);
    text-align: justify;
}

.text-content:last-child {
    margin-bottom: 0;
}

.intro-text {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--medium-gray);
    font-style: italic;
    padding: var(--spacing-md);
    background-color: var(--light-gray);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    margin-bottom: var(--spacing-lg);
}

.info-box {
    background-color: var(--light-gray);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--primary-yellow);
}

/* ==========================================
   Timeline
   ========================================== */
.timeline-container {
    padding: var(--spacing-lg) 0;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-blue), var(--primary-red));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    opacity: 0;
    animation: slideIn 0.6s ease-out forwards;
}

.timeline-item:nth-child(odd) {
    justify-content: flex-start;
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }
.timeline-item:nth-child(10) { animation-delay: 1s; }
.timeline-item:nth-child(11) { animation-delay: 1.1s; }
.timeline-item:nth-child(12) { animation-delay: 1.2s; }
.timeline-item:nth-child(13) { animation-delay: 1.3s; }
.timeline-item:nth-child(14) { animation-delay: 1.4s; }
.timeline-item:nth-child(15) { animation-delay: 1.5s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: var(--primary-yellow);
    border: 4px solid var(--white);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px var(--primary-blue);
    z-index: 10;
}

.timeline-content {
    width: 45%;
    background-color: var(--white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-content {
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    text-align: left;
}

.timeline-content:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.timeline-year {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dark-navy);
}

/* ==========================================
   Video Container
   ========================================== */
.video-container {
    margin: var(--spacing-lg) 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.video-placeholder {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 30%, rgba(255, 255, 255, 0.1) 70%, transparent 70%);
    background-size: 100px 100px;
    animation: moveStripes 3s linear infinite;
}

@keyframes moveStripes {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100px 100px;
    }
}

.video-placeholder-content {
    text-align: center;
    color: var(--white);
    z-index: 2;
    position: relative;
}

.video-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-sm);
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.video-placeholder-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.video-placeholder-subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

video, iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background-color: var(--dark-navy);
    color: var(--white);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.footer p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
    
    .nav-menu {
        gap: var(--spacing-sm);
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .hero {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .chapter {
        padding: var(--spacing-lg) 0;
    }
    
    .content-block {
        padding: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .subsection-title {
        font-size: 1.1rem;
    }
    
    .text-content {
        font-size: 1rem;
        text-align: left;
    }
    
    /* Timeline Mobile */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        justify-content: flex-end !important;
        padding-left: 50px;
    }
    
    .timeline-marker {
        left: 20px;
    }
    
    .timeline-content {
        width: 100%;
        text-align: left !important;
    }
    
    .video-icon {
        width: 60px;
        height: 60px;
    }
    
    .video-placeholder-text {
        font-size: 1.2rem;
    }
    
    .video-placeholder-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--spacing-sm);
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .nav-menu {
        gap: 0.25rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .chapter-number {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .hero,
    #navbar,
    .footer,
    .video-placeholder {
        display: none;
    }
    
    .chapter {
        page-break-inside: avoid;
        padding: var(--spacing-md) 0;
    }
    
    .content-block {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}