/* 1. FONDASI & IMPORT FONT */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    /* Palet Warna - Sesuai Tema Modul */
    --primary: #1e3a5f;      /* Biru Tua */
    --secondary: #0077b6;   /* Biru Cerah */
    --accent-green: #28a745;  /* Hijau */
    --accent-yellow: #ffc300;/* Kuning Ceria */
    --accent-red: #d90429;   /* Merah PDF */
    --bg-light: #f7faff;     /* Latar Belakang Utama Paling Cerah */
    --bg-white: #ffffff;     /* FIX: Mendefinisikan white eksplisit */
    --white: #ffffff;        /* FIX: Menambahkan definisi untuk 'white' */
    --bg-alt: #f0f9ff;     /* Latar Belakang Alternatif (Biru Pucat) */
    --text-dark: #344054; 
    --text-medium: #667085;
    --text-light: #a0aec0;
    --border-soft: #eef2f7;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 30px rgba(0, 119, 182, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    font-size: 16px;
}

/* 1. Style untuk Kontainer Navigasi Kelompok */
.group-navigation {
    margin-bottom: 1.5rem; 
}

.group-navigation h3 {
    font-size: 1em; 
    font-weight: 600;
    color: var(--primary);
    padding: 0 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.group-navigation ul {
    list-style: none;
    padding: 0;
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
}

.group-navigation li a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.7em;
    border: 1px solid var(--border-soft);
    background: var(--bg-light); 
}

/* 2. Style untuk Link Kelompok yang Aktif */
.group-navigation li.active a,
.group-navigation li a:hover {
    background-color: var(--secondary); 
    color: var(--white); 
    font-weight: 600;
    border-color: var(--secondary);
    box-shadow: 0 4px 10px rgba(0, 119, 182, 0.2);
}

/* 3. Penyesuaian Ulang Daftar Isi Materi (Kritis) */
.table-of-contents ul { 
    max-height: calc(100vh - 500px); 
    list-style: none; padding: 0; 
    max-height: calc(100vh - 400px); 
    font-size: 0.7em;
}

/* FIX KRITIS: Teks Daftar Isi di Sidebar */
.table-of-contents li a {
    display: block; padding: 10px 12px; text-decoration: none;
    color: var(--text-dark); /* FIX: Menggunakan warna gelap untuk kontras */
    font-weight: 500; border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent; font-size: 0.95em;
}
.table-of-contents li.active a {
    background-color: var(--bg-alt);
    color: var(--secondary);
    font-weight: 600;
    border-left: 3px solid var(--secondary);
}

/* 2. SIDEBAR KIRI */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100vh;
    background: var(--bg-white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding: 2rem; z-index: 1000;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
}
.sidebar .logo {
    font-size: 1rem; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 10px; margin-bottom: 2rem;
    text-decoration: none;
}
.sidebar .logo i { color: var(--secondary); }
.sidebar h3 {
    font-size: 0.9em; font-weight: 600; color: var(--text-medium);
    margin: 1rem 0 1rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.table-of-contents {
    flex: 1 1 auto; 
    min-height: 0;  
    overflow-y: auto;  
    margin-bottom: 1rem; 
    
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) var(--border-soft);
}
.download-section { margin-top: 1.5rem; }
.download-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-download {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; text-decoration: none; font-weight: 500;
    border-radius: 8px; transition: all 0.3s ease;
    border: 1px solid var(--border-soft);
    background-color: var(--bg-white);
}
.btn-download:hover { box-shadow: var(--shadow-medium); transform: translateY(-2px); border-color: var(--secondary); }
.btn-download i { font-size: 1.2em; width: 20px; }
.btn-download.pdf { color: var(--accent-red); }
.btn-download.image { color: var(--accent-yellow); }
.btn-download span { color: var(--text-dark); }
.back-link {
    margin-top: auto; padding: 10px; text-align: center;
    color: var(--text-medium); text-decoration: none; font-weight: 500;
    border-radius: 8px; transition: all 0.3s ease;
}
.back-link:hover { background-color: var(--bg-light); color: var(--primary); }
.back-link-mobile { display: none; }

