/* ═══════════════════════════════════════════════════
   موقع الشيخ أحمد السيد — Stylesheet
   "Emerald Scholar" Design System — Green + Gold
   ═══════════════════════════════════════════════════ */

:root {
    /* ── Color Palette ── */
    --bg: #F7FAF7;
    --bg-card: #FAFDF8;
    --bg-alt: #EDF5E8;
    --bg-dark: #0F1F15;
    --bg-dark-light: #162A1C;
    --text: #1A2E1A;
    --text-secondary: #4A5D4A;
    --text-muted: #7A8E7A;
    --border: #D4E3D0;
    --border-light: #E5EFE2;
    --accent: #1B6B3A;
    --accent-hover: #145530;
    --accent-light: rgba(27, 107, 58, 0.08);
    --copper: #B8860B;
    --copper-light: #FDF5E0;
    --gold: #B8860B;
    --gold-light: #FFF8E7;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 40px rgba(0,0,0,0.12);
    --shadow-green: 0 4px 20px rgba(27, 107, 58, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'IBM Plex Sans Arabic', 'Noto Naskh Arabic', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════════════
   Header / Navigation
   ═══════════════════════════════════════════════════ */
.header {
    background: var(--bg-dark);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: white;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--copper) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.logo-text h1 {
    font-family: 'Amiri', serif;
    font-size: 20px;
    font-weight: 700;
}

.logo-text span {
    font-size: 11px;
    opacity: 0.45;
    font-weight: 300;
}

/* Desktop Nav */
.nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-link {
    padding: 8px 18px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.nav-link.active {
    color: white;
    background: var(--accent);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.hamburger:hover {
    background: rgba(255,255,255,0.1);
}

.hamburger svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Mobile Menu Overlay */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 31, 21, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu.open {
    display: flex;
    opacity: 1;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-close svg {
    width: 28px;
    height: 28px;
}

.mobile-menu a {
    color: white;
    font-size: 22px;
    font-family: 'Amiri', serif;
    padding: 14px 40px;
    border-radius: 12px;
    transition: var(--transition);
    text-align: center;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: var(--accent);
}

/* ═══════════════════════════════════════════════════
   Container
   ═══════════════════════════════════════════════════ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
}

/* ═══════════════════════════════════════════════════
   Hero Section (Landing Page)
   ═══════════════════════════════════════════════════ */
.hero {
    background: linear-gradient(160deg, #0F1F15 0%, #0A2E1A 40%, #1A3A28 70%, #0F1F15 100%);
    color: white;
    text-align: center;
    padding: 80px 40px 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(60deg, transparent, transparent 60px, rgba(27,107,58,0.06) 60px, rgba(27,107,58,0.06) 61px),
        repeating-linear-gradient(-60deg, transparent, transparent 60px, rgba(184,134,11,0.04) 60px, rgba(184,134,11,0.04) 61px);
    pointer-events: none;
}

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

.hero-name {
    font-family: 'Amiri', serif;
    font-size: 52px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--copper);
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.hero-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.8;
}

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

.btn {
    padding: 14px 32px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(27, 107, 58, 0.3);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════════
   About / Stats Section
   ═══════════════════════════════════════════════════ */
.about-section {
    padding: 60px 40px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.about-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-family: 'Amiri', serif;
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--text);
}

.about-text p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 2;
}

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

.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   Landing Page Sections
   ═══════════════════════════════════════════════════ */
.landing-section {
    padding: 60px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.landing-section.alt-bg {
    background: var(--bg-card);
    max-width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.landing-section.alt-bg .section-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-family: 'Amiri', serif;
    font-size: 34px;
    margin-bottom: 10px;
    color: var(--text);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
}

/* Decorative bar under section titles */
.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--copper));
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════
   Series Grid (Landing + Series page)
   ═══════════════════════════════════════════════════ */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.series-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.series-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.series-card-accent {
    height: 5px;
    width: 100%;
}

.series-card-body {
    padding: 28px 28px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.series-card-title {
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--text);
}

.series-card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.7;
    flex: 1;
}

.series-card-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.series-meta-item strong {
    color: var(--accent);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   Smart Tools Cards
   ═══════════════════════════════════════════════════ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.tool-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.tool-card-icon svg {
    width: 32px;
    height: 32px;
}

.tool-card-icon.search-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.tool-card-icon.rag-icon {
    background: rgba(184, 134, 11, 0.1);
    color: var(--copper);
}

.tool-card h3 {
    font-family: 'Amiri', serif;
    font-size: 22px;
    margin-bottom: 10px;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.tool-card .btn {
    padding: 10px 24px;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   Books & Programs Cards
   ═══════════════════════════════════════════════════ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.book-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: var(--transition);
}

.book-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--copper);
}

.book-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--copper-light);
    color: var(--copper);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.book-icon svg {
    width: 24px;
    height: 24px;
}

.book-card h3 {
    font-family: 'Amiri', serif;
    font-size: 18px;
    color: var(--text);
    line-height: 1.6;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.program-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: var(--transition);
}

.program-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
}

