/* IB Chemistry Syllabus - Unified Styles v2 */
/* Visual Identity: Matches 'Experiments' (Deep Blue / Gold) */
/* Layout Patterns: Matches 'Economics' (Cards, Footer, Exam Qs) */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    /* Matches Experiments background */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* ===== Header (Matches Experiments) ===== */
.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    color: #e2e8f0;
}

/* ===== Back Button ===== */
.back-button {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(30, 58, 95, 0.9);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-button:hover {
    background: #c9a227;
    /* Gold accent hover */
    color: #1e3a5f;
    transform: translateY(-2px);
}

/* ===== Layout Container ===== */
.container {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: 1300px;
    margin: 2rem auto;
    gap: 2rem;
    padding: 0 1.5rem 4rem;
}

/* ===== Sidebar ===== */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar h3 {
    color: #1e3a5f;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #c9a227;
    /* Gold underline */
    padding-bottom: 0.5rem;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.2rem;
}

.nav-list a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-list a:hover {
    background: #f0f4f8;
    color: #1e3a5f;
    transform: translateX(3px);
}

.nav-list a.active {
    background: rgba(201, 162, 39, 0.15);
    color: #b8941f;
    /* Dark Gold */
    font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 0;
    /* Prevent overflow */
}

.section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

/* Headings */
.section h2 {
    color: #1e3a5f;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h3 {
    color: #2c5282;
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
}

.section h4 {
    color: #1e3a5f;
    font-size: 1.15rem;
    margin: 1rem 0 0.5rem 0;
}

/* ===== Cards & Content Blocks (Economics Style) ===== */
.card {
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #c9a227;
    /* Default Gold Border */
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(00, 0, 0, 0.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

/* Key Concept / Definition */
.key-concept {
    background: #f8fafc;
    border-left: 4px solid #1e3a5f;
    /* Blue Border */
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.key-concept.hl {
    background: #fcfaff;
    border-left-color: #8b5cf6;
    /* Purple for HL */
}

/* Real Life Box */
.real-life-box {
    background: #f0fdf4;
    /* Light Green */
    border-left: 4px solid #10b981;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.real-life-box h4 {
    color: #059669;
}

/* Info & Warning */
.info-box {
    background: #f1f5f9;
    border-left: 4px solid #64748b;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.warning-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Mnemonic / Memory Aid Box */
.mnemonic-box {
    background: #f0fdfa;
    border-left: 4px solid #14b8a6;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.mnemonic-box h4 {
    color: #0d9488;
    margin-bottom: 0.5rem;
}

.mnemonic-box .mnemonic-phrase {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f766e;
    letter-spacing: 0.5px;
    margin: 0.75rem 0;
}

/* Common Mistakes / Exam Pitfalls Box */
.common-mistakes {
    background: #fff7ed;
    border-left: 4px solid #f97316;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.common-mistakes h4 {
    color: #ea580c;
    margin-bottom: 0.5rem;
}

.common-mistakes li {
    margin-bottom: 0.5rem;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th {
    background: #1e3a5f;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* ===== Interactive Link Cards (Experiments) ===== */
.interactive-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #c9a227;
    /* Gold for Interactives */
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.interactive-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.interactive-card h3 {
    margin: 0;
    color: #1e3a5f;
    font-size: 1.25rem;
}

.badge-available {
    background: #c9a227;
    color: #1e3a5f;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Button Primary (Gold Gradient - Matches Experiments) */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #c9a227 0%, #d4a82a 100%);
    color: #1e3a5f;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(201, 162, 39, 0.2);
    width: fit-content;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.4);
}

/* ===== Exam Style Questions (Details/Summary) ===== */
details {
    background: #f8f9fa;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #1e3a5f;
    /* Economics Style: Blue Left Border */
}

/* CRITICAL: Indent bullet points to prevent touching left border */
details ul {
    margin-left: 2rem;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: #1e3a5f;
    padding: 0.5rem;
    /* Removed flex to allow text to flow inline */
}

summary:hover {
    background: #e9ecef;
    border-radius: 4px;
}

details[open] summary {
    margin-bottom: 1rem;
    border-bottom: 2px solid #c9a227;
}

.details-content {
    /* Removed specific padding as parent details has padding now */
    padding: 0.5rem 0;
}

/* ===== Attribution / Footer ===== */
.attribution {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.attribution img {
    height: 60px;
    margin-top: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 1.5rem;
    }
}

/* ===== Image Placeholders (Dev Only) ===== */
.image-placeholder {
    border: 3px dashed #cbd5e1;
    background: #f1f5f9;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    border-radius: 12px;
    color: #64748b;
    position: relative;
}

.image-placeholder::before {
    content: '🖼️ Image Placeholder';
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.image-placeholder .prompt {
    font-family: 'Consolas', 'Monaco', monospace;
    background: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    display: block;
    margin-top: 1rem;
    color: #334155;
    font-size: 0.85rem;
    text-align: left;
    border: 1px solid #cbd5e1;
}

.image-placeholder .size-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #cbd5e1;
    color: #475569;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ========================================= */
/* LANDING PAGE STYLES (Matches Economics)   */
/* ========================================= */

.landing-container {
    display: block !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Landing Header - Overrides default header */
.landing-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
    background: transparent;
    box-shadow: none;
    color: #1e3a5f;
}

.landing-header h1 {
    font-size: 3.5rem;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
    text-shadow: none;
    font-weight: 800;
}

.landing-header p {
    font-size: 1.4rem;
    color: #475569;
    opacity: 1;
    font-weight: 400;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.logo-container img {
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Landing Section Title */
.landing-section-title {
    font-size: 2rem;
    color: #1e3a5f;
    margin: 4rem 0 2rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid #c9a227;
    text-align: left;
}

/* Landing Grid */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Topic Card (Economics Style) */
.topic-card-landing {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    /* For wrapping anchor */
}

.topic-card-landing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #1e3a5f 0%, #c9a227 100%);
}

.topic-card-landing:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.topic-number {
    font-size: 3rem;
    font-weight: 800;
    color: #e2e8f0;
    /* Default subtle */
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: color 0.3s;
}

.topic-card-landing:hover .topic-number {
    color: #c9a227;
    /* Gold on hover */
}

.topic-title {
    font-size: 1.5rem;
    color: #1e3a5f;
    margin-bottom: 1rem;
    font-weight: 700;
}

.topic-description {
    color: #64748b;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: auto;
    width: fit-content;
}

.status-badge.available {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-badge.coming-soon {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Interactive Banner */
.interactive-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 4rem 2rem;
    color: white;
    text-align: center;
    margin-bottom: 4rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s;
}

.interactive-banner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    pointer-events: none;
}

.interactive-banner:hover {
    transform: scale(1.02);
}

.interactive-banner h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-button {
    display: inline-block;
    background: #c9a227;
    color: #1e3a5f;
    padding: 0.8rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.interactive-banner:hover .banner-button {
    background: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .landing-header h1 {
        font-size: 2.5rem;
    }

    .logo-container img {
        height: 80px;
    }

    .landing-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Experiment Hub Cards (Migrated from experiments.html) ===== */
.experiments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.experiment-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.experiment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1e3a5f 0%, #c9a227 100%);
}

.experiment-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: #c9a227;
}

.card-level {
    font-size: 0.8rem;
    font-weight: bold;
    color: #c9a227;
    margin-bottom: 0.3rem;
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.3rem;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card-description {
    color: #64748b;
    line-height: 1.5;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-tags span {
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.tag-sl {
    background: rgba(30, 58, 95, 0.1);
    color: #1e3a5f;
}

.tag-hl {
    background: rgba(201, 162, 39, 0.15);
    color: #b8941f;
}

.tag-new {
    background: #fee2e2;
    color: #ef4444;
}

/* Landing Section Dividers */
.hub-section-title {
    font-size: 2.2rem;
    /* Increased from 1.8rem */
    font-weight: 800;
    /* Extra bold */
    color: #1e3a5f;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e2e8f0;
    /* Thicker underline */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hub-section-subtitle {
    font-size: 1.3rem;
    font-weight: 700;
    /* Bold */
    color: #475569;
    margin: -0.5rem 0 1.5rem 0;
    /* Adjusted margin */
}