/* 3. KONTEN UTAMA DI KANAN */
.main-content { margin-left: 280px; padding: 0; }
.main-header { display: flex; justify-content: flex-end; align-items: center; padding: 10px 40px; }
footer { margin-left: 280px; text-align: center; padding: 2rem; color: var(--text-medium); font-size: 0.9em; }

/* 4. HERO SECTION (Kritis: Warna Teks) */
.hero-section.hero-themed {
    background: linear-gradient(135deg, var(--secondary), #1c5ab5);
    color: var(--white); /* FIX: Kritis, warna font dasar terang */
    padding: 3rem 50px;
    border-radius: 16px;
    margin: 20px;
    min-height: auto;
}
.hero-content { animation: fadeInSlideUp 0.8s ease-out forwards; }

/* FIX KRITIS: Hero Badge */
.hero-badge {
    display: inline-block; 
    background-color: var(--accent-yellow); /* Kuning Ceria */
    padding: 5px 15px; border-radius: 15px; font-size: 0.8em;
    margin-bottom: 1rem; font-weight: 500;
    color: var(--primary); /* FIX: Teks gelap di atas kuning terang */
}

.hero-themed h1 { 
    font-size: 2.5em; margin-bottom: 0.5rem; 
    color: var(--white); /* FIX: Pastikan ini white */
}
.hero-themed p { 
    font-size: 1.1em; opacity: 0.9; 
    color: var(--white); /* FIX: Pastikan ini white */
}

/* 5. BOX KONTEN UMUM */
.content-box {
    padding: 3rem 4rem; max-width: 950px; margin: 2rem auto;
    background: var(--bg-white); border-radius: 16px;
    box-shadow: var(--shadow-soft); border: 1px solid var(--border-soft);
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.content-box.section-alt { background-color: var(--bg-alt); }
.content-box.visible {
    opacity: 1;
    transform: translateY(0);
}
.content-box h2 {
    font-size: 2em; font-weight: 600; color: var(--primary);
    margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px;
    padding-bottom: 15px; border-bottom: 1px solid var(--border-soft);
}
.content-box h3 {
    font-size: 1.3em; font-weight: 600; color: var(--primary);
    margin-top: 1.5rem; margin-bottom: 0.5rem;
}
.content-box p { color: var(--text-medium); margin-bottom: 1rem; font-size: 1.05em; }
.lead { font-size: 1.15em; font-weight: 500; color: var(--text-dark); }
.content-box ol, .content-box ul { padding-left: 20px; margin-top: 1rem; }

/* 6. LAYOUT SPESIFIK & GAMBAR */

/* --- Umum Gambar --- */
/* FIX PENTING: Aturan untuk semua gambar di konten utama */
.main-content img {
    max-width: 100%;
    height: auto;
}

.centered-figure {
    width: 100%;
    margin: 1.5rem 0;
    text-align: center;
}
.centered-figure img {
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    /* Batasi lebar gambar agar tidak terlalu besar di desktop */
    max-width: 700px; /* Sesuaikan nilai ini (misalnya 700px) */
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.image-grid {
    display: grid;
    gap: 15px;
    margin: 0 auto; 
}
@media (min-width: 600px) {
    .image-grid.grid-cols-2 { grid-template-columns: 1fr 1fr; }
    .image-grid.grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.content-split {
    display: flex;
    align-items: flex-start; 
    gap: 40px;
    margin-bottom: 1rem;
}
.content-split.reverse {
    flex-direction: row-reverse;
}
.text-content {
    flex: 1;
    min-width: 0;
}
.text-content h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--primary);
    margin-top: 0; 
    margin-bottom: 0.5rem; 
}
.text-content p {
    font-size: 1.05em;
    color: var(--text-medium);
    margin-bottom: 1rem;
}
.image-content {
    flex-basis: 40%;
    flex-shrink: 0;
    max-width: 350px;
}
.content-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    display: block;
    height: auto;
}
.activity-box .content-split {
    display: flex;
    align-items: center;
    gap: 30px;
}
.activity-box .text-content {
    flex: 1;
    min-width: 0;
}
.activity-box .image-content {
    flex-basis: 35%; 
    max-width: 300px; 
    flex-shrink: 0;
}
.activity-box .content-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
}
@media (max-width: 768px) {
    .activity-box .content-split {
        flex-direction: column-reverse; 
    }
    .activity-box .image-content {
        flex-basis: auto;
        max-width: 100%;
        width: 100%;
    }
}