.program-card h3 {
    font-family: 'Amiri', serif;
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

.program-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.program-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.program-badge.online {
    background: var(--accent-light);
    color: var(--accent);
}

.program-badge.onsite {
    background: rgba(184, 134, 11, 0.1);
    color: var(--copper);
}

/* ═══════════════════════════════════════════════════
   Episodes Grid
   ═══════════════════════════════════════════════════ */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.episode-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.episode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.episode-thumb {
    height: 180px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.episode-thumb-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: repeating-linear-gradient(
        45deg, transparent, transparent 20px,
        rgba(255,255,255,1) 20px, rgba(255,255,255,1) 21px
    );
}

.episode-thumb-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.episode-number-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(0,0,0,0.6);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.episode-yt-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.episode-info {
    padding: 20px;
}

.episode-info h3 {
    font-family: 'Amiri', serif;
    font-size: 17px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.episode-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    align-items: center;
}

.transcript-badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* ── Episode Card Play Overlay ─────────── */
.episode-card:hover .episode-thumb::after {
    content: '\25B6';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    color: white;
    font-size: 32px;
    z-index: 3;
    transition: var(--transition);
}

/* ═══════════════════════════════════════════════════
   Series Page Hero Banner
   ═══════════════════════════════════════════════════ */
.series-hero {
    background: var(--bg-dark);
    color: white;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
}

.series-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(60deg, transparent, transparent 60px, rgba(27,107,58,0.06) 60px, rgba(27,107,58,0.06) 61px);
    pointer-events: none;
}

.series-hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.series-hero .breadcrumb {
    margin-bottom: 16px;
}

.series-hero .breadcrumb a {
    color: rgba(255,255,255,0.6);
}

.series-hero .breadcrumb a:hover {
    color: white;
}

.series-hero .breadcrumb-sep {
    color: rgba(255,255,255,0.3);
}

.series-hero h2 {
    font-family: 'Amiri', serif;
    font-size: 36px;
    margin-bottom: 8px;
}

.series-hero-desc {
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    margin-bottom: 20px;
}

.series-hero-stats {
    display: flex;
    gap: 32px;
}

.series-hero-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--copper);
}

.series-hero-stat .stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

/* ═══════════════════════════════════════════════════
   Breadcrumb
   ═══════════════════════════════════════════════════ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

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

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

.breadcrumb-sep {
    color: var(--text-muted);
    font-size: 12px;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   Stats Bar (legacy — inner pages)
   ═══════════════════════════════════════════════════ */
