/* ===== SciExplore — Styles ===== */
:root {
    --primary: #2E8B57;
    --primary-dark: #1a6b3c;
    --secondary: #3498DB;
    --secondary-dark: #2471a3;
    --accent: #FFD700;
    --dark: #2C3E50;
    --darker: #1a252f;
    --light: #ECF0F1;
    --white: #ffffff;
    --text: #333333;
    --text-light: #bdc3c7;
    --shadow: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    background: var(--light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== NAVBAR ===== */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

#navbar.scrolled {
    background: rgba(26, 37, 47, 0.95);
    backdrop-filter: blur(20px);
    padding: 10px 0;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
}

/* ===== HERO ===== */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #1a3a4a 30%, #0d3b2e 60%, #1a252f 100%);
    background-image: url('img/banner.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(46,139,87,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(52,152,219,0.15) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    max-width: 900px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-light);
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(46,139,87,0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(46,139,87,0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--white);
    box-shadow: 0 4px 20px rgba(52,152,219,0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(52,152,219,0.5);
}

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ===== SECTIONS ===== */
.section {
    padding: 100px 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 12px;
    font-weight: 900;
}

.section-desc {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 60px;
    font-weight: 300;
}

/* Intro */
.intro-section { background: var(--white); }

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.intro-card {
    padding: 48px 40px;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.intro-card:hover { transform: translateY(-6px); }

.biology-intro {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-left: 5px solid var(--primary);
}

.chemistry-intro {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 5px solid var(--secondary);
}

.intro-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.intro-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.intro-card p { color: var(--text); line-height: 1.8; }

/* Bio section */
.section-bio {
    background: linear-gradient(180deg, #f0faf4 0%, #e8f5e9 100%);
}

.section-bio .section-title { color: var(--primary-dark); }

/* Chimie section */
.section-chem {
    background: linear-gradient(180deg, #f0f7fd 0%, #e3f2fd 100%);
}

.section-chem .section-title { color: var(--secondary-dark); }

/* Topic cards */
.topic-card {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: var(--transition);
}

.topic-card:hover { box-shadow: 0 8px 40px rgba(0,0,0,0.1); }

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.topic-header:hover { background: rgba(0,0,0,0.02); }

.topic-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.toggle-icon {
    font-size: 0.9rem;
    color: #95a5a6;
    transition: var(--transition);
}

.topic-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-content.open {
    max-height: 5000px;
}

.topic-grid {
    padding: 0 32px 32px;
}

.topic-text h4 {
    font-size: 1.1rem;
    margin: 24px 0 10px;
    color: var(--dark);
    font-weight: 700;
}

.topic-text h4:first-child { margin-top: 0; }

.topic-text p { margin-bottom: 12px; }

/* Info boxes */
.info-box {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 4px solid var(--secondary);
    padding: 20px 24px;
    border-radius: 0 12px 12px 0;
    margin: 16px 0;
}

.info-box.highlight {
    border-left-color: var(--accent);
    background: linear-gradient(135deg, #fffde7, #fff9c4);
}

.info-box.warning {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fce4ec, #ffcdd2);
}

.info-box p { margin-bottom: 6px; }
.info-box p:last-child { margin-bottom: 0; }

/* Lists */
.science-list {
    list-style: none;
    padding: 0;
}

.science-list li {
    padding: 10px 0 10px 28px;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.science-list li:last-child { border-bottom: none; }

.science-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* pH scale */
.ph-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.ph-scale span {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
}

.ph-acid { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.ph-neutral { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.ph-base { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); }

/* ===== GALLERY ===== */
.section-gallery {
    background: var(--darker);
    color: var(--white);
}

.section-gallery .section-title { color: var(--white); }
.section-gallery .section-desc { color: var(--text-light); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.1); }
.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-overlay h4 { color: var(--white); font-size: 1.2rem; margin-bottom: 4px; }
.gallery-overlay p { color: var(--text-light); font-size: 0.9rem; }

/* ===== QUIZ ===== */
.section-quiz {
    background: linear-gradient(180deg, #fafafa, #f0f0f0);
}

#quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

#quiz-question h3 { font-size: 1rem; color: var(--secondary); margin-bottom: 8px; }
#quiz-question p { font-size: 1.2rem; font-weight: 600; margin-bottom: 20px; }

#quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-opt {
    width: 100%;
    padding: 16px 20px;
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    font-family: inherit;
}

.quiz-opt:hover {
    background: #dfe6e9;
    border-color: var(--secondary);
    transform: translateX(4px);
}

.quiz-opt.correct {
    background: #d4edda;
    border-color: var(--primary);
    color: var(--primary-dark);
}

.quiz-opt.wrong {
    background: #f8d7da;
    border-color: #e74c3c;
    color: #c0392b;
}

.correct-text { color: var(--primary); font-weight: 600; font-size: 1.1rem; }
.wrong-text { color: #e74c3c; font-weight: 600; font-size: 1.1rem; }
.result-msg { font-size: 1.3rem; text-align: center; padding: 20px 0; }

#quiz-score {
    text-align: center;
    margin-top: 20px;
    font-weight: 600;
    color: var(--dark);
    font-size: 1.1rem;
}

#quiz-next { display: none; margin-top: 20px; }

/* ===== FOOTER ===== */
footer {
    background: var(--darker);
    color: var(--text-light);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}
.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.9rem;
}

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

.hero-content > * {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-content > :nth-child(1) { animation-delay: 0.2s; }
.hero-content > :nth-child(2) { animation-delay: 0.4s; }
.hero-content > :nth-child(3) { animation-delay: 0.6s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: rgba(26, 37, 47, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 4px;
    }

    .nav-links.active { display: flex; }

    .nav-toggle { display: block; }

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

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

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

    .topic-header { padding: 18px 20px; }
    .topic-grid { padding: 0 20px 20px; }

    #quiz-container { padding: 24px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .btn { padding: 12px 24px; font-size: 0.9rem; }
}