/* 7. KOTAK & TABEL SPESIFIK PDF (Tidak diubah) */
.activity-box {
    background-color: var(--bg-light);
    border: 1px solid var(--border-soft);
    padding: 1.5rem; border-radius: 8px; margin-top: 1.5rem;
}
.activity-box h3 { border-bottom: 1px solid var(--border-soft); padding-bottom: 10px; }
.activity-box.conclusion { background-color: #d1fae5; border-color: #6ee7b7; }
.activity-box.conclusion h3 { color: #065f46; }

/* --- PENYESUAIAN KHUSUS UNTUK KELAS 2 MODUL 1 (TEMA BENTANG ALAM) --- */

/* 1. Kustomisasi Hero Section - Memberi nuansa peta/geografi */
.hero-section.hero-themed {
    /* Mengubah gradient agar lebih menyerupai air/laut dan langit */
    background: linear-gradient(135deg, #0077b6, #00b4d8); 
}

/* 2. Style Khusus untuk Kotak Kegiatan STEAM (Kritis: Warna) */
.activity-box.steam-box {
    background-color: #e0fcfd; 
    border: 2px solid #00b4d8;
}
.activity-box.steam-box h3 {
    color: #0077b6; 
    font-weight: 700;
}
.activity-box.math-box {
    background-color: #fff8e1; 
    border: 2px solid #ffc300;
}
.activity-box.math-box h3 {
    color: #ffc300; 
    font-weight: 700;
}
.activity-box .math-box p {
    font-family: monospace, 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary);
    margin: 10px 0;
}
.steam-box i, .math-box i {
    color: inherit; 
    margin-right: 5px;
}
.content-box .content-image-small {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

/* Mengatur ukuran gambar di dalam image-grid agar seragam */
.image-grid img {
    width: 100%;
    height: 180px; /* Tinggi seragam untuk grid kecil */
    object-fit: cover;
    border-radius: 8px;
}


#jenis-daratan .activity-box {
    background-color: var(--bg-white);
    border-left: 5px solid var(--accent-green); 
}
#jenis-perairan .image-grid div {
    border: 1px solid var(--border-soft);
    padding: 15px;
    border-radius: 8px;
    background-color: #f0faff; 
    border-left: 5px solid var(--secondary); 
}
#jenis-perairan .image-grid h3 {
    margin-top: 0;
    color: var(--secondary);
}

/* Style khusus untuk kotak Art/Drawing */
.activity-box.art-box {
    background-color: #e6fffa;
    border: 2px solid #14b8a6;
    margin-top: 1.5rem;
}
.activity-box.art-box h3 {
    color: #0d9488;
}

/* 9. RESPONSIVE (Tidak diubah) */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: 250px; }
    .main-content, footer { margin-left: 0; }
    .main-header { display: flex; justify-content: flex-end; }
    .back-link { display: none; }
    .back-link-mobile {
        display: block; color: var(--secondary); text-decoration: none;
        font-weight: 500; padding: 10px;
    }
    .hero-section.hero-themed { margin: 10px; padding: 2rem; }
    .hero-themed h1 { font-size: 2em; }
    .content-box { padding: 1.5rem; margin: 1.5rem 10px; }
    .content-split { flex-direction: column; }
    .content-split.reverse { flex-direction: column; }
    .image-content { max-width: 100%; margin-top: 1.5rem; }
}