.stats-bar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.stats-inner {
    display: flex;
    gap: 32px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.stat-item { text-align: center; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════
   Section Titles (legacy — inner pages)
   ═══════════════════════════════════════════════════ */
.section-title {
    font-family: 'Amiri', serif;
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 40px;
}

/* ═══════════════════════════════════════════════════
   Episode Page
   ═══════════════════════════════════════════════════ */
.back-link {
    display: inline-block;
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 16px;
}

.episode-header {
    margin-bottom: 32px;
}

.episode-page-title {
    font-family: 'Amiri', serif;
    font-size: 28px;
    margin-bottom: 8px;
}

.episode-page-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.episode-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════
   Episode Transcript Panel
   ═══════════════════════════════════════════════════ */
.episode-transcript {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.transcript-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.transcript-header h3 {
    font-family: 'Amiri', serif;
    font-size: 20px;
}

.transcript-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ep-search-mode-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.ep-mode-btn {
    padding: 7px 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.ep-mode-btn.active {
    background: var(--accent);
    color: white;
}

.transcript-search {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 200px;
    transition: var(--transition);
    background: var(--bg);
}

.transcript-search:focus {
    border-color: var(--accent);
}

.ep-search-submit {
    padding: 7px 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.ep-search-submit:hover { background: var(--accent-hover); }
.ep-search-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.ep-search-results-info {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    width: 100%;
    padding-top: 4px;
}

/* Semantic search match highlight */
.transcript-chunk.semantic-match {
    background: var(--gold-light);
    border-right: 3px solid var(--gold);
    position: relative;
}

.semantic-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.transcript-body {
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
}

.transcript-chunk {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: var(--transition);
}

.transcript-chunk:hover {
    background: var(--accent-light);
}

.transcript-chunk.active {
    background: var(--accent-light);
    border-right: 3px solid var(--accent);
}

.timestamp-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    padding: 2px 8px;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.timestamp-btn:hover {
    background: var(--accent);
    color: white;
}

.transcript-text {
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}

.transcript-text mark {
    background: var(--gold-light);
    color: var(--gold);
    padding: 0 4px;
    border-radius: 3px;
}

/* ── Section TOC (under video) ───────────── */
.section-toc {
    margin-top: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.section-toc-title {
    font-family: 'Amiri', serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text);
}

.toc-item:hover { background: var(--accent-light); }
.toc-item.active { background: var(--accent-light); }

.toc-item.active .toc-number {
    background: var(--accent);
    color: white;
}

.toc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.toc-title-text {
    flex: 1;
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    line-height: 1.5;
}

.toc-time {
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-size: 12px;
    color: var(--accent);
    flex-shrink: 0;
}

/* ── Transcript Sections ────────────────── */
.section-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #EDF5E8;
    border-bottom: 2px solid var(--accent);
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 2;
}

.section-header-row:hover {
    background: #DDEBD6;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.section-title-text {
    flex: 1;
    font-family: 'Amiri', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.5;
}

.section-time {
    font-family: 'IBM Plex Sans Arabic', monospace;
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
    font-weight: 600;
}

.section-content {
    padding: 8px 16px 16px;
}

/* ═══════════════════════════════════════════════════
   Search Section
   ═══════════════════════════════════════════════════ */
.search-hero {
    text-align: center;
    padding: 60px 0 40px;
}

.search-hero h2 {
    font-family: 'Amiri', serif;
    font-size: 40px;
    margin-bottom: 12px;
}

.search-hero p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 4px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 20px;
    font-size: 17px;
    font-family: inherit;
    background: transparent;
    color: var(--text);
}

.search-input::placeholder { color: var(--text-muted); }

.search-submit {
    padding: 14px 32px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.search-submit:hover { background: var(--accent-hover); }
.search-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Search Controls ───────────────────── */
.search-controls-card {
    max-width: 800px;
    margin: 24px auto 0;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
}

.search-controls {
    max-width: 800px;
    margin: 24px auto 0;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mode-toggle {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--accent);
    color: white;
}

.results-meta {
    display: inline-block;
    padding: 4px 14px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.rag-inline-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px auto 24px;
    max-width: 800px;
}

.enhance-toggles {
    display: flex;
    gap: 12px;
}

.enhance-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.enhance-toggle:hover {
    border-color: var(--accent);
}

.enhance-toggle:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.enhance-toggle input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.weight-slider {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weight-slider input[type=range] {
    width: 120px;
    accent-color: var(--accent);
}

.weight-label {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
}

/* ── Filter Pills ──────────────────────── */
.filter-pills {
    max-width: 800px;
    margin: 16px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.series-filters {
    margin-bottom: 8px;
}

.filter-pill {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-family: inherit;
}

.filter-pill:hover { border-color: var(--accent); }

.filter-pill.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.series-pill {
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   Results
   ═══════════════════════════════════════════════════ */
.results-area {
    max-width: 900px;
    margin: 40px auto 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.result-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--border-light);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-episode-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-episode-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.result-episode-title {
    font-size: 13px;
    color: var(--text-secondary);
}

.result-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.result-text {
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    font-size: 16px;
    line-height: 2;
    color: var(--text);
    margin-bottom: 16px;
}

.result-text mark {
    background: var(--gold-light);
    color: var(--gold);
    padding: 0 4px;
    border-radius: 3px;
}

.result-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.timestamp-link {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--accent-light);
    border-radius: 6px;
    transition: var(--transition);
}

.timestamp-link:hover {
    background: var(--accent);
    color: white;
}

.episode-link {
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.episode-link:hover { color: var(--accent); }

.result-scores {
    display: flex;
    gap: 12px;
    margin-right: auto;
    margin-left: 0;
}

.score-badge {
    font-size: 12px;
    color: var(--text-muted);
}

.score-badge strong {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════
   RAG Section
   ═══════════════════════════════════════════════════ */
.rag-hero {
    text-align: center;
    padding: 60px 0 40px;
}

.rag-hero h2 {
    font-family: 'Amiri', serif;
    font-size: 36px;
    margin-bottom: 12px;
}

.rag-chat {
    max-width: 800px;
    margin: 0 auto;
}

.rag-filters {
    max-width: 800px;
    margin: 0 auto 12px;
}

.rag-messages {
    min-height: 200px;
    margin-bottom: 24px;
}

.rag-message {
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

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

.rag-q {
    background: var(--accent-light);
    border: 1px solid rgba(27, 107, 58, 0.15);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.rag-q-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rag-a {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.rag-a-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--copper);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.rag-answer {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 16px;
    line-height: 2;
}

.rag-sources {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.rag-sources-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.rag-source {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 13px;
}

.rag-source-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rag-source-episode {
    font-weight: 600;
    white-space: nowrap;
}

.rag-source-preview {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.rag-source-timestamp {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.rag-source-score {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   Loading & Empty State
   ═══════════════════════════════════════════════════ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 15px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p { font-size: 15px; }

/* ═══════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════ */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    margin-top: 80px;
    padding: 48px 40px 24px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand h3 {
    font-family: 'Amiri', serif;
    font-size: 22px;
    color: white;
    margin-bottom: 8px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255,255,255,0.5);
}

.footer-links h4,
.footer-social h4 {
    font-family: 'Amiri', serif;
    font-size: 16px;
    color: white;
    margin-bottom: 16px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent);
    color: white;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
}

/* ═══════════════════════════════════════════════════
   Formatted Transcript — Reading Page
   ═══════════════════════════════════════════════════ */
.formatted-transcript-btn {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent);
    color: white !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.formatted-transcript-btn:hover {
    background: var(--accent-hover);
}

.formatted-transcript-btn.prominent {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white !important;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(27, 107, 58, 0.25);
    transition: var(--transition);
}

.formatted-transcript-btn.prominent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(27, 107, 58, 0.35);
}

/* Reading page layout */
.reading-page {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
}

/* Sidebar */
.transcript-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    padding: 24px 20px;
    background: var(--bg-card);
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-header .back-link {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 12px;
}

.sidebar-title {
    font-family: 'Amiri', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.sidebar-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: var(--text);
}

.sidebar-toc-item:hover {
    background: var(--accent-light);
}

.sidebar-toc-item.active {
    background: var(--accent-light);
}

.sidebar-toc-item.active .sidebar-toc-number {
    background: var(--accent);
    color: white;
}

.sidebar-toc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-toc-text {
    flex: 1;
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    line-height: 1.5;
}

/* Sidebar scrollbar */
.transcript-sidebar::-webkit-scrollbar { width: 4px; }
.transcript-sidebar::-webkit-scrollbar-track { background: transparent; }
.transcript-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Main reading area */
.reading-main {
    flex: 1;
    padding: 40px 48px;
    max-width: 900px;
}

.reading-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--accent);
}

.reading-title {
    font-family: 'Amiri', serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.5;
}

.reading-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Sections */
.reading-section {
    margin-bottom: 48px;
}

.reading-section-title {
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
}

.reading-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

/* Section body — formatted text */
.reading-section-body {
    font-family: 'Noto Naskh Arabic', 'Amiri', serif;
    font-size: 18px;
    line-height: 2.2;
    color: var(--text);
    text-align: justify;
}

.reading-section-body p {
    margin-bottom: 16px;
}

/* Quran verses — inline */
.transcript-quran {
    color: #1B5E20;
    font-family: 'Amiri', serif;
    font-weight: 700;
}

/* Hadith quotes */
.transcript-hadith {
    color: #4A148C;
    font-family: 'Amiri', serif;
    font-weight: 600;
    background: rgba(74, 20, 140, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Numbered points */
.transcript-point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    background: var(--accent-light);
    border-right: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
}

.point-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    margin-top: 4px;
}

.point-text {
    flex: 1;
    line-height: 2.2;
}

/* ═══════════════════════════════════════════════════
   Scrollbar Styling
   ═══════════════════════════════════════════════════ */
.transcript-body::-webkit-scrollbar { width: 6px; }
.transcript-body::-webkit-scrollbar-track { background: transparent; }
.transcript-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.transcript-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   Scroll Progress Bar
   ═══════════════════════════════════════════════════ */
.scroll-progress {
    position: fixed;
    top: 70px;
    right: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    z-index: 99;
    transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════════════
   Back-to-Top Button
   ═══════════════════════════════════════════════════ */
.back-to-top {
    position: fixed;
    bottom: 32px;
    left: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(27, 107, 58, 0.3);
    z-index: 90;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(27, 107, 58, 0.4);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

/* ═══════════════════════════════════════════════════
   Hero Floating Shapes & Bismillah
   ═══════════════════════════════════════════════════ */
.hero-float {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.hero-float-1 {
    width: 400px;
    height: 400px;
    background: rgba(27, 107, 58, 0.15);
    top: -100px;
    right: -100px;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-float-2 {
    width: 300px;
    height: 300px;
    background: rgba(184, 134, 11, 0.12);
    bottom: -80px;
    left: -80px;
    animation: heroFloat 10s ease-in-out infinite reverse;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.hero-bismillah {
    font-family: 'Amiri', serif;
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* ═══════════════════════════════════════════════════
   Scroll Reveal Animations
   ═══════════════════════════════════════════════════ */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   Series Cover Art
   ═══════════════════════════════════════════════════ */
.series-card-cover {
    height: 160px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.series-card-cover .cover-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    transition: opacity 0.4s ease;
}

.series-card:hover .cover-pattern {
    opacity: 0.25;
}

/* Unique patterns per series */
.cover-pattern[data-pattern="star"] {
    background:
        conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(255,255,255,0.3) 30deg, transparent 60deg) 0 0 / 40px 40px,
        conic-gradient(from 30deg at 50% 50%, transparent 0deg, rgba(255,255,255,0.2) 30deg, transparent 60deg) 20px 20px / 40px 40px;
}

.cover-pattern[data-pattern="lattice"] {
    background:
        repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(255,255,255,0.2) 15px, rgba(255,255,255,0.2) 16px),
        repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(255,255,255,0.2) 15px, rgba(255,255,255,0.2) 16px);
}

.cover-pattern[data-pattern="hexagon"] {
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.25) 15%, transparent 16%) 0 0 / 30px 30px,
                radial-gradient(circle at 50% 50%, rgba(255,255,255,0.15) 15%, transparent 16%) 15px 15px / 30px 30px;
}

.cover-pattern[data-pattern="arches"] {
    background:
        radial-gradient(ellipse 40px 60px at 50% 100%, transparent 55%, rgba(255,255,255,0.2) 56%, transparent 57%) 0 0 / 50px 50px;
}

.cover-pattern[data-pattern="diamond"] {
    background:
        linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, rgba(255,255,255,0.15) 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.15) 75%) 0 0 / 20px 20px,
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.15) 75%) 0 0 / 20px 20px;
}

.cover-pattern[data-pattern="stripes"] {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(255,255,255,0.15) 8px, rgba(255,255,255,0.15) 10px),
        radial-gradient(circle, rgba(255,255,255,0.2) 2px, transparent 2px) 0 0 / 20px 20px;
}

.series-cover-title {
    position: relative;
    z-index: 2;
    color: white;
    font-family: 'Amiri', serif;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    padding: 0 24px;
    text-align: center;
    line-height: 1.5;
}

.series-cover-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   3D CSS Book Shapes
   ═══════════════════════════════════════════════════ */
.book-visual {
    perspective: 600px;
    width: 100px;
    height: 130px;
    margin: 0 auto 16px;
}

.book-3d {
    position: relative;
    width: 100%;
    height: 100%;
    transform: rotateY(-8deg);
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.book-card:hover .book-3d {
    transform: rotateY(-12deg) rotateX(3deg);
}

.book-face {
    position: absolute;
    inset: 0;
    border-radius: 4px 8px 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.15);
}

.book-face-ornament {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    margin: 6px 0;
}

.book-face-title {
    color: white;
    font-family: 'Amiri', serif;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.book-face-author {
    color: rgba(255,255,255,0.7);
    font-size: 9px;
    margin-top: 4px;
}

.book-spine {
    position: absolute;
    top: 0;
    right: -12px;
    width: 12px;
    height: 100%;
    border-radius: 0 3px 3px 0;
    transform: rotateY(90deg) translateZ(0px);
    transform-origin: left center;
}

/* ═══════════════════════════════════════════════════
   Program Card Gradient Headers
   ═══════════════════════════════════════════════════ */
.program-card-header {
    height: 80px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius) var(--radius) 0 0;
    margin: -28px -24px 20px;
}

.program-card-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg, transparent, transparent 10px,
        rgba(255,255,255,0.06) 10px, rgba(255,255,255,0.06) 12px
    );
}

.program-header-icon {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.program-header-icon svg {
    width: 24px;
    height: 24px;
}

/* ═══════════════════════════════════════════════════
   Enhanced Card Hovers
   ═══════════════════════════════════════════════════ */
.series-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 8px 32px rgba(27, 107, 58, 0.15);
    border-color: var(--accent);
}

.tool-card {
    position: relative;
    overflow: hidden;
}

.tool-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--accent-light);
    top: -60px;
    left: -60px;
    transition: transform 0.5s ease;
    z-index: 0;
}

.tool-card:hover::after {
    transform: scale(3);
}

.tool-card > * {
    position: relative;
    z-index: 1;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 32px rgba(27, 107, 58, 0.12);
    border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   Skeleton Loading
   ═══════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

.skeleton-tag {
    display: inline-block;
    width: 80px;
    height: 28px;
    border-radius: 8px;
    margin-left: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   Footer Decorative Border
   ═══════════════════════════════════════════════════ */
.footer-decorative-border {
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent));
}

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .episode-layout {
        grid-template-columns: 1fr;
    }

    .transcript-sidebar {
        display: none;
    }

    .reading-main {
        padding: 24px 20px;
        max-width: 100%;
    }

    .about-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* Scroll progress */
    .scroll-progress { top: 60px; }
    .back-to-top { bottom: 20px; left: 20px; width: 42px; height: 42px; }

    /* Header */
    .header-inner { padding: 0 20px; height: 60px; }
    .nav { display: none; }
    .hamburger { display: block; }
    .logo-text h1 { font-size: 17px; }
    .logo-icon { width: 36px; height: 36px; font-size: 18px; }
    .logo { gap: 10px; }

    /* Container */
    .container { padding: 24px 20px; }

    /* Hero */
    .hero { padding: 50px 20px 40px; }
    .hero-name { font-size: 36px; }
    .hero-subtitle { font-size: 17px; }
    .hero-tagline { font-size: 14px; }
    .hero-bismillah { font-size: 18px; }
    .hero-float-1 { width: 200px; height: 200px; }
    .hero-float-2 { width: 150px; height: 150px; }

    /* Series covers */
    .series-card-cover { height: 120px; }
    .series-cover-title { font-size: 18px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 280px; justify-content: center; }

    /* About */
    .about-section { padding: 40px 20px; }
    .about-text h2 { font-size: 26px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 28px; }

    /* Landing sections */
    .landing-section { padding: 40px 20px; }
    .section-header h2 { font-size: 28px; }

    /* Grids */
    .episodes-grid { grid-template-columns: 1fr; }
    .series-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: 1fr; }
    .books-grid { grid-template-columns: repeat(2, 1fr); }
    .programs-grid { grid-template-columns: 1fr; }

    /* Search */
    .search-hero h2 { font-size: 28px; }
    .search-controls, .search-controls-card { flex-direction: column; align-items: stretch; }

    /* Series hero */
    .series-hero { padding: 32px 20px; }
    .series-hero h2 { font-size: 28px; }
    .series-hero-stats { flex-wrap: wrap; gap: 16px; }

    /* Episode */
    .episode-page-meta { flex-wrap: wrap; gap: 10px; }
    .series-card-body { padding: 20px; }
    .series-card-title { font-size: 18px; }
    .breadcrumb { font-size: 13px; gap: 6px; }

    /* Stats bar */
    .stats-inner { flex-wrap: wrap; gap: 16px; }

    /* Footer */
    .footer { padding: 40px 20px 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    /* Section TOC & header */
    .section-toc { max-height: 200px; padding: 12px 14px; }
    .section-header-row { padding: 10px 14px; gap: 8px; }
    .section-title-text { font-size: 14px; }
    .section-content { padding: 4px 10px 12px; }

    /* Reading page */
    .reading-title { font-size: 24px; }
    .reading-section-title { font-size: 18px; }
    .reading-section-body { font-size: 16px; line-height: 2; }
    .reading-meta { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 480px) {
    .books-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 24px; }
    .hero-name { font-size: 30px; }
}
