/* ============================================
   COMPONENTS - Grade 9 Science v2.0
   ============================================ */

/* === Navigation Bar === */
.navbar {
    background: rgba(8, 13, 26, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s;
}

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

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.navbar-logo {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.93rem;
    transition: color 0.3s;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: white;
}

.navbar-menu a:hover::after,
.navbar-menu a.active::after {
    width: 100%;
}

/* Hamburger Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Mobile Nav Open State */
.navbar-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 13, 26, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    gap: 16px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    line-height: normal;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 24px -8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -8px var(--primary-glow);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: rgba(108, 99, 255, 0.06);
}

.btn-large {
    padding: 14px 36px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
}

/* === Cards === */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(108, 99, 255, 0.1);
}

.card:hover::before {
    opacity: 1;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.card-subtitle {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

/* === Hero === */
.hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(ellipse, rgba(108, 99, 255, 0.15) 0%, rgba(0, 212, 170, 0.05) 50%, transparent 70%);
    filter: blur(60px);
    z-index: 0;
    animation: pulse-glow 6s ease-in-out infinite;
}

/* Floating particle dots */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 70%, rgba(108, 99, 255, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 65% 50%, rgba(0, 212, 170, 0.15) 0%, transparent 100%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 820px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(108, 99, 255, 0.12);
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 50px;
    padding: 6px 18px;
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}


.hero-stat .number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.hero-stat .label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Chapter Topic Cards === */
.topic-card-btn {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.topic-card-btn:hover {
    background: rgba(108, 99, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -8px var(--primary-glow);
}

.topic-card-btn .topic-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.3s;
}

.topic-card-btn:hover .topic-icon {
    transform: scale(1.1);
}

/* === Quiz Interface === */
.quiz-wrapper {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.quiz-header {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15), rgba(0, 212, 170, 0.05));
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
}

.quiz-option-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
    line-height: 1.4;
}

.quiz-option-btn:hover:not(:disabled) {
    background: rgba(108, 99, 255, 0.08);
    border-color: var(--primary);
}

.quiz-option-badge {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s;
}

/* === App CTA === */
.app-cta {
    background: linear-gradient(120deg, rgba(108, 99, 255, 0.9) 0%, rgba(168, 85, 247, 0.9) 50%, rgba(0, 212, 170, 0.8) 100%);
    color: white;
    padding: 60px 30px;
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 60px 0;
}

.app-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(255,255,255,0.1)'/%3E%3C/svg%3E") repeat;
}

.app-cta h3 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    position: relative;
}

.app-cta p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    margin-bottom: 28px;
    position: relative;
}

.app-store-badge {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    margin: 0 6px 8px;
    gap: 8px;
    transition: all 0.3s;
    position: relative;
}

.app-store-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    color: white;
}

/* === Footer === */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* === AdSense units === */
.ad-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 32px 0;
    text-align: center;
    min-height: 90px;
    overflow: hidden;
}

.ad-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 6px;
}

/* === MCQ Preview === */
.mcq-preview {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin: 40px 0;
}

.mcq-question {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 24px;
    border-left: 3px solid var(--primary);
}

.mcq-option {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 14px;
}

.mcq-option.correct {
    background: rgba(46, 213, 115, 0.08);
    border-color: var(--success);
}

.mcq-option-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.mcq-option.correct .mcq-option-letter {
    background: var(--success);
    color: white;
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--accent);
}

/* === Feature Items === */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.feature-item {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--gradient-card);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -16px rgba(0, 0, 0, 0.5);
}

.feature-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
    display: inline-block;
}

.feature-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  /* Standardize mobile flow and touch targets (min 44px) */
  .navbar-menu a, .footer a, .footer-col a, .btn, .card a, .nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .footer a, .footer-col a {
    padding: 8px 0;
  }

    .navbar-menu {
        display: none;
    }

    .navbar-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: rgba(8, 13, 26, 0.98);
        border-bottom: 1px solid var(--border);
        padding: 20px;
        gap: 16px;
        z-index: 999;
    }

    .navbar-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 20px;
    }

    .hero-stat .number {
        font-size: 1.6rem;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .app-cta h3 {
        font-size: 1.6rem;
    }

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

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
}