:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

body.lms-page {
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.06),
            transparent 40%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(99, 102, 241, 0.05),
            transparent 50%
        ),
        var(--bg);
}

/* AUTH PAGES */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    max-width: 1000px;
    width: 90%;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.auth-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    flex: 1;
}

.logo h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo p {
    color: var(--text-light);
}

.auth-form h2 {
    margin: 2rem 0 0.5rem;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--secondary);
    cursor: not-allowed;
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-info {
    flex: 1;
    color: white;
    padding: 2rem;
}

.auth-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.features {
    list-style: none;
    margin-top: 2rem;
}

.features li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* LMS PAGE */
.lms-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left h1 {
    font-size: 1.5rem;
    color: var(--primary);
}


.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-logout {
    background: var(--error);
    color: white;
}

.main-container {
    display: flex;
    flex: 1;
    
}




.books-list, .history-list {
    max-height: 300px;
    overflow-y: auto;
}

.book-item, .history-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.book-item:hover, .history-item:hover {
    background: #e0e7ff;
}

.btn-block {
    width: 100%;
}

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

.loading {
    color: var(--text-light);
    font-style: italic;
}


.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 2rem auto;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.loading-container {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.page-display-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    gap: 2.5rem;
    width: 100%;
    align-items: start;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* AVATAR (LEFT - CONSTANT) */
.avatar-section {
    flex-shrink: 0;
    text-align: center;
}

.professor-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    background: white;
}

.avatar-label {
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--primary);
}

/* PAGE (CENTER - CHANGES) */
.page-section {
    flex: 1;
}

.page-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.75rem 3rem;
    min-height: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

/* PAGE FLIP ANIMATION */
.page-card.flipping {
    animation: pageFlip 0.6s ease-in-out;
}

@keyframes pageFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); opacity: 0.5; }
    100% { transform: rotateY(0deg); }
}

.page-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.page-number {
    font-weight: 500;
    color: var(--primary);
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.page-body {
    font-size: 1.05rem;
    line-height: 1.9;
  
}

.page-body h1,
.page-body h2,
.page-body h3 {
    margin: 0.6rem 0 0.4rem;
}

.page-body p {
    margin: 0.4rem 0;
}

.page-body ul,
.page-body ol {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.page-body li {
    margin: 0.25rem 0;
}

.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

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

.btn-nav:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* AUDIO (RIGHT) */
.audio-section {
   position: relative;
}

.audio-player::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.audio-player {
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 1.8rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.audio-player:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
}
.btn-generate-audio {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.2rem;
}

.btn-control {
    width: 100%;
    padding: 0.7rem;
    border-radius: 12px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s ease;
    margin-top: 0.6rem;
}

.btn-control.primary {
    background: #2563eb;
    color: white;
}

.btn-control.primary:hover {
    background: #1e40af;
}

.btn-control.secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-control.secondary:hover {
    background: #d1d5db;
}
.btn-generate-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}


.audio-label {
    font-weight: 500;
    margin-bottom: 1rem;
}

#audioPlayer {
    width: 100%;
    margin-bottom: 1rem;
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-audio {
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.references-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.references-section h4 {
    margin-bottom: 1rem;
}

#referencesList {
    list-style: none;
}

#referencesList li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    padding-left: 1.5rem;
    position: relative;
}

#referencesList li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    .auth-info {
        display: none;
    }
    .main-container {
        flex-direction: column;
    }
   
    .page-display-wrapper {
        flex-direction: column;
    }
}



/* ============================= */
/* 🌙 DARK MODE THEME */
/* ============================= */

body.dark-mode {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.6);
}

/* Smooth transition */
body {
    transition: background 0.3s ease, color 0.3s ease;
}

.page-card,

.audio-player,
.references-section,
.top-nav {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    margin-right: 1rem;
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}


.theme-toggle:hover {
    background: none;
    color:var(--primary);
}

body.dark-mode .theme-toggle {
    color: #facc15;  /* soft yellow sun */
}

body:not(.dark-mode) .theme-toggle {
    color: #334155;  /* dark moon color */
}

/* ================================= */
/* 🚀 DASHBOARD CARDS DESIGN */
/* ================================= */

.dashboard-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-hero p {
    color: var(--text-light);
}

/* Grid */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Card */
.feature-card {
    position: relative;
    padding: 2.75rem 2.25rem 2.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s ease;
    overflow: hidden;
}

/* Glass morphism dark mode */
body.dark-mode .feature-card {
    background: rgba(30, 41, 59, 0.6);
}

/* Animated Gradient Border */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(
        130deg,
        #2563eb,
        #10b981,
        #6366f1,
        #2563eb
    );
    background-size: 300% 300%;
    animation: gradientMove 6s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Hover */
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Icon */
.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

/* Micro animation */
.feature-card:hover .card-icon {
    transform: scale(1.15) rotate(8deg);
}

/* Entrance animation */
.feature-card {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.3s; }
.feature-card:nth-child(3) { animation-delay: 0.5s; }

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


/* =====================================================
   ADD THIS ENTIRE BLOCK AT THE BOTTOM OF style.css
   ===================================================== */

/* ─── HERO SECTION ─────────────────────────────────── */

.dashboard-hero {
    text-align: center;
    padding: 3rem 2rem 2.5rem;
    position: relative;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    animation: fadeSlideUp 0.5s ease forwards;
}

.dashboard-hero h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    animation: fadeSlideUp 0.6s ease 0.1s both;
}

.dashboard-hero p {
    color: var(--text-light);
    font-size: 1.05rem;
    animation: fadeSlideUp 0.6s ease 0.2s both;
}


/* ─── DASHBOARD CARDS GRID ──────────────────────────── */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    padding: 0 0.5rem;
    max-width: 1100px;
    margin: 0 auto;
}


/* ─── FEATURE CARD ──────────────────────────────────── */

.feature-card {
    position: relative;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    background: var(--card-bg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.35s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;

    /* Entrance animations */
    animation: fadeSlideUp 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.35s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }
.feature-card:nth-child(4) { animation-delay: 0.85s; }

/* Animated gradient border via ::before */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(130deg, #2563eb, #10b981, #6366f1, #2563eb);
    background-size: 300% 300%;
    animation: gradientMove 12s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Soft glow blob behind card */
.card-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    top: -30px;
    right: -30px;
    z-index: 0;
}

.card--doubts  .card-glow { background: #2563eb; }
.card--learning .card-glow { background: #10b981; }
.card--mocktest .card-glow { background: #6366f1; }
.card--cfa-exam .card-glow { background: #0B3D6B; }

.feature-card:hover .card-glow {
    opacity: 0.18;
}

/* Hover lift */
.feature-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0,0,0,0.13);
}

.feature-card:active {
    transform: scale(0.98);
}


/* Glassmorphism dark mode */
body.dark-mode .feature-card {
    background: rgba(30, 41, 59, 0.75);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}


/* ─── CARD INNER ELEMENTS ───────────────────────────── */

.card-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.feature-card:hover .card-icon {
    transform: scale(1.2) rotate(8deg);
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    width: fit-content;
    margin-bottom: 0.25rem;
}

.card--doubts  .card-tag { background: #dbeafe; color: #1d4ed8; }
.card--learning .card-tag { background: #d1fae5; color: #065f46; }
.card--mocktest .card-tag { background: #ede9fe; color: #5b21b6; }
.card--cfa-exam .card-tag { background: #E8F0F8; color: #0B3D6B; }

body.dark-mode .card--doubts  .card-tag { background: rgba(37,99,235,0.25); color: #93c5fd; }
body.dark-mode .card--learning .card-tag { background: rgba(16,185,129,0.25); color: #6ee7b7; }
body.dark-mode .card--mocktest .card-tag { background: rgba(99,102,241,0.25); color: #c4b5fd; }
body.dark-mode .card--cfa-exam .card-tag { background: rgba(91,155,216,0.22); color: #9CC4E8; }

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0.25rem 0 0.75rem;
}

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.card-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.card-arrow {
    font-size: 1.1rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    display: inline-block;
}

.feature-card:hover .card-arrow {
    transform: translateX(5px);
}


/* ─── GRADIENT ANIMATION (already in file, kept for safety) ── */

@keyframes gradientMove {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes fadeSlideUp {
    from { 
        transform: translateX(-80px); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}


/* ─── FOOTER ────────────────────────────────────────── */

.lms-footer {
    margin-top: 1.25rem;
    text-align: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.02);
}


/* ─── BREADCRUMB ─────────────────────────────────────── */

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.4s ease both;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
}

.breadcrumb-link:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(-2px);
}

.breadcrumb-arrow {
    font-size: 1rem;
}

.breadcrumb-sep {
    color: var(--border);
}

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


/* ─── INNER PAGE HERO ────────────────────────────────── */

.inner-page-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.5s ease 0.1s both;
    opacity: 0;
    border-left: 4px solid var(--primary);
}

.inner-hero-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.inner-hero-text h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.inner-hero-text p {
    color: var(--text-light);
    font-size: 0.95rem;
}


/* ─── COMING SOON CARD ───────────────────────────────── */

.coming-soon-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    animation: fadeSlideUp 0.6s ease 0.2s both;
    opacity: 0;
}


@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

.coming-soon-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.coming-soon-card p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.coming-soon-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
}

.csf-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.csf-item:hover {
    background: #e0e7ff;
}

body.dark-mode .csf-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.csf-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-back-doubt {
    display: inline-block;
    width: auto;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    text-decoration: none;
}
.btn-back-doubt:hover {
    text-decoration: none;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
        padding: 0;
    }
    .dashboard-hero h2 {
        font-size: 1.6rem;
    }
    .inner-page-hero {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== NO SIDEBAR LAYOUT ===== */

.main-container.no-sidebar {
    display: block;
}

.content-area.full-width {
    width: 100%;
    max-width: 100%;   /* remove restriction */
    margin: 0;
    padding: 3rem 1rem;  /* control side spacing manually */
}

/* ============================= */
/* 🕒 NAV DATETIME - BADGE STYLE */
/* ============================= */

.nav-datetime {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 24px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.datetime-date {
    color: var(--text-light);
    font-weight: 500;
}

.time-separator {
    opacity: 0.4;
}

/* 🔥 TIME BADGE */
.datetime-time {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    letter-spacing: 0.6px;
    color: var(--primary);
}

/* Dark mode version */
body.dark-mode .datetime-time {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #93c5fd;
}

/* ================================================================
   📚 LEARNING PATH — BOOK CARDS & TABLE OF CONTENTS
   Add this ENTIRE BLOCK to the very bottom of your style.css
   ================================================================ */


/* ─── LEARNING BOOKS GRID ───────────────────────────────────────── */

.learning-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 420px));
    gap: 1.75rem;
    justify-content: left;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0.25rem;
}


/* ─── BOOK CARD ─────────────────────────────────────────────────── */

.book-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    background: var(--card-bg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;

    /* Staggered entrance */
    animation: fadeSlideUp 0.65s ease both;
    opacity: 0;
}

.book-card:nth-child(1) { animation-delay: 0.10s; }
.book-card:nth-child(2) { animation-delay: 0.25s; }
.book-card:nth-child(3) { animation-delay: 0.40s; }

/* Animated gradient border */
.book-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(130deg, #2563eb, #10b981, #6366f1, #2563eb);
    background-size: 300% 300%;
    animation: gradientMove 12s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.35s ease;
}

.book-card--active::before {
    opacity: 1;
}

/* Active card — hover lift */
.book-card--active {
    cursor: pointer;
}
.book-card--active:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.13);
}
.book-card--active:hover::before {
    animation-duration: 3s;
}
.book-card--active:active {
    transform: scale(0.98);
}

/* Soon card — muted, no hover */
.book-card--soon {
    opacity: 0.68;
    cursor: not-allowed;
    filter: grayscale(25%);
}
.book-card--soon::before {
    opacity: 0.25;
    animation-play-state: paused;
}

/* Soft glow blob */
.book-card-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #2563eb;
    filter: blur(70px);
    opacity: 0;
    top: -40px;
    right: -40px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.book-card--active:hover .book-card-glow {
    opacity: 0.12;
}

/* Dark mode */
body.dark-mode .book-card {
    background: rgba(30, 41, 59, 0.75);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}


/* ─── CARD TOP ROW ──────────────────────────────────────────────── */

.book-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.book-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-card--active:hover .book-icon-wrap {
    transform: scale(1.18) rotate(6deg);
}

.book-icon {
    font-size: 1.8rem;
    line-height: 1;
    display: block;
}

.book-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.book-badge--available {
    background: #d1fae5;
    color: #065f46;
}
.book-badge--soon {
    background: #f1f5f9;
    color: #64748b;
}

body.dark-mode .book-badge--available {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}
body.dark-mode .book-badge--soon {
    background: rgba(255, 255, 255, 0.07);
    color: #94a3b8;
}


/* ─── CARD BODY ─────────────────────────────────────────────────── */

.book-card-body {
    position: relative;
    z-index: 1;
    flex: 1;
}

.book-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.book-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.book-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}


/* ─── CARD FOOTER ───────────────────────────────────────────────── */

.book-card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.book-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.book-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.book-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.book-progress-label {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 500;
}

.book-cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-cta-row--disabled {
    opacity: 0.6;
}

.book-cta-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.book-cta-arrow {
    font-size: 1rem;
    color: var(--primary);
    display: inline-block;
    transition: transform 0.3s ease;
}

.book-card--active:hover .book-cta-arrow {
    transform: translateX(5px);
}


/* ─── TABLE OF CONTENTS PAGE ────────────────────────────────────── */

.toc-book-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    border-left: 5px solid var(--primary);
    animation: fadeSlideUp 0.5s ease 0.1s both;
    opacity: 0;
}

.toc-book-icon-wrap {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.toc-book-meta {
    flex: 1;
}

.toc-book-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    display: block;
    margin-bottom: 0.3rem;
}

.toc-book-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.toc-book-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.toc-book-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.toc-stat {
    font-size: 0.85rem;
    color: var(--text-light);
}

.toc-stat strong {
    color: var(--primary);
    font-weight: 700;
}

.toc-stat-sep {
    color: var(--border);
    font-size: 1rem;
}


/* ─── TOC SEARCH ────────────────────────────────────────────────── */

.toc-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 520px;
    margin-bottom: 1.75rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}

.toc-search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.toc-search-input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.toc-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.toc-search-clear {
    position: absolute;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: background 0.2s;
}

.toc-search-clear:hover {
    background: var(--secondary);
    color: white;
}


/* ─── ACCORDION CHAPTER ─────────────────────────────────────────── */

.toc-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.toc-chapter {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border-left: 4px solid var(--chapter-color, var(--primary));
    transition: box-shadow 0.25s ease;
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
}

.toc-chapter:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
}

.toc-chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background 0.2s ease;
}

.toc-chapter-header:hover {
    background: rgba(37, 99, 235, 0.04);
}

.toc-chapter-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.toc-chapter-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toc-chapter--open .toc-chapter-icon {
    transform: scale(1.15) rotate(8deg);
}

.toc-chapter-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.toc-chapter-num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toc-chapter-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--text);
}

.toc-chapter-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.toc-topic-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border-radius: 999px;
    white-space: nowrap;
}

.toc-chapter-chevron {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
    display: inline-block;
}

.toc-chapter--open .toc-chapter-chevron {
    transform: rotate(180deg);
}


/* ─── CHAPTER BODY (COLLAPSIBLE) ────────────────────────────────── */

.toc-chapter-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.toc-chapter--open .toc-chapter-body {
    max-height: 2000px;
    padding: 0 1.5rem 1.25rem;
}


/* ─── TOPIC ROW ─────────────────────────────────────────────────── */

.toc-topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.toc-topic {
    border-radius: 10px;
    overflow: hidden;
    transition: background 0.2s ease;
}

.toc-topic-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    cursor: default;
    transition: background 0.2s ease;
}

.toc-topic-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.toc-topic-number {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 2.4rem;
    flex-shrink: 0;
}

.toc-topic-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.toc-subtopic-count {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: auto;
}


/* ─── SUBTOPIC LIST ─────────────────────────────────────────────── */

.toc-subtopic-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toc-subtopic-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 7px;
    transition: background 0.15s ease;
    cursor: default;
}

.toc-subtopic-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.toc-subtopic-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    opacity: 0.5;
}

.toc-subtopic-text {
    font-size: 0.84rem;
    color: var(--text-light);
    line-height: 1.4;
}


/* ─── NO RESULTS ────────────────────────────────────────────────── */

.toc-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.toc-no-results span {
    font-size: 2.5rem;
}


/* ─── BOOK COMING SOON (book2, book3) ───────────────────────────── */

.book-coming-soon {
    max-width: 560px;
    margin: 0 auto;
}

.bcs-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: pulse 2.5s ease-in-out infinite;
}

.bcs-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: #fef9c3;
    color: #92400e;
    margin-bottom: 1rem;
}

body.dark-mode .bcs-badge {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.book-coming-soon--2 .bcs-badge {
    background: #fce7f3;
    color: #9d174d;
}

.book-coming-soon--3 .bcs-badge {
    background: #d1fae5;
    color: #065f46;
}

body.dark-mode .book-coming-soon--2 .bcs-badge {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
}

body.dark-mode .book-coming-soon--3 .bcs-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}


/* ─── RESPONSIVE ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .learning-books-grid {
        grid-template-columns: 1fr;
    }

    .toc-book-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .toc-book-stats {
        justify-content: center;
    }

    .toc-chapter-header {
        padding: 0.9rem 1rem;
    }

    .toc-chapter-body {
        padding: 0 1rem;
    }

    .toc-chapter--open .toc-chapter-body {
        padding: 0 1rem 1rem;
    }

    .toc-subtopic-list {
        padding-left: 1.5rem;
    }
}

/* ══════════════════════════════════════════════════════════════════
   📚 LMS LEARNING PATH — COMPLETE CSS
   APPEND this entire block to the bottom of your style.css
   ══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────
   SHARED TABLE CARD WRAPPER
   ───────────────────────────────────────────────────────────────── */

.lp-table-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}


/* ─────────────────────────────────────────────────────────────────
   BOOK OVERVIEW PAGE — book1.html / book2.html
   ───────────────────────────────────────────────────────────────── */

/* ── Book header card ─────────────────────────────────────────── */

.lp-book-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both;
    opacity: 0;
}

.lp-bh-icon-wrap {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.07);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.lp-bh-info {
    flex: 1;
}

.lp-bh-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.lp-bh-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.lp-bh-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lp-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.lp-tag--subject {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.lp-tag--progress {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.25);
}

body.dark-mode .lp-tag           { background: rgba(37,99,235,0.2);  color: #93c5fd; border-color: rgba(37,99,235,0.3); }
body.dark-mode .lp-tag--subject  { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
body.dark-mode .lp-tag--progress { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }

/* Progress circle (book header right side) */
.lp-bh-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.lp-bh-circle {
    position: relative;
    width: 60px;
    height: 60px;
}

.lp-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.lp-circle-bg,
.lp-circle-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.lp-circle-bg   { stroke: var(--border); }
.lp-circle-fill {
    stroke: var(--primary);
    transition: stroke-dasharray 0.6s ease;
}

.lp-circle-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.lp-bh-overall-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-light);
}


/* ── Module table ──────────────────────────────────────────────── */

.lp-module-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.lp-th {
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.85rem 1.25rem;
    text-align: left;
    white-space: nowrap;
}

body.dark-mode .lp-th { background: #0f172a; color: #94a3b8; }

.lp-th--num      { width: 60px;  }
.lp-th--name     { width: auto;  }
.lp-th--contents { width: 180px; }
.lp-th--progress { width: 160px; }
.lp-th--action   { width: 190px; }

.lp-module-row {
    border-bottom: 1px solid var(--border);
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
    transition: background 0.2s ease;
}

.lp-module-row:last-child { border-bottom: none; }
.lp-module-row:hover      { background: rgba(37, 99, 235, 0.03); }

/* Cells */
.lp-td-num,
.lp-td-name,
.lp-td-contents,
.lp-td-progress,
.lp-td-action {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

.lp-mod-num {
    width: 34px;
    height: 34px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.lp-mod-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.lp-mod-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.lp-mtag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-light);
}

body.dark-mode .lp-mtag { background: rgba(255,255,255,0.06); }

.lp-contents-text {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Progress bar */
.lp-prog-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lp-prog-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.lp-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.lp-prog-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 2.5rem;
}

/* Start / Continue / Review button */
.btn-start-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-start-module:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-start-module:active {
    transform: scale(0.97);
}

.btn-start-module--done {
    background: var(--success);
}

.btn-start-module--done:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


/* ─────────────────────────────────────────────────────────────────
   MODULE DETAIL PAGE — module.html
   ───────────────────────────────────────────────────────────────── */

/* ── Module header card ───────────────────────────────────────── */

.lp-mod-header-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both;
    opacity: 0;
}

.lp-mhc-num {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
}

.lp-mhc-info {
    flex: 1;
}

.lp-mhc-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.lp-mhc-book {
    font-size: 0.82rem;
    color: var(--text-light);
}

.lp-mhc-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.lp-mhc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.lp-mhc-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.lp-stat-done {
    color: var(--success);
}

.lp-mhc-stat-lbl {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}


/* ── Subtopic table ───────────────────────────────────────────── */

.lp-subtopic-table-card {
    animation-delay: 0.12s;
}

.lp-subtopic-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.lp-th--slno    { width: 72px;  }
.lp-th--subname { width: auto;  }
.lp-th--time    { width: 110px; }
.lp-th--done    { width: 70px; text-align: center; }

/* Topic section header row */
.lp-topic-header-row {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

body.dark-mode .lp-topic-header-row { background: rgba(255,255,255,0.04); }

.lp-td-dash {
    padding: 0.65rem 1.25rem;
    color: var(--text-light);
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
}

.lp-td-topic-title {
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lp-topic-pin {
    font-size: 1rem;
}

/* Subtopic rows */
.lp-sub-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.18s ease, opacity 0.3s ease;
}

.lp-sub-row:last-child { border-bottom: none; }

.lp-td-slno {
    padding: 0.8rem 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.lp-td-subname {
    padding: 0.8rem 0.75rem;
    font-size: 0.9rem;
}

.lp-td-time {
    padding: 0.8rem 0.75rem;
    white-space: nowrap;
}

.lp-time-badge {
    font-size: 0.8rem;
    color: var(--text-light);
}

.lp-td-done {
    padding: 0.8rem;
    text-align: center;
}

/* Unlocked row */
.lp-sub-row--unlocked { background: var(--card-bg); }
.lp-sub-row--unlocked:hover { background: rgba(37, 99, 235, 0.04); }

/* Locked row */
.lp-sub-row--locked {
    background: var(--card-bg);
    opacity: 0.55;
}

/* Done row */
.lp-sub-row--done {
    background: rgba(16, 185, 129, 0.04);
}

.lp-sub-row--done .lp-td-slno,
.lp-sub-row--done .lp-td-subname {
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-color: rgba(16, 185, 129, 0.4);
}

/* Active row (currently reading) */
.lp-sub-row--active {
    background: rgba(37, 99, 235, 0.07) !important;
    border-left: 3px solid var(--primary);
}

/* Newly unlocked highlight */
@keyframes unlockFlash {
    0%   { background: rgba(16, 185, 129, 0.2); }
    100% { background: transparent; }
}

.lp-sub-row--just-unlocked {
    animation: unlockFlash 1.2s ease forwards;
}

/* Shake (when trying to open locked) */
@keyframes shakeRow {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

.lp-sub-row--shake {
    animation: shakeRow 0.45s ease;
}

/* Subtopic link button */
.lp-sub-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.2s;
    text-align: left;
    font-family: inherit;
}

.lp-sub-link:hover {
    color: var(--primary-dark);
    text-decoration-style: solid;
}

/* Locked subtopic label */
.lp-sub-locked {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-lock-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Done checkbox */
.lp-done-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--success);
    cursor: pointer;
    border-radius: 4px;
}

.lp-done-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}


/* ─────────────────────────────────────────────────────────────────
   LLM CONTENT PANEL
   ───────────────────────────────────────────────────────────────── */

.lp-content-panel {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 1.5rem;
    animation: fadeSlideUp 0.4s ease both;
    opacity: 0;
}

/* Content panel top bar */
.lp-cp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: #1e293b;
    flex-wrap: wrap;
}

body.dark-mode .lp-cp-bar { background: #0f172a; }

.lp-cp-breadcrumb {
    font-size: 0.82rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.lp-cp-breadcrumb strong {
    color: #f1f5f9;
    font-weight: 600;
}

.lp-cp-sep {
    color: #475569;
    font-size: 0.75rem;
}

.lp-cp-actions {
    display: flex;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* Next Topic button */
.lp-btn-next {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.lp-btn-next:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.35);
}

.lp-btn-next:disabled {
    cursor: not-allowed;
}

/* Mark Complete button */
.lp-btn-complete {
    padding: 0.45rem 1rem;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.lp-btn-complete:hover:not(:disabled):not(.lp-btn-complete--done) {
    background: #059669;
    transform: translateY(-1px);
}

.lp-btn-complete--done {
    background: #475569;
    cursor: default;
}

.lp-btn-complete:active:not(.lp-btn-complete--done) {
    transform: scale(0.96);
}

/* Content body */
.lp-cp-body {
    padding: 2rem 2.25rem 2.5rem;
}

/* Loading state */
.lp-cp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* LLM content area */
.lp-cp-content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text);
}

.lp-cp-content h1,
.lp-cp-content h2,
.lp-cp-content h3 {
    margin: 1.25rem 0 0.5rem;
    font-weight: 700;
    color: var(--text);
}

.lp-cp-content h2 { font-size: 1.2rem; }
.lp-cp-content h3 { font-size: 1.05rem; color: var(--primary); }

.lp-cp-content p { margin: 0.6rem 0; }

.lp-cp-content strong { color: var(--text); }

.lp-cp-content ul,
.lp-cp-content ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.lp-cp-content li { margin: 0.3rem 0; }

/* Example callout box */
.lp-example-box {
    border-left: 4px solid var(--primary);
    background: rgba(37, 99, 235, 0.05);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

body.dark-mode .lp-example-box {
    background: rgba(37, 99, 235, 0.1);
}

.lp-ex-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.lp-example-box p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text);
}

/* Error box */
.lp-error-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-error-box span { font-size: 2rem; }


/* ─────────────────────────────────────────────────────────────────
   MODULE COMPLETE BANNER
   ───────────────────────────────────────────────────────────────── */

.lp-complete-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(37,99,235,0.08));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    margin-top: 1rem;
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
}

.lp-complete-icon {
    font-size: 2rem;
    flex-shrink: 0;
    animation: pulse 1.5s ease 2;
}

.lp-complete-banner strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.lp-complete-banner p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}


/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .lp-th--contents,
    .lp-td-contents { display: none; }

    .lp-th--progress { width: 120px; }

    .lp-mhc-stats { gap: 1rem; }
    .lp-mhc-stat-val { font-size: 1.2rem; }
}

@media (max-width: 640px) {
    .lp-book-header,
    .lp-mod-header-card { flex-direction: column; align-items: flex-start; }

    .lp-mhc-stats {
        align-self: stretch;
        justify-content: space-around;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
    }

    .lp-bh-overall { display: none; }

    .lp-th--progress,
    .lp-td-progress { display: none; }

    .lp-cp-bar { flex-direction: column; align-items: flex-start; }
    .lp-cp-actions { width: 100%; justify-content: flex-end; }

    .lp-cp-body { padding: 1.25rem 1rem; }

    .lp-complete-banner { flex-wrap: wrap; }
    .lp-complete-banner .btn-start-module { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════════
   📘 APPEND THIS TO THE BOTTOM OF style.css
   These are the ONLY additions needed for book1_details / book2_details.
   If you already added lms_learning.css from the last session,
   only add the NEW blocks marked with ← NEW below.
   ══════════════════════════════════════════════════════════════════ */

/* ── Shared table card ──────────────────────────────────────────── */
.lp-table-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}

/* ── Book header ────────────────────────────────────────────────── */
.lp-book-header {
    display: flex; align-items: flex-start; gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both; opacity: 0;
}
.lp-bh-icon-wrap {
    width: 72px; height: 72px; flex-shrink: 0;
    background: rgba(37,99,235,0.07); border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.lp-bh-info { flex: 1; }
.lp-bh-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .35rem; line-height: 1.2; }
.lp-bh-desc  { font-size: 0.9rem; color: var(--text-light); margin-bottom: .75rem; line-height: 1.5; }
.lp-bh-tags  { display: flex; flex-wrap: wrap; gap: .5rem; }
.lp-tag { font-size: .75rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px;
    background: rgba(37,99,235,0.08); color: var(--primary); border: 1px solid rgba(37,99,235,0.15); }
.lp-tag--subject  { background: rgba(16,185,129,0.1);  color: #065f46; border-color: rgba(16,185,129,0.2); }
.lp-tag--progress { background: rgba(16,185,129,0.12); color: #065f46; border-color: rgba(16,185,129,0.25); }
body.dark-mode .lp-tag           { background: rgba(37,99,235,0.2);  color: #93c5fd; border-color: rgba(37,99,235,0.3); }
body.dark-mode .lp-tag--subject  { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
body.dark-mode .lp-tag--progress { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.lp-bh-overall { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
.lp-bh-circle  { position: relative; width: 60px; height: 60px; }
.lp-circle-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lp-circle-bg, .lp-circle-fill { fill: none; stroke-width: 3; stroke-linecap: round; }
.lp-circle-bg   { stroke: var(--border); }
.lp-circle-fill { stroke: var(--primary); transition: stroke-dasharray .6s ease; }
.lp-circle-pct  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--primary); }
.lp-bh-overall-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
    font-weight: 600; color: var(--text-light); }

/* ── Module overview table ──────────────────────────────────────── */
.lp-module-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lp-th { background: #1e293b; color: #f1f5f9; font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; padding: .85rem 1.25rem; text-align: left; white-space: nowrap; }
body.dark-mode .lp-th { background: #0f172a; color: #94a3b8; }
.lp-th--num      { width: 60px;  }
.lp-th--name     { width: auto;  }
.lp-th--contents { width: 180px; }
.lp-th--progress { width: 160px; }
.lp-th--action   { width: 190px; }
.lp-module-row { border-bottom: 1px solid var(--border); animation: fadeSlideUp .5s ease both; opacity: 0;
    transition: background .2s ease; }
.lp-module-row:last-child { border-bottom: none; }
.lp-module-row:hover      { background: rgba(37,99,235,0.03); }
.lp-td-num, .lp-td-name, .lp-td-contents, .lp-td-progress, .lp-td-action { padding: 1rem 1.25rem; vertical-align: middle; }
.lp-mod-num { width: 34px; height: 34px; background: rgba(37,99,235,0.1); color: var(--primary);
    border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }
.lp-mod-title { font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.lp-mod-tags  { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.lp-mtag { font-size: .7rem; font-weight: 500; padding: .15rem .6rem; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border); color: var(--text-light); }
body.dark-mode .lp-mtag { background: rgba(255,255,255,0.06); }
.lp-contents-text { font-size: .85rem; color: var(--text-light); white-space: nowrap; }
.lp-prog-wrap { display: flex; align-items: center; gap: .6rem; }
.lp-prog-bar  { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.lp-prog-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px; transition: width .6s ease; }
.lp-prog-pct { font-size: .78rem; font-weight: 700; color: var(--text-light); white-space: nowrap; min-width: 2.5rem; }
.btn-start-module {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .5rem 1.1rem; background: var(--primary); color: white; border-radius: 8px;
    font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background .2s, transform .2s, box-shadow .2s; border: none; cursor: pointer;
}
.btn-start-module:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-start-module:active { transform: scale(.97); }
.btn-start-module--done { background: var(--success); }
.btn-start-module--done:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

/* ── Module header card (details page) ─────────────────────────── */
.lp-mod-header-card {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.5rem 1.75rem; background: var(--card-bg);
    border-radius: 16px; box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary); margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both; opacity: 0;
}
.lp-mhc-num {
    width: 52px; height: 52px; flex-shrink: 0;
    background: var(--primary); color: white; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
}
.lp-mhc-info  { flex: 1; }
.lp-mhc-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: .2rem; }
.lp-mhc-book  { font-size: .82rem; color: var(--text-light); }
.lp-mhc-stats { display: flex; gap: 1.5rem; flex-shrink: 0; }
.lp-mhc-stat  { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.lp-mhc-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.lp-stat-done    { color: var(--success); }
.lp-mhc-stat-lbl { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); }

/* ── Subtopic table ─────────────────────────────────────────────── */
.lp-subtopic-table-card { animation-delay: .12s; }
.lp-subtopic-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lp-th--slno    { width: 72px; }
.lp-th--subname { width: auto; }
.lp-th--time    { width: 110px; }
.lp-th--done    { width: 70px; text-align: center; }
.lp-topic-header-row { background: #f1f5f9; border-bottom: 1px solid var(--border); }
body.dark-mode .lp-topic-header-row { background: rgba(255,255,255,0.04); }
.lp-td-dash { padding: .65rem 1.25rem; color: var(--text-light); font-weight: 700; text-align: center; font-size: 1rem; }
.lp-td-topic-title { padding: .65rem .75rem; font-size: .875rem; }
.lp-topic-pin { font-size: 1rem; margin-right: .3rem; }
.lp-sub-row { border-bottom: 1px solid var(--border); transition: background .18s ease; }
.lp-sub-row:last-child { border-bottom: none; }
.lp-td-slno   { padding: .8rem 1.25rem; text-align: center; font-size: .85rem; color: var(--text-light); font-weight: 600; }
.lp-td-subname { padding: .8rem .75rem; font-size: .9rem; }
.lp-td-time    { padding: .8rem .75rem; white-space: nowrap; }
.lp-time-badge { font-size: .8rem; color: var(--text-light); }
.lp-td-done    { padding: .8rem; text-align: center; }
/* Row states */
.lp-sub-row--unlocked { background: var(--card-bg); }
.lp-sub-row--unlocked:hover { background: rgba(37,99,235,0.04); }
.lp-sub-row--locked   { background: var(--card-bg); opacity: .55; }
.lp-sub-row--done     { background: rgba(16,185,129,0.04); }
.lp-sub-row--done .lp-td-slno,
.lp-sub-row--done .lp-td-subname { text-decoration: line-through; text-decoration-color: rgba(16,185,129,0.4); color: var(--text-light); }
.lp-sub-row--active   { background: rgba(37,99,235,0.07) !important; border-left: 3px solid var(--primary); }
/* Animations */
@keyframes unlockFlash { 0% { background: rgba(16,185,129,0.2); } 100% { background: transparent; } }
.lp-row-flash { animation: unlockFlash 1.1s ease forwards; }
@keyframes shakeRow { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lp-row-shake { animation: shakeRow .45s ease; }
/* Subtopic button & lock */
.lp-sub-link {
    background: none; border: none; padding: 0; font-family: inherit;
    font-size: .9rem; font-weight: 500; color: var(--primary); cursor: pointer;
    text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
    transition: color .2s; text-align: left;
}
.lp-sub-link:hover { color: var(--primary-dark); text-decoration-style: solid; }
.lp-sub-locked { display: flex; align-items: center; gap: .4rem; color: var(--text-light); font-size: .9rem; }
.lp-lock-icon  { font-size: .85rem; opacity: .7; }
.lp-done-checkbox { width: 17px; height: 17px; accent-color: var(--success); cursor: pointer; }
.lp-done-checkbox:disabled { cursor: not-allowed; opacity: .4; }

/* ── LLM content panel ──────────────────────────────────────────── */
.lp-content-panel {
    background: var(--card-bg); border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08); overflow: hidden;
    margin-top: 1.5rem; animation: fadeSlideUp .4s ease both; opacity: 0;
}
.lp-cp-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 1.5rem; background: #1e293b; flex-wrap: wrap;
}
body.dark-mode .lp-cp-bar { background: #0f172a; }
.lp-cp-breadcrumb { font-size: .82rem; color: #94a3b8; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.lp-cp-breadcrumb strong { color: #f1f5f9; font-weight: 600; }
.lp-cp-sep    { color: #475569; }
.lp-cp-actions { display: flex; gap: .65rem; flex-shrink: 0; }
/* Buttons in panel */
.lp-btn-next {
    padding: .45rem 1rem; background: transparent;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
    color: #cbd5e1; font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s; font-family: inherit;
}
.lp-btn-next:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.35); }
.lp-btn-next:disabled { cursor: not-allowed; opacity: .4; }
.lp-btn-complete {
    padding: .45rem 1rem; background: var(--success); border: none; border-radius: 8px;
    color: white; font-size: .82rem; font-weight: 700; cursor: pointer;
    transition: background .2s, transform .15s; font-family: inherit; white-space: nowrap;
}
.lp-btn-complete:hover:not(:disabled):not(.lp-btn-complete--done) { background: #059669; transform: translateY(-1px); }
.lp-btn-complete--done { background: #475569; cursor: default; }
.lp-btn-complete:active:not(.lp-btn-complete--done) { transform: scale(.96); }
/* Content body */
.lp-cp-body { padding: 2rem 2.25rem 2.5rem; }
.lp-cp-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem;
    padding: 3rem; color: var(--text-light); font-size: .9rem; }
.lp-spinner { width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.lp-cp-content { font-size: 1rem; line-height: 1.85; color: var(--text); }
.lp-cp-content h2 { font-size: 1.2rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.lp-cp-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin: 1rem 0 .4rem; }
.lp-cp-content p  { margin: .6rem 0; }
.lp-cp-content ul, .lp-cp-content ol { padding-left: 1.5rem; margin: .5rem 0; }
.lp-cp-content li { margin: .3rem 0; }
/* Example callout */
.lp-example-box {
    border-left: 4px solid var(--primary); background: rgba(37,99,235,0.05);
    border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; margin: 1.25rem 0;
}
body.dark-mode .lp-example-box { background: rgba(37,99,235,0.1); }
.lp-ex-label { display: block; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: .35rem; }
.lp-example-box p { margin: 0; font-size: .92rem; line-height: 1.6; }
/* Error */
.lp-error-box { display: flex; flex-direction: column; align-items: center;
    gap: .5rem; padding: 2.5rem; text-align: center; color: var(--text-light); font-size: .9rem; }
.lp-error-box span { font-size: 2rem; }

/* ── Module complete banner ─────────────────────────────────────── */
.lp-complete-banner {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(37,99,235,0.06));
    border: 1px solid rgba(16,185,129,0.3); border-radius: 14px;
    margin-top: 1rem; animation: fadeSlideUp .5s ease both; opacity: 0;
}
.lp-complete-icon { font-size: 2rem; flex-shrink: 0; animation: pulse 1.5s ease 2; }
.lp-complete-banner strong { display: block; font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.lp-complete-banner p { font-size: .85rem; color: var(--text-light); margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .lp-th--contents, .lp-td-contents { display: none; }
    .lp-th--progress { width: 120px; }
    .lp-mhc-stats { gap: 1rem; }
}
@media (max-width: 640px) {
    .lp-book-header, .lp-mod-header-card { flex-direction: column; align-items: flex-start; }
    .lp-mhc-stats { align-self: stretch; justify-content: space-around;
        padding-top: .75rem; border-top: 1px solid var(--border); }
    .lp-bh-overall { display: none; }
    .lp-th--progress, .lp-td-progress { display: none; }
    .lp-cp-bar { flex-direction: column; align-items: flex-start; }
    .lp-cp-actions { width: 100%; justify-content: flex-end; }
    .lp-cp-body { padding: 1.25rem 1rem; }
    .lp-complete-banner { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════
   📚  LEARNING CARD STYLES
   APPEND to the bottom of static/css/style.css

   These styles target the HTML output of learning_content.py's
   _md_to_html() method, rendered inside #cpContent in
   book1_details.html and book2_details.html.
   ══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────
   LEARNING CARD WRAPPER
   ───────────────────────────────────────────────────────────────── */

.lp-learning-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION BLOCKS
   Each ## heading becomes a .lp-lc-section div
   ───────────────────────────────────────────────────────────────── */

.lp-lc-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.lp-lc-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* First section — no top padding needed (parent already has padding) */
.lp-lc-section:first-child {
    padding-top: 0;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION HEADINGS
   ───────────────────────────────────────────────────────────────── */

.lp-lc-head {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Introduction — blue */
.lp-lc-head--intro {
    color: var(--primary);
}

/* Key Facts — amber */
.lp-lc-head--facts {
    color: #b45309;
}

body.dark-mode .lp-lc-head--facts {
    color: #fbbf24;
}

/* Example — teal */
.lp-lc-head--example {
    color: #0d7490;
}

body.dark-mode .lp-lc-head--example {
    color: #22d3ee;
}

/* Summary — green */
.lp-lc-head--summary {
    color: #047857;
}

body.dark-mode .lp-lc-head--summary {
    color: #34d399;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION-SPECIFIC BACKGROUNDS
   ───────────────────────────────────────────────────────────────── */

/* Example section — subtle blue tint */
.lp-lc-section--example {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    margin: 0.5rem 0;
}

body.dark-mode .lp-lc-section--example {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Summary section — green tint pill */
.lp-lc-section--summary {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    margin-top: 0.5rem;
}

body.dark-mode .lp-lc-section--summary {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}


/* ─────────────────────────────────────────────────────────────────
   PROSE (paragraphs inside sections)
   ───────────────────────────────────────────────────────────────── */

.lp-lc-section p {
    font-size: 0.96rem;
    line-height: 1.85;
    color: var(--text);
    margin: 0.4rem 0;
}

.lp-lc-section--summary p {
    font-size: 0.95rem;
    font-weight: 600;
    color: #065f46;
    line-height: 1.6;
}

body.dark-mode .lp-lc-section--summary p {
    color: #6ee7b7;
}


/* ─────────────────────────────────────────────────────────────────
   KEY FACTS LIST
   ───────────────────────────────────────────────────────────────── */

.lp-facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lp-facts-list li {
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--text);
    padding-left: 1.25rem;
    position: relative;
}

.lp-facts-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Bold term in "**Term**: explanation" pattern */
.lp-facts-list li strong {
    color: var(--text);
    font-weight: 700;
}


/* ─────────────────────────────────────────────────────────────────
   INLINE CODE
   ───────────────────────────────────────────────────────────────── */

.lp-inline-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.83rem;
    background: rgba(37, 99, 235, 0.07);
    color: var(--primary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

body.dark-mode .lp-inline-code {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.25);
}


/* ─────────────────────────────────────────────────────────────────
   ERROR BOX  (shown when API call fails)
   ───────────────────────────────────────────────────────────────── */

.lp-error-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    margin: 0.5rem 0;
}

.lp-error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.lp-error-box strong {
    display: block;
    font-size: 0.95rem;
    color: #b91c1c;
    margin-bottom: 0.25rem;
}

.lp-error-box p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.lp-btn-retry {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
    align-self: center;
}

.lp-btn-retry:hover {
    background: var(--bg);
    color: var(--text);
}

/* ============================= */
/* 👤 PROFILE MODAL */
/* ============================= */

.profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.profile-modal-content {
    background: var(--card-bg);
    padding: 2rem 2.2rem;
    border-radius: 18px;
    width: min(460px, 90vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: fadeSlideUp 0.3s ease;

    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.profile-modal h3 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.profile-modal-content p {
    margin: 0;
    font-size: 0.95rem;
}

.profile-modal-content button {
    margin-top: 1.2rem;
}

/* =======================================
   ⏳ IDLE POPUP STYLES
   ======================================= */

.idle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.idle-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 360px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.3s ease;
}

.idle-box h3 {
    margin-bottom: 0.75rem;
}

.idle-box p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════════
   🎧  PROFESSOR AUDIO SECTION
   APPEND this entire block to the bottom of static/css/style.css
   ══════════════════════════════════════════════════════════════════ */


/* ── Outer container ────────────────────────────────────────────── */
.lp-audio-section {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeSlideUp 0.4s ease both;
}

body.dark-mode .lp-audio-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}


/* ── Header row: title + language buttons ───────────────────────── */
.lp-audio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lp-audio-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.lp-audio-icon {
    font-size: 1.1rem;
    line-height: 1;
}


/* ── Language button group ──────────────────────────────────────── */
.lp-audio-lang-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lp-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
    -webkit-user-select: none; /* Safari 3+, iOS 3+ */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;
    white-space: nowrap;
}

.lp-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.lp-lang-btn:active {
    transform: scale(0.96);
}

/* Active / selected state */
.lp-lang-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.lp-lang-btn--active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}

.lp-lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lp-lang-name {
    letter-spacing: 0.01em;
}

body.dark-mode .lp-lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

body.dark-mode .lp-lang-btn:hover {
    border-color: #93c5fd;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
}

body.dark-mode .lp-lang-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}


/* ── Audio loading state ────────────────────────────────────────── */
.lp-audio-loading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
}

.lp-audio-spinner {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2.5px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.lp-audio-loading-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.lp-audio-loading-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.lp-audio-loading-sub {
    font-size: 0.75rem;
    color: var(--text-light);
}


/* ── Audio player wrapper ───────────────────────────────────────── */
.lp-audio-player-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

body.dark-mode .lp-audio-player-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.lp-audio-player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lp-audio-now-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.lp-audio-now-lang {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

body.dark-mode .lp-audio-now-lang {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
}

/* Native <audio> element — styled minimally but cleanly */
.lp-audio-el {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    outline: none;
    accent-color: var(--primary);
}

/* Chrome/Edge custom audio styling */
.lp-audio-el::-webkit-media-controls-panel {
    background-color: transparent;
}


/* ── Error state ────────────────────────────────────────────────── */
.lp-audio-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #b91c1c;
}

body.dark-mode .lp-audio-error {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

#audioErrorMsg {
    flex: 1;
    color: inherit;
}

.lp-audio-retry {
    flex-shrink: 0;
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b91c1c;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.lp-audio-retry:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}


/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .lp-audio-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lp-audio-lang-group {
        width: 100%;
    }

    .lp-lang-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════
   DOUBT PAGE — FULL-WIDTH PROFESSIONAL REDESIGN
   APPEND this entire block to the bottom of static/css/style.css
   ════════════════════════════════════════════════════════════════ */

/* ─── Slide-in animation ─────────────────────────────────────── */
@keyframes dsSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Outer wrapper ──────────────────────────────────────────── */
.ds-answer-wrap {
    display: flex;
    flex-direction: column;
    margin-top: 1.25rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    animation: dsSlideUp 0.35s ease both;
}

body.dark-mode .ds-answer-wrap {
    background: #1a2035;
    border-color: rgba(255,255,255,0.07);
}

/* ─── Dark topbar ────────────────────────────────────────────── */
.ds-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    background: #1e293b;
    gap: 1rem;
    min-height: 46px;
}

.ds-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    flex: 1;
}

.ds-page-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #94a3b8;
    background: rgba(255,255,255,0.07);
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    white-space: nowrap;
}

.ds-topbar-dot {
    color: #475569;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ds-topbar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-topbar-nav {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.ds-nav-btn {
    padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 7px;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ds-nav-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
}

.ds-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ─── Page flip animation ────────────────────────────────────── */
.ds-content-card.flipping {
    animation: dsFlip 0.3s ease;
}

@keyframes dsFlip {
    0%   { opacity: 1; transform: translateX(0); }
    45%  { opacity: 0; transform: translateX(18px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ─── Content card ───────────────────────────────────────────── */
.ds-content-card {
    padding: 2rem 2.5rem 1.75rem;
    background: var(--card-bg);
    min-height: 300px;
}

body.dark-mode .ds-content-card {
    background: #1a2035;
}

.ds-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid rgba(37,99,235,0.1);
    line-height: 1.4;
}

.ds-card-body {
    font-size: 0.93rem;
    line-height: 1.9;
    color: var(--text);
}

/* ─── Audio strip ────────────────────────────────────────────── */
.ds-audio-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.5rem;
    background: #f1f5f9;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    min-height: 52px;
}

body.dark-mode .ds-audio-strip {
    background: #141929;
    border-top-color: rgba(255,255,255,0.06);
}

.ds-audio-strip-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.ds-strip-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

body.dark-mode .ds-strip-divider {
    background: rgba(255,255,255,0.08);
}

/* ─── Language buttons ───────────────────────────────────────── */
.ds-lang-group {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ds-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.75rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.16s ease;
    white-space: nowrap;
    -webkit-user-select: none; /* Safari 3+, iOS */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE 10+ */
    user-select: none;
}

.ds-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37,99,235,0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}

.ds-lang-btn:active { transform: scale(0.96); }

.ds-lang-btn--active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.28);
}

.ds-lang-flag { font-size: 0.88rem; line-height: 1; }

body.dark-mode .ds-lang-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.09);
    color: #94a3b8;
}

body.dark-mode .ds-lang-btn:hover {
    border-color: #93c5fd;
    color: #93c5fd;
    background: rgba(37,99,235,0.1);
}

/* ─── Audio states ───────────────────────────────────────────── */
.ds-audio-states {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.ds-audio-idle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* Loading */
.ds-audio-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.ds-audio-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(37,99,235,0.18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dsSpin 0.75s linear infinite;
    flex-shrink: 0;
}

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

/* Player row */
.ds-audio-player-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
}

.ds-now-pill {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary);
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.15);
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

body.dark-mode .ds-now-pill {
    background: rgba(37,99,235,0.15);
    color: #93c5fd;
}

.ds-audio-el {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 8px;
    accent-color: var(--primary);
}

/* Error */
.ds-audio-err {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.77rem;
    color: #b91c1c;
    min-width: 0;
}

body.dark-mode .ds-audio-err { color: #fca5a5; }

#dsAudioErrMsg {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-audio-retry-btn {
    flex-shrink: 0;
    padding: 0.22rem 0.55rem;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b91c1c;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.ds-audio-retry-btn:hover { background: rgba(239,68,68,0.07); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 680px) {
    .ds-content-card { padding: 1.25rem 1rem; }

    .ds-audio-strip {
        gap: 0.6rem;
        padding: 0.7rem 1rem;
    }

    .ds-strip-divider { display: none; }

    .ds-lang-group { width: 100%; }

    .ds-lang-btn {
        flex: 1;
        justify-content: center;
    }

    .ds-audio-states { width: 100%; }

    .ds-audio-el { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   SUMMARY ROW CSS — APPEND to static/css/style.css
   ══════════════════════════════════════════════════════════════ */

/* ── Summary row in subtopic table ─────────────────────────── */
.lp-summary-row {
    border-top: 2px solid rgba(37,99,235,.1);
    position: relative;
}

.lp-summary-row--locked {
    opacity: .6;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,.02) 8px,
        rgba(0,0,0,.02) 16px
    );
}

body.dark-mode .lp-summary-row--locked {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,.02) 8px,
        rgba(255,255,255,.02) 16px
    );
}

.lp-summary-row--unlocked {
    background: linear-gradient(90deg, rgba(37,99,235,.04), rgba(5,150,105,.03));
    animation: lpSummaryPulse 2s ease-in-out;
}

@keyframes lpSummaryPulse {
    0%   { background:rgba(37,99,235,.1); }
    100% { background:linear-gradient(90deg,rgba(37,99,235,.04),rgba(5,150,105,.03)); }
}

.lp-summary-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .17s ease;
    box-shadow: 0 2px 8px rgba(37,99,235,.2);
}

.lp-summary-link:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.28);
}

.lp-summary-badge {
    background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(5,150,105,.08)) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

.lp-summary-check {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

body.lms-page {
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.06),
            transparent 40%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(99, 102, 241, 0.05),
            transparent 50%
        ),
        var(--bg);
}

/* AUTH PAGES */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    max-width: 1000px;
    width: 90%;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.auth-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    flex: 1;
}

.logo h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.logo p {
    color: var(--text-light);
}

.auth-form h2 {
    margin: 2rem 0 0.5rem;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: var(--secondary);
    cursor: not-allowed;
}

.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-info {
    flex: 1;
    color: white;
    padding: 2rem;
}

.auth-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.features {
    list-style: none;
    margin-top: 2rem;
}

.features li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* LMS PAGE */
.lms-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    background: var(--card-bg);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left h1 {
    font-size: 1.5rem;
    color: var(--primary);
}


.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-logout {
    background: var(--error);
    color: white;
}

.main-container {
    display: flex;
    flex: 1;
    
}




.books-list, .history-list {
    max-height: 300px;
    overflow-y: auto;
}

.book-item, .history-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.book-item:hover, .history-item:hover {
    background: #e0e7ff;
}

.btn-block {
    width: 100%;
}

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

.loading {
    color: var(--text-light);
    font-style: italic;
}


.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.search-container {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 2rem auto;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

.loading-container {
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.answer-container {
    width: 100%;
    max-width: 100%;
    margin: 2.5rem 0;
    padding: 0 1rem;
}


.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* AVATAR (LEFT - CONSTANT) */
.avatar-section {
    flex-shrink: 0;
    text-align: center;
}

.professor-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    background: white;
}

.avatar-label {
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--primary);
}

/* PAGE (CENTER - CHANGES) */
.page-section {
    flex: 1;
}

.page-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.75rem 3rem;
    min-height: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

/* PAGE FLIP ANIMATION */
.page-card.flipping {
    animation: pageFlip 0.6s ease-in-out;
}

@keyframes pageFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); opacity: 0.5; }
    100% { transform: rotateY(0deg); }
}

.page-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.page-number {
    font-weight: 500;
    color: var(--primary);
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.page-body {
    font-size: 1.05rem;
    line-height: 1.9;
  
}

.page-body h1,
.page-body h2,
.page-body h3 {
    margin: 0.6rem 0 0.4rem;
}

.page-body p {
    margin: 0.4rem 0;
}

.page-body ul,
.page-body ol {
    margin: 0.4rem 0;
    padding-left: 1.2rem;
}

.page-body li {
    margin: 0.25rem 0;
}

.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

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

.btn-nav:disabled {
    background: var(--secondary);
    cursor: not-allowed;
    opacity: 0.5;
}



.audio-label {
    font-weight: 500;
    margin-bottom: 1rem;
}

#audioPlayer {
    width: 100%;
    margin-bottom: 1rem;
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-audio {
    background: var(--primary);
    color: white;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.references-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.references-section h4 {
    margin-bottom: 1rem;
}

#referencesList {
    list-style: none;
}

#referencesList li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    padding-left: 1.5rem;
    position: relative;
}

#referencesList li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    .auth-info {
        display: none;
    }
    .main-container {
        flex-direction: column;
    }
   
    .page-display-wrapper {
        flex-direction: column;
    }
}



/* ============================= */
/* 🌙 DARK MODE THEME */
/* ============================= */

body.dark-mode {
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.6);
}

/* Smooth transition */
body {
    transition: background 0.3s ease, color 0.3s ease;
}

.page-card,

.audio-player,
.references-section,
.top-nav {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    margin-right: 1rem;
    transition: transform 0.2s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}


.theme-toggle:hover {
    background: none;
    color:var(--primary);
}

body.dark-mode .theme-toggle {
    color: #facc15;  /* soft yellow sun */
}

body:not(.dark-mode) .theme-toggle {
    color: #334155;  /* dark moon color */
}

/* ================================= */
/* 🚀 DASHBOARD CARDS DESIGN */
/* ================================= */

.dashboard-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.dashboard-hero p {
    color: var(--text-light);
}

/* Grid */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Card */
.feature-card {
    position: relative;
    padding: 2.75rem 2.25rem 2.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s ease;
    overflow: hidden;
}

/* Glass morphism dark mode */
body.dark-mode .feature-card {
    background: rgba(30, 41, 59, 0.6);
}

/* Animated Gradient Border */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(
        130deg,
        #2563eb,
        #10b981,
        #6366f1,
        #2563eb
    );
    background-size: 300% 300%;
    animation: gradientMove 6s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Hover */
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Icon */
.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

/* Micro animation */
.feature-card:hover .card-icon {
    transform: scale(1.15) rotate(8deg);
}

/* Entrance animation */
.feature-card {
    animation: fadeSlideUp 0.8s ease forwards;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.3s; }
.feature-card:nth-child(3) { animation-delay: 0.5s; }

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


/* =====================================================
   ADD THIS ENTIRE BLOCK AT THE BOTTOM OF style.css
   ===================================================== */

/* ─── HERO SECTION ─────────────────────────────────── */

.dashboard-hero {
    text-align: center;
    padding: 3rem 2rem 2.5rem;
    position: relative;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    animation: fadeSlideUp 0.5s ease forwards;
}

.dashboard-hero h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    animation: fadeSlideUp 0.6s ease 0.1s both;
}

.dashboard-hero p {
    color: var(--text-light);
    font-size: 1.05rem;
    animation: fadeSlideUp 0.6s ease 0.2s both;
}


/* ─── DASHBOARD CARDS GRID ──────────────────────────── */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    padding: 0 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
}


/* ─── FEATURE CARD ──────────────────────────────────── */

.feature-card {
    position: relative;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    background: var(--card-bg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.35s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;

    /* Entrance animations */
    animation: fadeSlideUp 0.65s ease both;
    opacity: 0;
}

.feature-card:nth-child(1) { animation-delay: 0.10s; }
.feature-card:nth-child(2) { animation-delay: 0.25s; }
.feature-card:nth-child(3) { animation-delay: 0.40s; }

/* Animated gradient border via ::before */
.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(130deg, #2563eb, #10b981, #6366f1, #2563eb);
    background-size: 300% 300%;
    animation: gradientMove 12s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Soft glow blob behind card */
.card-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    top: -30px;
    right: -30px;
    z-index: 0;
}

.card--doubts  .card-glow { background: #2563eb; }
.card--learning .card-glow { background: #10b981; }
.card--mocktest .card-glow { background: #6366f1; }
.card--cfa-exam .card-glow { background: #0B3D6B; }

.feature-card:hover .card-glow {
    opacity: 0.18;
}

/* Hover lift */
.feature-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0,0,0,0.13);
}

.feature-card:active {
    transform: scale(0.98);
}


/* Glassmorphism dark mode */
body.dark-mode .feature-card {
    background: rgba(30, 41, 59, 0.75);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}


/* ─── CARD INNER ELEMENTS ───────────────────────────── */

.card-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.feature-card:hover .card-icon {
    transform: scale(1.2) rotate(8deg);
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    width: fit-content;
    margin-bottom: 0.25rem;
}

.card--doubts  .card-tag { background: #dbeafe; color: #1d4ed8; }
.card--learning .card-tag { background: #d1fae5; color: #065f46; }
.card--mocktest .card-tag { background: #ede9fe; color: #5b21b6; }
.card--cfa-exam .card-tag { background: #E8F0F8; color: #0B3D6B; }

body.dark-mode .card--doubts  .card-tag { background: rgba(37,99,235,0.25); color: #93c5fd; }
body.dark-mode .card--learning .card-tag { background: rgba(16,185,129,0.25); color: #6ee7b7; }
body.dark-mode .card--mocktest .card-tag { background: rgba(99,102,241,0.25); color: #c4b5fd; }
body.dark-mode .card--cfa-exam .card-tag { background: rgba(91,155,216,0.22); color: #9CC4E8; }

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0.25rem 0 0.75rem;
}

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.card-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.card-arrow {
    font-size: 1.1rem;
    color: var(--primary);
    transition: transform 0.3s ease;
    display: inline-block;
}

.feature-card:hover .card-arrow {
    transform: translateX(5px);
}


/* ─── GRADIENT ANIMATION (already in file, kept for safety) ── */

@keyframes gradientMove {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

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


/* ─── FOOTER ────────────────────────────────────────── */

.lms-footer {
    margin-top: 1.25rem;
    text-align: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.02);
}


/* ─── BREADCRUMB ─────────────────────────────────────── */

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.4s ease both;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    transition: background 0.2s ease, transform 0.2s ease;
}

.breadcrumb-link:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(-2px);
}

.breadcrumb-arrow {
    font-size: 1rem;
}

.breadcrumb-sep {
    color: var(--border);
}

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


/* ─── INNER PAGE HERO ────────────────────────────────── */

.inner-page-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.5s ease 0.1s both;
    opacity: 0;
    border-left: 4px solid var(--primary);
}

.inner-hero-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.inner-hero-text h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.inner-hero-text p {
    color: var(--text-light);
    font-size: 0.95rem;
}


/* ─── COMING SOON CARD ───────────────────────────────── */

.coming-soon-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    animation: fadeSlideUp 0.6s ease 0.2s both;
    opacity: 0;
}


@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

.coming-soon-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.coming-soon-card p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.coming-soon-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: left;
}

.csf-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.csf-item:hover {
    background: #e0e7ff;
}

body.dark-mode .csf-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.csf-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.btn-back-doubt {
    display: inline-block;
    width: auto;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    text-decoration: none;
}
.btn-back-doubt:hover {
    text-decoration: none;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 900px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        padding: 0;
    }
}
@media (max-width: 540px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
        padding: 0;
    }
    .dashboard-hero h2 {
        font-size: 1.6rem;
    }
    .inner-page-hero {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== NO SIDEBAR LAYOUT ===== */

.main-container.no-sidebar {
    display: block;
}


/* ============================= */
/* 🕒 NAV DATETIME - BADGE STYLE */
/* ============================= */

.nav-datetime {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 24px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.datetime-date {
    color: var(--text-light);
    font-weight: 500;
}

.time-separator {
    opacity: 0.4;
}

/* 🔥 TIME BADGE */
.datetime-time {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    letter-spacing: 0.6px;
    color: var(--primary);
}

/* Dark mode version */
body.dark-mode .datetime-time {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #93c5fd;
}

/* ================================================================
   📚 LEARNING PATH — BOOK CARDS & TABLE OF CONTENTS
   Add this ENTIRE BLOCK to the very bottom of your style.css
   ================================================================ */


/* ─── LEARNING BOOKS GRID ───────────────────────────────────────── */

.learning-books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    justify-content: left;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.25rem;
}


/* ─── BOOK CARD ─────────────────────────────────────────────────── */

.book-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    background: var(--card-bg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;

    /* Staggered entrance */
    animation: fadeSlideUp 0.65s ease both;
    opacity: 0;
}

.book-card:nth-child(1) { animation-delay: 0.10s; }
.book-card:nth-child(2) { animation-delay: 0.25s; }
.book-card:nth-child(3)  { animation-delay: 0.55s; }
.book-card:nth-child(4)  { animation-delay: 0.70s; }
.book-card:nth-child(5)  { animation-delay: 0.85s; }
.book-card:nth-child(6)  { animation-delay: 1.00s; }
.book-card:nth-child(7)  { animation-delay: 1.15s; }
.book-card:nth-child(8)  { animation-delay: 1.30s; }
.book-card:nth-child(9)  { animation-delay: 1.45s; }
.book-card:nth-child(10) { animation-delay: 1.60s; }

/* Animated gradient border */
.book-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 20px;
    background: linear-gradient(130deg, #2563eb, #10b981, #6366f1, #2563eb);
    background-size: 300% 300%;
    animation: gradientMove 12s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.35s ease;
}

.book-card--active::before {
    opacity: 1;
}

/* Active card — hover lift */
.book-card--active {
    cursor: pointer;
}
.book-card--active:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.13);
}
.book-card--active:hover::before {
    animation-duration: 3s;
}
.book-card--active:active {
    transform: scale(0.98);
}

/* Soon card — muted, no hover */
.book-card--soon {
    opacity: 0.68;
    cursor: not-allowed;
    filter: grayscale(25%);
}
.book-card--soon::before {
    opacity: 0.25;
    animation-play-state: paused;
}

/* Soft glow blob */
.book-card-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: #2563eb;
    filter: blur(70px);
    opacity: 0;
    top: -40px;
    right: -40px;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.4s ease;
}

.book-card--active:hover .book-card-glow {
    opacity: 0.12;
}

/* Dark mode */
body.dark-mode .book-card {
    background: rgba(30, 41, 59, 0.75);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}


/* ─── CARD TOP ROW ──────────────────────────────────────────────── */

.book-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.book-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-card--active:hover .book-icon-wrap {
    transform: scale(1.18) rotate(6deg);
}

.book-icon {
    font-size: 1.8rem;
    line-height: 1;
    display: block;
}

.book-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.book-badge--available {
    background: #d1fae5;
    color: #065f46;
}
.book-badge--soon {
    background: #f1f5f9;
    color: #64748b;
}

body.dark-mode .book-badge--available {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}
body.dark-mode .book-badge--soon {
    background: rgba(255, 255, 255, 0.07);
    color: #94a3b8;
}


/* ─── CARD BODY ─────────────────────────────────────────────────── */

.book-card-body {
    position: relative;
    z-index: 1;
    flex: 1;
}

.book-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.book-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.book-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}


/* ─── CARD FOOTER ───────────────────────────────────────────────── */

.book-card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.book-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.book-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.book-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.book-progress-label {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 500;
}

.book-cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-cta-row--disabled {
    opacity: 0.6;
}

.book-cta-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.book-cta-arrow {
    font-size: 1rem;
    color: var(--primary);
    display: inline-block;
    transition: transform 0.3s ease;
}

.book-card--active:hover .book-cta-arrow {
    transform: translateX(5px);
}


/* ─── TABLE OF CONTENTS PAGE ────────────────────────────────────── */

.toc-book-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem 2.25rem;
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    border-left: 5px solid var(--primary);
    animation: fadeSlideUp 0.5s ease 0.1s both;
    opacity: 0;
}

.toc-book-icon-wrap {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.toc-book-meta {
    flex: 1;
}

.toc-book-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    display: block;
    margin-bottom: 0.3rem;
}

.toc-book-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}

.toc-book-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.toc-book-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.toc-stat {
    font-size: 0.85rem;
    color: var(--text-light);
}

.toc-stat strong {
    color: var(--primary);
    font-weight: 700;
}

.toc-stat-sep {
    color: var(--border);
    font-size: 1rem;
}


/* ─── TOC SEARCH ────────────────────────────────────────────────── */

.toc-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 520px;
    margin-bottom: 1.75rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}

.toc-search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.toc-search-input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.toc-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.toc-search-clear {
    position: absolute;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    border: none;
    background: var(--border);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: background 0.2s;
}

.toc-search-clear:hover {
    background: var(--secondary);
    color: white;
}


/* ─── ACCORDION CHAPTER ─────────────────────────────────────────── */

.toc-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.toc-chapter {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border-left: 4px solid var(--chapter-color, var(--primary));
    transition: box-shadow 0.25s ease;
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
}

.toc-chapter:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
}

.toc-chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: background 0.2s ease;
}

.toc-chapter-header:hover {
    background: rgba(37, 99, 235, 0.04);
}

.toc-chapter-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.toc-chapter-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toc-chapter--open .toc-chapter-icon {
    transform: scale(1.15) rotate(8deg);
}

.toc-chapter-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.toc-chapter-num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toc-chapter-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--text);
}

.toc-chapter-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.toc-topic-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border-radius: 999px;
    white-space: nowrap;
}

.toc-chapter-chevron {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.3s ease;
    display: inline-block;
}

.toc-chapter--open .toc-chapter-chevron {
    transform: rotate(180deg);
}


/* ─── CHAPTER BODY (COLLAPSIBLE) ────────────────────────────────── */

.toc-chapter-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.toc-chapter--open .toc-chapter-body {
    max-height: 2000px;
    padding: 0 1.5rem 1.25rem;
}


/* ─── TOPIC ROW ─────────────────────────────────────────────────── */

.toc-topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border);
}

.toc-topic {
    border-radius: 10px;
    overflow: hidden;
    transition: background 0.2s ease;
}

.toc-topic-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    cursor: default;
    transition: background 0.2s ease;
}

.toc-topic-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.toc-topic-number {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 2.4rem;
    flex-shrink: 0;
}

.toc-topic-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.toc-subtopic-count {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: auto;
}


/* ─── SUBTOPIC LIST ─────────────────────────────────────────────── */

.toc-subtopic-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toc-subtopic-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 7px;
    transition: background 0.15s ease;
    cursor: default;
}

.toc-subtopic-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.toc-subtopic-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    opacity: 0.5;
}

.toc-subtopic-text {
    font-size: 0.84rem;
    color: var(--text-light);
    line-height: 1.4;
}


/* ─── NO RESULTS ────────────────────────────────────────────────── */

.toc-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.toc-no-results span {
    font-size: 2.5rem;
}


/* ─── BOOK COMING SOON (book2, book3) ───────────────────────────── */

.book-coming-soon {
    max-width: 560px;
    margin: 0 auto;
}

.bcs-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: pulse 2.5s ease-in-out infinite;
}

.bcs-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: #fef9c3;
    color: #92400e;
    margin-bottom: 1rem;
}

body.dark-mode .bcs-badge {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.book-coming-soon--2 .bcs-badge {
    background: #fce7f3;
    color: #9d174d;
}

.book-coming-soon--3 .bcs-badge {
    background: #d1fae5;
    color: #065f46;
}

body.dark-mode .book-coming-soon--2 .bcs-badge {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
}

body.dark-mode .book-coming-soon--3 .bcs-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}


/* ─── RESPONSIVE ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .learning-books-grid {
        grid-template-columns: 1fr;
    }

    .toc-book-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .toc-book-stats {
        justify-content: center;
    }

    .toc-chapter-header {
        padding: 0.9rem 1rem;
    }

    .toc-chapter-body {
        padding: 0 1rem;
    }

    .toc-chapter--open .toc-chapter-body {
        padding: 0 1rem 1rem;
    }

    .toc-subtopic-list {
        padding-left: 1.5rem;
    }
}

/* ══════════════════════════════════════════════════════════════════
   📚 LMS LEARNING PATH — COMPLETE CSS
   APPEND this entire block to the bottom of your style.css
   ══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────
   SHARED TABLE CARD WRAPPER
   ───────────────────────────────────────────────────────────────── */

.lp-table-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}


/* ─────────────────────────────────────────────────────────────────
   BOOK OVERVIEW PAGE — book1.html / book2.html
   ───────────────────────────────────────────────────────────────── */

/* ── Book header card ─────────────────────────────────────────── */

.lp-book-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both;
    opacity: 0;
}

.lp-bh-icon-wrap {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.07);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.lp-bh-info {
    flex: 1;
}

.lp-bh-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.lp-bh-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.lp-bh-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lp-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.lp-tag--subject {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.lp-tag--progress {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.25);
}

body.dark-mode .lp-tag           { background: rgba(37,99,235,0.2);  color: #93c5fd; border-color: rgba(37,99,235,0.3); }
body.dark-mode .lp-tag--subject  { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
body.dark-mode .lp-tag--progress { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }

/* Progress circle (book header right side) */
.lp-bh-overall {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.lp-bh-circle {
    position: relative;
    width: 60px;
    height: 60px;
}

.lp-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.lp-circle-bg,
.lp-circle-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.lp-circle-bg   { stroke: var(--border); }
.lp-circle-fill {
    stroke: var(--primary);
    transition: stroke-dasharray 0.6s ease;
}

.lp-circle-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.lp-bh-overall-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-light);
}


/* ── Module table ──────────────────────────────────────────────── */

.lp-module-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.lp-th {
    background: #1e293b;
    color: #f1f5f9;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.85rem 1.25rem;
    text-align: left;
    white-space: nowrap;
}

body.dark-mode .lp-th { background: #0f172a; color: #94a3b8; }

.lp-th--num      { width: 60px;  }
.lp-th--name     { width: auto;  }
.lp-th--contents { width: 180px; }
.lp-th--progress { width: 160px; }
.lp-th--action   { width: 130px; }

.lp-module-row {
    border-bottom: 1px solid var(--border);
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
    transition: background 0.2s ease;
}

.lp-module-row:last-child { border-bottom: none; }
.lp-module-row:hover      { background: rgba(37, 99, 235, 0.03); }

/* Cells */
.lp-td-num,
.lp-td-name,
.lp-td-contents,
.lp-td-progress,
.lp-td-action {
    padding: 1rem 1.25rem;
    vertical-align: middle;
}

.lp-mod-num {
    width: 34px;
    height: 34px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.lp-mod-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.lp-mod-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.lp-mtag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-light);
}

body.dark-mode .lp-mtag { background: rgba(255,255,255,0.06); }

.lp-contents-text {
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Progress bar */
.lp-prog-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lp-prog-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.lp-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.lp-prog-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 2.5rem;
}

/* Start / Continue / Review button */
.btn-start-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-start-module:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-start-module:active {
    transform: scale(0.97);
}

.btn-start-module--done {
    background: var(--success);
}

.btn-start-module--done:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}


/* ─────────────────────────────────────────────────────────────────
   MODULE DETAIL PAGE — module.html
   ───────────────────────────────────────────────────────────────── */

/* ── Module header card ───────────────────────────────────────── */

.lp-mod-header-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both;
    opacity: 0;
}

.lp-mhc-num {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
}

.lp-mhc-info {
    flex: 1;
}

.lp-mhc-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.lp-mhc-book {
    font-size: 0.82rem;
    color: var(--text-light);
}

.lp-mhc-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.lp-mhc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.lp-mhc-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.lp-stat-done {
    color: var(--success);
}

.lp-mhc-stat-lbl {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
}


/* ── Subtopic table ───────────────────────────────────────────── */

.lp-subtopic-table-card {
    animation-delay: 0.12s;
}

.lp-subtopic-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.lp-th--slno    { width: 72px;  }
.lp-th--subname { width: auto;  }
.lp-th--time    { width: 110px; }
.lp-th--done    { width: 70px; text-align: center; }

/* Topic section header row */
.lp-topic-header-row {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

body.dark-mode .lp-topic-header-row { background: rgba(255,255,255,0.04); }

.lp-td-dash {
    padding: 0.65rem 1.25rem;
    color: var(--text-light);
    font-weight: 700;
    text-align: center;
    font-size: 1rem;
}

.lp-td-topic-title {
    padding: 0.65rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lp-topic-pin {
    font-size: 1rem;
}

/* Subtopic rows */
.lp-sub-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.18s ease, opacity 0.3s ease;
}

.lp-sub-row:last-child { border-bottom: none; }

.lp-td-slno {
    padding: 0.8rem 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.lp-td-subname {
    padding: 0.8rem 0.75rem;
    font-size: 0.9rem;
}

.lp-td-time {
    padding: 0.8rem 0.75rem;
    white-space: nowrap;
}

.lp-time-badge {
    font-size: 0.8rem;
    color: var(--text-light);
}

.lp-td-done {
    padding: 0.8rem;
    text-align: center;
}

/* Unlocked row */
.lp-sub-row--unlocked { background: var(--card-bg); }
.lp-sub-row--unlocked:hover { background: rgba(37, 99, 235, 0.04); }

/* Locked row */
.lp-sub-row--locked {
    background: var(--card-bg);
    opacity: 0.55;
}

/* Done row */
.lp-sub-row--done {
    background: rgba(16, 185, 129, 0.04);
}

.lp-sub-row--done .lp-td-slno,
.lp-sub-row--done .lp-td-subname {
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-color: rgba(16, 185, 129, 0.4);
}

/* Active row (currently reading) */
.lp-sub-row--active {
    background: rgba(37, 99, 235, 0.07) !important;
    border-left: 3px solid var(--primary);
}

/* Newly unlocked highlight */
@keyframes unlockFlash {
    0%   { background: rgba(16, 185, 129, 0.2); }
    100% { background: transparent; }
}

.lp-sub-row--just-unlocked {
    animation: unlockFlash 1.2s ease forwards;
}

/* Shake (when trying to open locked) */
@keyframes shakeRow {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

.lp-sub-row--shake {
    animation: shakeRow 0.45s ease;
}

/* Subtopic link button */
.lp-sub-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.2s;
    text-align: left;
    font-family: inherit;
}

.lp-sub-link:hover {
    color: var(--primary-dark);
    text-decoration-style: solid;
}

/* Locked subtopic label */
.lp-sub-locked {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-lock-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Done checkbox */
.lp-done-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--success);
    cursor: pointer;
    border-radius: 4px;
}

.lp-done-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}


/* ─────────────────────────────────────────────────────────────────
   LLM CONTENT PANEL
   ───────────────────────────────────────────────────────────────── */

.lp-content-panel {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 1.5rem;
    animation: fadeSlideUp 0.4s ease both;
    opacity: 0;
}

/* Content panel top bar */
.lp-cp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: #1e293b;
    flex-wrap: wrap;
}

body.dark-mode .lp-cp-bar { background: #0f172a; }

.lp-cp-breadcrumb {
    font-size: 0.82rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.lp-cp-breadcrumb strong {
    color: #f1f5f9;
    font-weight: 600;
}

.lp-cp-sep {
    color: #475569;
    font-size: 0.75rem;
}

.lp-cp-actions {
    display: flex;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* Next Topic button */
.lp-btn-next {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    font-family: inherit;
}

.lp-btn-next:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.35);
}

.lp-btn-next:disabled {
    cursor: not-allowed;
}

/* Mark Complete button */
.lp-btn-complete {
    padding: 0.45rem 1rem;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.lp-btn-complete:hover:not(:disabled):not(.lp-btn-complete--done) {
    background: #059669;
    transform: translateY(-1px);
}

.lp-btn-complete--done {
    background: #475569;
    cursor: default;
}

.lp-btn-complete:active:not(.lp-btn-complete--done) {
    transform: scale(0.96);
}

/* Content body */
.lp-cp-body {
    padding: 2rem 2.25rem 2.5rem;
}

/* Loading state */
.lp-cp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* LLM content area */
.lp-cp-content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text);
}

.lp-cp-content h1,
.lp-cp-content h2,
.lp-cp-content h3 {
    margin: 1.25rem 0 0.5rem;
    font-weight: 700;
    color: var(--text);
}

.lp-cp-content h2 { font-size: 1.2rem; }
.lp-cp-content h3 { font-size: 1.05rem; color: var(--primary); }

.lp-cp-content p { margin: 0.6rem 0; }

.lp-cp-content strong { color: var(--text); }

.lp-cp-content ul,
.lp-cp-content ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.lp-cp-content li { margin: 0.3rem 0; }

/* Example callout box */
.lp-example-box {
    border-left: 4px solid var(--primary);
    background: rgba(37, 99, 235, 0.05);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

body.dark-mode .lp-example-box {
    background: rgba(37, 99, 235, 0.1);
}

.lp-ex-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.lp-example-box p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text);
}

/* Error box */
.lp-error-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.lp-error-box span { font-size: 2rem; }


/* ─────────────────────────────────────────────────────────────────
   MODULE COMPLETE BANNER
   ───────────────────────────────────────────────────────────────── */

.lp-complete-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(37,99,235,0.08));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 14px;
    margin-top: 1rem;
    animation: fadeSlideUp 0.5s ease both;
    opacity: 0;
}

.lp-complete-icon {
    font-size: 2rem;
    flex-shrink: 0;
    animation: pulse 1.5s ease 2;
}

.lp-complete-banner strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.lp-complete-banner p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}


/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .lp-th--contents,
    .lp-td-contents { display: none; }

    .lp-th--progress { width: 120px; }

    .lp-mhc-stats { gap: 1rem; }
    .lp-mhc-stat-val { font-size: 1.2rem; }
}

@media (max-width: 640px) {
    .lp-book-header,
    .lp-mod-header-card { flex-direction: column; align-items: flex-start; }

    .lp-mhc-stats {
        align-self: stretch;
        justify-content: space-around;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
    }

    .lp-bh-overall { display: none; }

    .lp-th--progress,
    .lp-td-progress { display: none; }

    .lp-cp-bar { flex-direction: column; align-items: flex-start; }
    .lp-cp-actions { width: 100%; justify-content: flex-end; }

    .lp-cp-body { padding: 1.25rem 1rem; }

    .lp-complete-banner { flex-wrap: wrap; }
    .lp-complete-banner .btn-start-module { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════════
   📘 APPEND THIS TO THE BOTTOM OF style.css
   These are the ONLY additions needed for book1_details / book2_details.
   If you already added lms_learning.css from the last session,
   only add the NEW blocks marked with ← NEW below.
   ══════════════════════════════════════════════════════════════════ */

/* ── Shared table card ──────────────────────────────────────────── */
.lp-table-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.15s both;
    opacity: 0;
}

/* ── Book header ────────────────────────────────────────────────── */
.lp-book-header {
    display: flex; align-items: flex-start; gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both; opacity: 0;
}
.lp-bh-icon-wrap {
    width: 72px; height: 72px; flex-shrink: 0;
    background: rgba(37,99,235,0.07); border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.lp-bh-info { flex: 1; }
.lp-bh-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .35rem; line-height: 1.2; }
.lp-bh-desc  { font-size: 0.9rem; color: var(--text-light); margin-bottom: .75rem; line-height: 1.5; }
.lp-bh-tags  { display: flex; flex-wrap: wrap; gap: .5rem; }
.lp-tag { font-size: .75rem; font-weight: 600; padding: .2rem .7rem; border-radius: 999px;
    background: rgba(37,99,235,0.08); color: var(--primary); border: 1px solid rgba(37,99,235,0.15); }
.lp-tag--subject  { background: rgba(16,185,129,0.1);  color: #065f46; border-color: rgba(16,185,129,0.2); }
.lp-tag--progress { background: rgba(16,185,129,0.12); color: #065f46; border-color: rgba(16,185,129,0.25); }
body.dark-mode .lp-tag           { background: rgba(37,99,235,0.2);  color: #93c5fd; border-color: rgba(37,99,235,0.3); }
body.dark-mode .lp-tag--subject  { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
body.dark-mode .lp-tag--progress { background: rgba(16,185,129,0.2); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.lp-bh-overall { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex-shrink: 0; }
.lp-bh-circle  { position: relative; width: 60px; height: 60px; }
.lp-circle-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lp-circle-bg, .lp-circle-fill { fill: none; stroke-width: 3; stroke-linecap: round; }
.lp-circle-bg   { stroke: var(--border); }
.lp-circle-fill { stroke: var(--primary); transition: stroke-dasharray .6s ease; }
.lp-circle-pct  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--primary); }
.lp-bh-overall-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
    font-weight: 600; color: var(--text-light); }

/* ── Module overview table ──────────────────────────────────────── */
.lp-module-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lp-th { background: #1e293b; color: #f1f5f9; font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; padding: .85rem 1.25rem; text-align: left; white-space: nowrap; }
body.dark-mode .lp-th { background: #0f172a; color: #94a3b8; }
.lp-th--num      { width: 60px;  }
.lp-th--name     { width: auto;  }
.lp-th--contents { width: 180px; }
.lp-th--progress { width: 160px; }
.lp-th--action   { width: 190px; }
.lp-module-row { border-bottom: 1px solid var(--border); animation: fadeSlideUp .5s ease both; opacity: 0;
    transition: background .2s ease; }
.lp-module-row:last-child { border-bottom: none; }
.lp-module-row:hover      { background: rgba(37,99,235,0.03); }
.lp-td-num, .lp-td-name, .lp-td-contents, .lp-td-progress, .lp-td-action { padding: 1rem 1.25rem; vertical-align: middle; }
.lp-mod-num { width: 34px; height: 34px; background: rgba(37,99,235,0.1); color: var(--primary);
    border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }
.lp-mod-title { font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.lp-mod-tags  { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.lp-mtag { font-size: .7rem; font-weight: 500; padding: .15rem .6rem; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border); color: var(--text-light); }
body.dark-mode .lp-mtag { background: rgba(255,255,255,0.06); }
.lp-contents-text { font-size: .85rem; color: var(--text-light); white-space: nowrap; }
.lp-prog-wrap { display: flex; align-items: center; gap: .6rem; }
.lp-prog-bar  { flex: 1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.lp-prog-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 999px; transition: width .6s ease; }
.lp-prog-pct { font-size: .78rem; font-weight: 700; color: var(--text-light); white-space: nowrap; min-width: 2.5rem; }
.btn-start-module {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .5rem 1.1rem; background: var(--primary); color: white; border-radius: 8px;
    font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background .2s, transform .2s, box-shadow .2s; border: none; cursor: pointer;
}
.btn-start-module:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-start-module:active { transform: scale(.97); }
.btn-start-module--done { background: var(--success); }
.btn-start-module--done:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

/* ── Module header card (details page) ─────────────────────────── */
.lp-mod-header-card {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.5rem 1.75rem; background: var(--card-bg);
    border-radius: 16px; box-shadow: 0 2px 20px rgba(0,0,0,0.06);
    border-left: 5px solid var(--primary); margin-bottom: 1.5rem;
    animation: fadeSlideUp 0.5s ease 0.05s both; opacity: 0;
}
.lp-mhc-num {
    width: 52px; height: 52px; flex-shrink: 0;
    background: var(--primary); color: white; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
}
.lp-mhc-info  { flex: 1; }
.lp-mhc-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: .2rem; }
.lp-mhc-book  { font-size: .82rem; color: var(--text-light); }
.lp-mhc-stats { display: flex; gap: 1.5rem; flex-shrink: 0; }
.lp-mhc-stat  { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.lp-mhc-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.lp-stat-done    { color: var(--success); }
.lp-mhc-stat-lbl { font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-light); }

/* ── Subtopic table ─────────────────────────────────────────────── */
.lp-subtopic-table-card { animation-delay: .12s; }
.lp-subtopic-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lp-th--slno    { width: 72px; }
.lp-th--subname { width: auto; }
.lp-th--time    { width: 110px; }
.lp-th--done    { width: 70px; text-align: center; }
.lp-topic-header-row { background: #f1f5f9; border-bottom: 1px solid var(--border); }
body.dark-mode .lp-topic-header-row { background: rgba(255,255,255,0.04); }
.lp-td-dash { padding: .65rem 1.25rem; color: var(--text-light); font-weight: 700; text-align: center; font-size: 1rem; }
.lp-td-topic-title { padding: .65rem .75rem; font-size: .875rem; }
.lp-topic-pin { font-size: 1rem; margin-right: .3rem; }
.lp-sub-row { border-bottom: 1px solid var(--border); transition: background .18s ease; }
.lp-sub-row:last-child { border-bottom: none; }
.lp-td-slno   { padding: .8rem 1.25rem; text-align: center; font-size: .85rem; color: var(--text-light); font-weight: 600; }
.lp-td-subname { padding: .8rem .75rem; font-size: .9rem; }
.lp-td-time    { padding: .8rem .75rem; white-space: nowrap; }
.lp-time-badge { font-size: .8rem; color: var(--text-light); }
.lp-td-done    { padding: .8rem; text-align: center; }
/* Row states */
.lp-sub-row--unlocked { background: var(--card-bg); }
.lp-sub-row--unlocked:hover { background: rgba(37,99,235,0.04); }
.lp-sub-row--locked   { background: var(--card-bg); opacity: .55; }
.lp-sub-row--done     { background: rgba(16,185,129,0.04); }
.lp-sub-row--done .lp-td-slno,
.lp-sub-row--done .lp-td-subname { text-decoration: line-through; text-decoration-color: rgba(16,185,129,0.4); color: var(--text-light); }
.lp-sub-row--active   { background: rgba(37,99,235,0.07) !important; border-left: 3px solid var(--primary); }
/* Animations */
@keyframes unlockFlash { 0% { background: rgba(16,185,129,0.2); } 100% { background: transparent; } }
.lp-row-flash { animation: unlockFlash 1.1s ease forwards; }
@keyframes shakeRow { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lp-row-shake { animation: shakeRow .45s ease; }
/* Subtopic button & lock */
.lp-sub-link {
    background: none; border: none; padding: 0; font-family: inherit;
    font-size: .9rem; font-weight: 500; color: var(--primary); cursor: pointer;
    text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
    transition: color .2s; text-align: left;
}
.lp-sub-link:hover { color: var(--primary-dark); text-decoration-style: solid; }
.lp-sub-locked { display: flex; align-items: center; gap: .4rem; color: var(--text-light); font-size: .9rem; }
.lp-lock-icon  { font-size: .85rem; opacity: .7; }
.lp-done-checkbox { width: 17px; height: 17px; accent-color: var(--success); cursor: pointer; }
.lp-done-checkbox:disabled { cursor: not-allowed; opacity: .4; }

/* ── LLM content panel ──────────────────────────────────────────── */
.lp-content-panel {
    background: var(--card-bg); border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08); overflow: hidden;
    margin-top: 1.5rem; animation: fadeSlideUp .4s ease both; opacity: 0;
}
.lp-cp-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: .85rem 1.5rem; background: #1e293b; flex-wrap: wrap;
}
body.dark-mode .lp-cp-bar { background: #0f172a; }
.lp-cp-breadcrumb { font-size: .82rem; color: #94a3b8; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.lp-cp-breadcrumb strong { color: #f1f5f9; font-weight: 600; }
.lp-cp-sep    { color: #475569; }
.lp-cp-actions { display: flex; gap: .65rem; flex-shrink: 0; }
/* Buttons in panel */
.lp-btn-next {
    padding: .45rem 1rem; background: transparent;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
    color: #cbd5e1; font-size: .82rem; font-weight: 600; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s; font-family: inherit;
}
.lp-btn-next:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.35); }
.lp-btn-next:disabled { cursor: not-allowed; opacity: .4; }
.lp-btn-complete {
    padding: .45rem 1rem; background: var(--success); border: none; border-radius: 8px;
    color: white; font-size: .82rem; font-weight: 700; cursor: pointer;
    transition: background .2s, transform .15s; font-family: inherit; white-space: nowrap;
}
.lp-btn-complete:hover:not(:disabled):not(.lp-btn-complete--done) { background: #059669; transform: translateY(-1px); }
.lp-btn-complete--done { background: #475569; cursor: default; }
.lp-btn-complete:active:not(.lp-btn-complete--done) { transform: scale(.96); }
/* Content body */
.lp-cp-body { padding: 2rem 2.25rem 2.5rem; }
.lp-cp-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem;
    padding: 3rem; color: var(--text-light); font-size: .9rem; }
.lp-spinner { width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.lp-cp-content { font-size: 1rem; line-height: 1.85; color: var(--text); }
.lp-cp-content h2 { font-size: 1.2rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.lp-cp-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin: 1rem 0 .4rem; }
.lp-cp-content p  { margin: .6rem 0; }
.lp-cp-content ul, .lp-cp-content ol { padding-left: 1.5rem; margin: .5rem 0; }
.lp-cp-content li { margin: .3rem 0; }
/* Example callout */
.lp-example-box {
    border-left: 4px solid var(--primary); background: rgba(37,99,235,0.05);
    border-radius: 0 10px 10px 0; padding: 1rem 1.25rem; margin: 1.25rem 0;
}
body.dark-mode .lp-example-box { background: rgba(37,99,235,0.1); }
.lp-ex-label { display: block; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: .35rem; }
.lp-example-box p { margin: 0; font-size: .92rem; line-height: 1.6; }
/* Error */
.lp-error-box { display: flex; flex-direction: column; align-items: center;
    gap: .5rem; padding: 2.5rem; text-align: center; color: var(--text-light); font-size: .9rem; }
.lp-error-box span { font-size: 2rem; }

/* ── Module complete banner ─────────────────────────────────────── */
.lp-complete-banner {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(37,99,235,0.06));
    border: 1px solid rgba(16,185,129,0.3); border-radius: 14px;
    margin-top: 1rem; animation: fadeSlideUp .5s ease both; opacity: 0;
}
.lp-complete-icon { font-size: 2rem; flex-shrink: 0; animation: pulse 1.5s ease 2; }
.lp-complete-banner strong { display: block; font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.lp-complete-banner p { font-size: .85rem; color: var(--text-light); margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .lp-th--contents, .lp-td-contents { display: none; }
    .lp-th--progress { width: 120px; }
    .lp-mhc-stats { gap: 1rem; }
}
@media (max-width: 640px) {
    .lp-book-header, .lp-mod-header-card { flex-direction: column; align-items: flex-start; }
    .lp-mhc-stats { align-self: stretch; justify-content: space-around;
        padding-top: .75rem; border-top: 1px solid var(--border); }
    .lp-bh-overall { display: none; }
    .lp-th--progress, .lp-td-progress { display: none; }
    .lp-cp-bar { flex-direction: column; align-items: flex-start; }
    .lp-cp-actions { width: 100%; justify-content: flex-end; }
    .lp-cp-body { padding: 1.25rem 1rem; }
    .lp-complete-banner { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════
   📚  LEARNING CARD STYLES
   APPEND to the bottom of static/css/style.css

   These styles target the HTML output of learning_content.py's
   _md_to_html() method, rendered inside #cpContent in
   book1_details.html and book2_details.html.
   ══════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────
   LEARNING CARD WRAPPER
   ───────────────────────────────────────────────────────────────── */

.lp-learning-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION BLOCKS
   Each ## heading becomes a .lp-lc-section div
   ───────────────────────────────────────────────────────────────── */

.lp-lc-section {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.lp-lc-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* First section — no top padding needed (parent already has padding) */
.lp-lc-section:first-child {
    padding-top: 0;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION HEADINGS
   ───────────────────────────────────────────────────────────────── */

.lp-lc-head {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Introduction — blue */
.lp-lc-head--intro {
    color: var(--primary);
}

/* Key Facts — amber */
.lp-lc-head--facts {
    color: #b45309;
}

body.dark-mode .lp-lc-head--facts {
    color: #fbbf24;
}

/* Example — teal */
.lp-lc-head--example {
    color: #0d7490;
}

body.dark-mode .lp-lc-head--example {
    color: #22d3ee;
}

/* Summary — green */
.lp-lc-head--summary {
    color: #047857;
}

body.dark-mode .lp-lc-head--summary {
    color: #34d399;
}


/* ─────────────────────────────────────────────────────────────────
   SECTION-SPECIFIC BACKGROUNDS
   ───────────────────────────────────────────────────────────────── */

/* Example section — subtle blue tint */
.lp-lc-section--example {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    margin: 0.5rem 0;
}

body.dark-mode .lp-lc-section--example {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

/* Summary section — green tint pill */
.lp-lc-section--summary {
    background: rgba(16, 185, 129, 0.05);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    margin-top: 0.5rem;
}

body.dark-mode .lp-lc-section--summary {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}


/* ─────────────────────────────────────────────────────────────────
   PROSE (paragraphs inside sections)
   ───────────────────────────────────────────────────────────────── */

.lp-lc-section p {
    font-size: 0.96rem;
    line-height: 1.85;
    color: var(--text);
    margin: 0.4rem 0;
}

.lp-lc-section--summary p {
    font-size: 0.95rem;
    font-weight: 600;
    color: #065f46;
    line-height: 1.6;
}

body.dark-mode .lp-lc-section--summary p {
    color: #6ee7b7;
}


/* ─────────────────────────────────────────────────────────────────
   KEY FACTS LIST
   ───────────────────────────────────────────────────────────────── */

.lp-facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lp-facts-list li {
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--text);
    padding-left: 1.25rem;
    position: relative;
}

.lp-facts-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Bold term in "**Term**: explanation" pattern */
.lp-facts-list li strong {
    color: var(--text);
    font-weight: 700;
}


/* ─────────────────────────────────────────────────────────────────
   INLINE CODE
   ───────────────────────────────────────────────────────────────── */

.lp-inline-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.83rem;
    background: rgba(37, 99, 235, 0.07);
    color: var(--primary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

body.dark-mode .lp-inline-code {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.25);
}


/* ─────────────────────────────────────────────────────────────────
   ERROR BOX  (shown when API call fails)
   ───────────────────────────────────────────────────────────────── */

.lp-error-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    margin: 0.5rem 0;
}

.lp-error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.lp-error-box strong {
    display: block;
    font-size: 0.95rem;
    color: #b91c1c;
    margin-bottom: 0.25rem;
}

.lp-error-box p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.lp-btn-retry {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
    white-space: nowrap;
    align-self: center;
}

.lp-btn-retry:hover {
    background: var(--bg);
    color: var(--text);
}

/* ============================= */
/* 👤 PROFILE MODAL */
/* ============================= */

.profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.profile-modal-content {
    background: var(--card-bg);
    padding: 2rem 2.2rem;
    border-radius: 18px;
    width: min(460px, 90vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: fadeSlideUp 0.3s ease;

    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.profile-modal h3 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.profile-modal-content p {
    margin: 0;
    font-size: 0.95rem;
}

.profile-modal-content button {
    margin-top: 1.2rem;
}

/* =======================================
   ⏳ IDLE POPUP STYLES
   ======================================= */

.idle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.idle-box {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 360px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: fadeSlideUp 0.3s ease;
}

.idle-box h3 {
    margin-bottom: 0.75rem;
}

.idle-box p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* ══════════════════════════════════════════════════════════════════
   🎧  PROFESSOR AUDIO SECTION
   APPEND this entire block to the bottom of static/css/style.css
   ══════════════════════════════════════════════════════════════════ */


/* ── Outer container ────────────────────────────────────────────── */
.lp-audio-section {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeSlideUp 0.4s ease both;
}

body.dark-mode .lp-audio-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}


/* ── Header row: title + language buttons ───────────────────────── */
.lp-audio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.lp-audio-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.lp-audio-icon {
    font-size: 1.1rem;
    line-height: 1;
}


/* ── Language button group ──────────────────────────────────────── */
.lp-audio-lang-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lp-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.lp-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.lp-lang-btn:active {
    transform: scale(0.96);
}

/* Active / selected state */
.lp-lang-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.lp-lang-btn--active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.4);
}

.lp-lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lp-lang-name {
    letter-spacing: 0.01em;
}

body.dark-mode .lp-lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

body.dark-mode .lp-lang-btn:hover {
    border-color: #93c5fd;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
}

body.dark-mode .lp-lang-btn--active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}


/* ── Audio loading state ────────────────────────────────────────── */
.lp-audio-loading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
}

.lp-audio-spinner {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2.5px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.lp-audio-loading-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.lp-audio-loading-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.lp-audio-loading-sub {
    font-size: 0.75rem;
    color: var(--text-light);
}


/* ── Audio player wrapper ───────────────────────────────────────── */
.lp-audio-player-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

body.dark-mode .lp-audio-player-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.lp-audio-player-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lp-audio-now-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.lp-audio-now-lang {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

body.dark-mode .lp-audio-now-lang {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
}

/* Native <audio> element — styled minimally but cleanly */
.lp-audio-el {
    width: 100%;
    height: 36px;
    border-radius: 8px;
    outline: none;
    accent-color: var(--primary);
}

/* Chrome/Edge custom audio styling */
.lp-audio-el::-webkit-media-controls-panel {
    background-color: transparent;
}


/* ── Error state ────────────────────────────────────────────────── */
.lp-audio-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #b91c1c;
}

body.dark-mode .lp-audio-error {
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
}

#audioErrorMsg {
    flex: 1;
    color: inherit;
}

.lp-audio-retry {
    flex-shrink: 0;
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #b91c1c;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.lp-audio-retry:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
}


/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .lp-audio-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lp-audio-lang-group {
        width: 100%;
    }

    .lp-lang-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════
   DOUBT PAGE — FULL-WIDTH PROFESSIONAL REDESIGN
   APPEND this entire block to the bottom of static/css/style.css
   ════════════════════════════════════════════════════════════════ */

/* ─── Slide-in animation ─────────────────────────────────────── */
@keyframes dsSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Outer wrapper ──────────────────────────────────────────── */
.ds-answer-wrap {
    display: flex;
    flex-direction: column;
    margin-top: 1.25rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    animation: dsSlideUp 0.35s ease both;
}

body.dark-mode .ds-answer-wrap {
    background: #1a2035;
    border-color: rgba(255,255,255,0.07);
}

/* ─── Dark topbar ────────────────────────────────────────────── */
.ds-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    background: #1e293b;
    gap: 1rem;
    min-height: 46px;
}

.ds-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    flex: 1;
}

.ds-page-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #94a3b8;
    background: rgba(255,255,255,0.07);
    padding: 0.18rem 0.55rem;
    border-radius: 5px;
    white-space: nowrap;
}

.ds-topbar-dot {
    color: #475569;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ds-topbar-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-topbar-nav {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.ds-nav-btn {
    padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 7px;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ds-nav-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
}

.ds-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ─── Page flip animation ────────────────────────────────────── */
.ds-content-card.flipping {
    animation: dsFlip 0.3s ease;
}

@keyframes dsFlip {
    0%   { opacity: 1; transform: translateX(0); }
    45%  { opacity: 0; transform: translateX(18px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ─── Content card ───────────────────────────────────────────── */
.ds-content-card {
    padding: 2rem 2.5rem 1.75rem;
    background: var(--card-bg);
    min-height: 300px;
}

body.dark-mode .ds-content-card {
    background: #1a2035;
}

/* ─── Card header row ────────────────────────────────────────── */
.ds-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid rgba(37,99,235,0.1);
}

.ds-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
    flex: 1;
    margin: 0;
}

/* ─── Audio trigger button ───────────────────────────────────── */
.ds-audio-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.85rem;
    background: rgba(37,99,235,0.07);
    border: 1.5px solid rgba(37,99,235,0.2);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
    white-space: nowrap;
    -webkit-user-select: none; /* Safari 3+, iOS 3+ */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.ds-audio-trigger:hover {
    background: rgba(37,99,235,0.13);
    border-color: rgba(37,99,235,0.38);
    box-shadow: 0 2px 8px rgba(37,99,235,0.15);
    transform: translateY(-1px);
}
.ds-audio-trigger.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(37,99,235,0.3);
}
.ds-audio-trigger-icon { font-size: 0.88rem; line-height: 1; }
body.dark-mode .ds-audio-trigger {
    background: rgba(99,150,255,0.1);
    border-color: rgba(99,150,255,0.22);
    color: #93c5fd;
}
body.dark-mode .ds-audio-trigger:hover {
    background: rgba(99,150,255,0.18);
    border-color: rgba(99,150,255,0.4);
}
body.dark-mode .ds-audio-trigger.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ─── Inline audio panel ─────────────────────────────────────── */
@keyframes dsPanelIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ds-audio-panel {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    animation: dsPanelIn 0.2s ease both;
}
body.dark-mode .ds-audio-panel {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
}

.ds-audio-panel-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.ds-audio-panel-hint {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    flex-shrink: 0;
    white-space: nowrap;
}


.ds-card-body {
    font-size: 0.93rem;
    line-height: 1.9;
    color: var(--text);
}

/* ─── Audio states (inside panel) ───────────────────────────── */


/* ─── Language buttons ───────────────────────────────────────── */
.ds-lang-group {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ds-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.75rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.16s ease;
    white-space: nowrap;
    -webkit-user-select: none; /* Safari 3+, iOS 3+ */
    -ms-user-select: none; /* IE 10+ */
    user-select: none;
}

.ds-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37,99,235,0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}

.ds-lang-btn:active { transform: scale(0.96); }

.ds-lang-btn--active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.28);
}

.ds-lang-flag { font-size: 0.88rem; line-height: 1; }

body.dark-mode .ds-lang-btn {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.09);
    color: #94a3b8;
}

body.dark-mode .ds-lang-btn:hover {
    border-color: #93c5fd;
    color: #93c5fd;
    background: rgba(37,99,235,0.1);
}

/* ─── Audio states ───────────────────────────────────────────── */
.ds-audio-states {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.ds-audio-idle {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* Loading */
.ds-audio-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.ds-audio-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(37,99,235,0.18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dsSpin 0.75s linear infinite;
    flex-shrink: 0;
}

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

/* Player row */
.ds-audio-player-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
}

.ds-now-pill {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary);
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.15);
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

body.dark-mode .ds-now-pill {
    background: rgba(37,99,235,0.15);
    color: #93c5fd;
}

.ds-audio-el {
    flex: 1;
    min-width: 0;
    height: 34px;
    border-radius: 8px;
    accent-color: var(--primary);
}

/* Error */
.ds-audio-err {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.77rem;
    color: #b91c1c;
    min-width: 0;
}

body.dark-mode .ds-audio-err { color: #fca5a5; }

#dsAudioErrMsg {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-audio-retry-btn {
    flex-shrink: 0;
    padding: 0.22rem 0.55rem;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b91c1c;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.ds-audio-retry-btn:hover { background: rgba(239,68,68,0.07); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 680px) {
    .ds-content-card { padding: 1.25rem 1rem; }

    .ds-audio-panel-top { flex-direction: column; align-items: flex-start; }

    .ds-lang-group { width: 100%; }

    .ds-lang-btn {
        flex: 1;
        justify-content: center;
    }

    .ds-audio-states { width: 100%; }

    .ds-audio-el { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   SUMMARY ROW CSS — APPEND to static/css/style.css
   ══════════════════════════════════════════════════════════════ */

/* ── Summary row in subtopic table ─────────────────────────── */
.lp-summary-row {
    border-top: 2px solid rgba(37,99,235,.1);
    position: relative;
}

.lp-summary-row--locked {
    opacity: .6;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,.02) 8px,
        rgba(0,0,0,.02) 16px
    );
}

body.dark-mode .lp-summary-row--locked {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,.02) 8px,
        rgba(255,255,255,.02) 16px
    );
}

.lp-summary-row--unlocked {
    background: linear-gradient(90deg, rgba(37,99,235,.04), rgba(5,150,105,.03));
    animation: lpSummaryPulse 2s ease-in-out;
}

@keyframes lpSummaryPulse {
    0%   { background:rgba(37,99,235,.1); }
    100% { background:linear-gradient(90deg,rgba(37,99,235,.04),rgba(5,150,105,.03)); }
}

.lp-summary-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .17s ease;
    box-shadow: 0 2px 8px rgba(37,99,235,.2);
}

.lp-summary-link:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,.28);
}

.lp-summary-badge {
    background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(5,150,105,.08)) !important;
    color: var(--primary) !important;
    font-weight: 700;
}

.lp-summary-check {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   🎓 PROFESSOR PANEL — ADVANCED UI
   ============================================ */

.ds-layout-3col {
    display: grid;
    grid-template-columns: 200px 1fr 90px;
    gap: 2rem;
    align-items: start;
}

/* Professor Panel */
.ds-professor-panel {
    text-align: center;
    position: sticky;
    top: 30px;
}

/* Avatar Wrap */
.ds-prof-avatar-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

/* Gradient Halo */
.ds-prof-halo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(37,99,235,0.35),
        rgba(37,99,235,0.15),
        transparent 70%);
    filter: blur(20px);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Avatar */
.ds-prof-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    margin: 10px auto 0;
    transition: transform 0.3s ease;
}

/* Speaking pulse */
.ds-prof-avatar.speaking {
    animation: profPulse 1.8s ease-in-out infinite;
}

@keyframes profPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.5); }
    50%     { box-shadow: 0 0 0 14px rgba(37,99,235,0); }
}

.ds-prof-name {
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.ds-prof-role {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 0.3rem;
    min-height: 18px;
}

/* Responsive */
@media (max-width: 900px) {
    .ds-layout-3col {
        grid-template-columns: 1fr;
    }

    .ds-professor-panel {
        position: static;
        margin-bottom: 1.5rem;
    }

    .ds-audio-sidebar {
        width: 100%;
        position: static;
        border-left: none;
        border-top: 1px solid var(--border);
        flex-direction: row;
        justify-content: center;
        padding: 1rem;
    }
}

/* =========================================
   🎧 FLOATING MINI AUDIO PLAYER
========================================= */

.mini-audio-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.18);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    transform: translateY(120%);
    transition: transform 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

.mini-audio-player.active {
    position: fixed;
    bottom: 20px;
    right: 20px;
    opacity: 1;
}

.mini-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

.mini-audio-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}

.mini-seek {
    width: 100%;
    cursor: pointer;
}

.mini-close-btn {
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-light);
}

.mini-close-btn:hover {
    color: var(--error);
}

.audio-dashboard {
    margin-top: 1.5rem;
}

.audio-controls {
    margin-top: 1rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.hidden {
    display: none;
}

.audio-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

#audioSeek {
    flex: 1;
    appearance: none;
    height: 6px;
    border-radius: 4px;
    background: #e5e7eb;
    cursor: pointer;
}

#audioSeek::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

.audio-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.btn-control {
    padding: 0.6rem;
    border-radius: 12px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-control.primary { background: #2563eb; color: white; }
.btn-control.secondary { background: #f59e0b; color: white; }
.btn-control.danger { background: #ef4444; color: white; }
.btn-control.ghost { background: #e5e7eb; }

/* ════════════════════════════════════════════════════════════
   LP AUDIO FAB  —  sticky right-side audio button
   Used by: book1_details
   ════════════════════════════════════════════════════════════ */
@keyframes lpFabPulse {
    0%,100% { box-shadow: 0 0 0 0   rgba(16,185,129,.5); }
    50%      { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
}
@keyframes lpFabSpin  { to { transform: rotate(360deg); } }

/* Layout: content + FAB column side by side */
.lp-cp-body--row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.lp-cp-main {
    flex: 1;
    min-width: 0;
}

/* Sticky FAB column */
.lp-fab-col {
    width: 64px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

/* Main FAB button */
.lp-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2.5px solid var(--primary);
    background: rgba(37,99,235,.08);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-family: inherit;
    transition: background .18s, box-shadow .18s, transform .12s, border-color .18s;
    outline: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.lp-fab:hover {
    background: rgba(37,99,235,.14);
    box-shadow: 0 4px 16px rgba(37,99,235,.22);
    transform: translateY(-2px);
}
.lp-fab:active { transform: scale(.94); }

.lp-fab.is-loading {
    border-top-color:    var(--primary);
    border-right-color:  rgba(37,99,235,.2);
    border-bottom-color: rgba(37,99,235,.2);
    border-left-color:   rgba(37,99,235,.2);
    animation: lpFabSpin .85s linear infinite;
    background: transparent;
}
.lp-fab.is-loading .lp-fab-icon { opacity: 0; }
.lp-fab.is-playing {
    border-color: #10b981;
    background: rgba(16,185,129,.09);
    color: #10b981;
    animation: lpFabPulse 2s ease-in-out infinite;
}
.lp-fab.is-playing:hover { animation: none; background: rgba(16,185,129,.16); }
.lp-fab.is-paused {
    border-color: #f59e0b;
    background: rgba(245,158,11,.08);
    color: #d97706;
}
.lp-fab.is-error {
    border-color: #ef4444;
    background: rgba(239,68,68,.08);
    color: #dc2626;
    animation: none;
}

.lp-fab-icon { pointer-events: none; line-height: 1; }

.lp-fab-label {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-light);
    text-align: center;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

/* Progress bar */
.lp-fab-bar-wrap {
    width: 40px;
    height: 3px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    display: none;
}
.lp-fab-bar-wrap.show { display: block; }
.lp-fab-bar {
    height: 100%;
    width: 0%;
    background: #10b981;
    border-radius: 999px;
    transition: width .5s linear;
}

/* Small action buttons */
.lp-fab-action {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-light);
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, color .15s, background .15s;
}
.lp-fab-action.show { display: flex; }
.lp-fab-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37,99,235,.06);
}
.lp-fab-retry-btn {
    border-color: rgba(239,68,68,.35);
    color: #dc2626;
    font-size: .6rem;
    font-weight: 700;
    width: auto;
    border-radius: 6px;
    padding: 3px 8px;
    height: auto;
}
.lp-fab-retry-btn:hover { background: rgba(239,68,68,.07); border-color: #ef4444; }

/* Dark mode */
body.dark-mode .lp-fab            { background: rgba(99,150,255,.07); border-color: #3b82f6; color: #93c5fd; }
body.dark-mode .lp-fab.is-playing { border-color: #34d399; color: #34d399; }
body.dark-mode .lp-fab.is-paused  { border-color: #fbbf24; color: #fbbf24; }
body.dark-mode .lp-fab.is-error   { border-color: #f87171; color: #f87171; }
body.dark-mode .lp-fab-bar-wrap   { background: rgba(255,255,255,.1); }

@media (max-width: 640px) {
    .lp-cp-body--row { flex-direction: column; }
    .lp-fab-col      { position: static; width: 100%; flex-direction: row; justify-content: center; padding: 10px 0; border-top: 1px solid var(--border); }
}

/* ═══════════════════════════════════════════════════════════
       AUDIO PLAYER WIDGET  —  Production Grade
    ═══════════════════════════════════════════════════════════ */

    .adp-wrap {
        position: sticky;
        top: 24px;
        align-self: flex-start;
        width: 220px;
        flex-shrink: 0;
    }

    /* Glassmorphism card */
    .adp-card {
        background: rgba(255,255,255,0.75);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        border: 1px solid rgba(255,255,255,0.5);
        border-radius: 20px;
        padding: 1.25rem 1.1rem 1rem;
        box-shadow:
            0 4px 6px -1px rgba(0,0,0,0.06),
            0 20px 40px rgba(37,99,235,0.08);
        display: flex;
        flex-direction: column;
        gap: 1rem;
        transition: box-shadow 0.3s;
    }
    .adp-card:hover {
        box-shadow: 0 8px 32px rgba(37,99,235,0.14), 0 2px 8px rgba(0,0,0,0.06);
    }
    body.dark-mode .adp-card {
        background: rgba(26,32,53,0.85);
        border-color: rgba(255,255,255,0.08);
    }

    /* Header */
    .adp-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
    }
    .adp-header-left {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        min-width: 0;
    }

    /* Mic ring */
    .adp-mic-ring {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: 2px solid var(--primary);
        background: rgba(37,99,235,0.07);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
        transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    }
    .adp-mic-ring.is-playing {
        border-color: #10b981;
        background: rgba(16,185,129,0.09);
        box-shadow: 0 0 0 5px rgba(16,185,129,0.15);
        animation: adpRingPulse 2s ease-in-out infinite;
    }
    .adp-mic-ring.is-loading {
        border-color: transparent;
        border-top-color: var(--primary);
        animation: adpSpin 0.8s linear infinite;
    }
    @keyframes adpRingPulse {
        0%,100% { box-shadow: 0 0 0 0   rgba(16,185,129,0.4); }
        50%      { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    }
    @keyframes adpSpin { to { transform: rotate(360deg); } }

    .adp-title {
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--text);
        line-height: 1.2;
    }
    .adp-subtitle {
        font-size: 0.65rem;
        color: var(--text-light);
        margin-top: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }

    /* Status pill */
    .adp-status-pill {
        font-size: 0.58rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 2px 8px;
        border-radius: 999px;
        background: rgba(100,116,139,0.1);
        color: var(--text-light);
        flex-shrink: 0;
        white-space: nowrap;
        transition: background 0.25s, color 0.25s;
    }
    .adp-status-pill.playing { background: rgba(16,185,129,0.12); color: #059669; }
    .adp-status-pill.loading { background: rgba(37,99,235,0.1);   color: var(--primary); }
    .adp-status-pill.paused  { background: rgba(245,158,11,0.12); color: #d97706; }
    .adp-status-pill.error   { background: rgba(239,68,68,0.1);   color: #dc2626; }

    /* Waveform bars */
    .adp-wave {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 28px;
    }
    .adp-wave span {
        display: block;
        width: 3px;
        border-radius: 999px;
        background: var(--primary);
        opacity: 0.25;
        height: 6px;
        transition: opacity 0.3s;
    }
    .adp-wave.is-playing span { opacity: 1; }
    .adp-wave.is-playing span:nth-child(1) { animation: adpBar 0.9s ease-in-out infinite; }
    .adp-wave.is-playing span:nth-child(2) { animation: adpBar 0.9s ease-in-out infinite 0.1s; }
    .adp-wave.is-playing span:nth-child(3) { animation: adpBar 0.9s ease-in-out infinite 0.2s; }
    .adp-wave.is-playing span:nth-child(4) { animation: adpBar 0.9s ease-in-out infinite 0.05s; background: #10b981; }
    .adp-wave.is-playing span:nth-child(5) { animation: adpBar 0.9s ease-in-out infinite 0.25s; }
    .adp-wave.is-playing span:nth-child(6) { animation: adpBar 0.9s ease-in-out infinite 0.15s; }
    .adp-wave.is-playing span:nth-child(7) { animation: adpBar 0.9s ease-in-out infinite 0.3s; background: #6366f1; }
    .adp-wave.is-playing span:nth-child(8) { animation: adpBar 0.9s ease-in-out infinite 0.08s; }
    .adp-wave.is-playing span:nth-child(9) { animation: adpBar 0.9s ease-in-out infinite 0.22s; }
    @keyframes adpBar {
        0%,100% { height: 6px; }
        50%      { height: 22px; }
    }

    /* Progress area */
    .adp-progress-area {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }
    .adp-progress-area.hidden { display: none; }
    .adp-time-row {
        display: flex;
        justify-content: space-between;
    }
    .adp-time {
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--text-light);
        font-variant-numeric: tabular-nums;
    }
    .adp-track-wrap {
        position: relative;
        height: 4px;
    }
    .adp-track-fill {
        position: absolute;
        left: 0; top: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary), #6366f1);
        border-radius: 999px;
        width: 0%;
        pointer-events: none;
        transition: width 0.4s linear;
        z-index: 1;
    }
    .adp-seek {
        position: absolute;
        left: 0; top: -4px;
        width: 100%;
        height: 12px;
        appearance: none;
        background: var(--border);
        border-radius: 999px;
        cursor: pointer;
        outline: none;
        z-index: 2;
        opacity: 0; /* transparent — track-fill renders visually, this captures input */
    }
    .adp-seek::-webkit-slider-thumb {
        appearance: none;
        width: 14px; height: 14px;
        border-radius: 50%;
        background: var(--primary);
        cursor: pointer;
        opacity: 0;
    }
    .adp-track-wrap:hover .adp-seek        { opacity: 1; }
    .adp-track-wrap:hover .adp-seek::-webkit-slider-thumb { opacity: 1; }
    .adp-track-wrap:hover .adp-track-fill  { opacity: 0; }

    /* Controls row */
    .adp-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    /* Base button */
    .adp-btn {
        width: 36px; height: 36px;
        border-radius: 50%;
        border: none;
        background: transparent;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: background 0.17s, transform 0.12s, color 0.17s;
        color: var(--text-light);
        font-family: inherit;
        outline: none;
        flex-shrink: 0;
    }
    .adp-btn svg { width: 16px; height: 16px; }
    .adp-btn:active { transform: scale(0.91); }

    /* Ghost: subtle hover */
    .adp-btn--ghost:hover {
        background: rgba(37,99,235,0.08);
        color: var(--primary);
    }

    /* Primary: big play/pause */
    .adp-btn--primary {
        width: 48px; height: 48px;
        background: linear-gradient(135deg, var(--primary), #6366f1);
        color: white;
        box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    }
    .adp-btn--primary svg { width: 18px; height: 18px; }
    .adp-btn--primary:hover {
        background: linear-gradient(135deg, #1d4ed8, #4f46e5);
        box-shadow: 0 6px 20px rgba(37,99,235,0.45);
        transform: translateY(-1px) scale(1.04);
    }

    /* Generate mic button */
    .adp-btn--gen {
        color: var(--primary);
        border: 1.5px solid rgba(37,99,235,0.25);
    }
    .adp-btn--gen:hover {
        background: rgba(37,99,235,0.07);
        border-color: var(--primary);
        transform: scale(1.08);
    }
    body.dark-mode .adp-btn--gen { border-color: rgba(99,150,255,0.3); color: #93c5fd; }

    /* Dark mode */
    body.dark-mode .adp-card      { background: rgba(26,32,53,0.85); border-color: rgba(255,255,255,0.07); }
    body.dark-mode .adp-mic-ring  { border-color: #3b82f6; }
    body.dark-mode .adp-track-wrap::before { background: rgba(255,255,255,0.1); }
    body.dark-mode .adp-seek      { background: rgba(255,255,255,0.1); }
    body.dark-mode .adp-status-pill { background: rgba(255,255,255,0.07); }

    /* Responsive */
    @media (max-width: 900px) {
        .adp-wrap { position: static; width: 100%; }
        .adp-controls { justify-content: center; gap: 1rem; }
    }
    /* ── ADP INFO BUTTON + POPUP ────────────────────────────── */
.adp-info-wrap {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: .5rem;
}

.adp-info-btn {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-light);
    font-size: .7rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s;
    line-height: 1;
}
.adp-info-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37,99,235,.08);
}

.adp-info-popup {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .85rem 1rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    z-index: 999;
    animation: fadeSlideUp .18s ease both;
}
.adp-info-popup.show { display: block; }
body.dark-mode .adp-info-popup { background: #1a2035; }

.adp-info-popup h4 {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary);
    margin: 0 0 .55rem;
}
.adp-info-popup ol {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.adp-info-popup ol li {
    font-size: .75rem;
    color: var(--text);
    line-height: 1.5;
}
.adp-info-popup ol li strong { color: var(--primary); }

/* Arrow pointing up toward (i) button */
.adp-info-popup::after {
    content: '';
    position: absolute;
    top: -6px; right: 8px;
    width: 10px; height: 10px;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}
body.dark-mode .adp-info-popup::after { background: #1a2035; }

    .password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
}

.toggle-password:hover {
    color: #2563eb;
}

/* ════════════════════════════════════════════════════════
   HISTORY MODAL — Q&A Session History (doubt.html)
   ════════════════════════════════════════════════════════ */

/* Trigger button */
.btn-history-fab {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .48rem 1.1rem;
    background: linear-gradient(135deg,#1e3a5f,#2563eb);
    color: #fff; border: none; border-radius: 999px;
    font-size: .8rem; font-weight: 700; font-family: inherit;
    cursor: pointer; box-shadow: 0 3px 14px rgba(37,99,235,.28);
    transition: all .18s ease;
    margin-bottom: 1rem;
}
.btn-history-fab:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-history-fab__icon { font-size: 1rem; }

/* Overlay */
.hist-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(15,23,42,.6);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    animation: hist-fadeUp .22s ease both;
}
@keyframes hist-fadeUp {
    from { opacity:0; transform:translateY(18px); }
    to   { opacity:1; transform:none; }
}

/* Modal card */
.hist-modal {
    background: var(--card-bg);
    border-radius: 22px;
    width: 100%; max-width: 700px;
    max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: 0 36px 80px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.06);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Header */
.hist-modal-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.15rem 1.5rem; flex-shrink: 0;
    background: linear-gradient(135deg,#1e3a5f,#2563eb); color: #fff;
}
.hist-modal-hdr-left { display: flex; align-items: center; gap: .9rem; }
.hist-modal-hdr-right { display: flex; align-items: center; gap: 10px; }
.hist-modal-hdr h3 { font-size: 1.02rem; font-weight: 700; margin: 0; color: #fff; }
.hist-modal-sub { font-size: .72rem; opacity: .8; }

.hist-close-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;   /* 🔥 pill style */
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: white;
}

/* Hover effect */
.hist-close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Optional: subtle danger tone */
.hist-close-btn:active {
    transform: scale(0.96);
}

.hist-modal-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}

/* Download PDF button (in header) */
.hist-dl-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .32rem .85rem; border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff; font-size: .75rem; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: background .15s;
}
.hist-dl-btn:hover { background: rgba(255,255,255,.3); }

/* Body scroll */
.hist-modal-body {
    padding: 1.35rem 1.5rem; overflow-y: auto; flex: 1;
}

/* Empty state */
.hist-empty {
    text-align: center; padding: 3rem 1rem; color: var(--text-light);
}
.hist-empty-icon { font-size: 2.4rem; margin-bottom: .75rem; }
.hist-empty p { font-size: .9rem; line-height: 1.6; }

/* Q&A item card */
.hist-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
    transition: box-shadow .15s;
}
.hist-item:hover { box-shadow: 0 4px 16px rgba(37,99,235,.09); }

.hist-item-num {
    display: inline-block;
    font-size: .65rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .1em; color: var(--primary);
    background: rgba(37,99,235,.08);
    border: 1px solid rgba(37,99,235,.15);
    border-radius: 999px; padding: .15rem .65rem;
    margin-bottom: .65rem;
}

.hist-q-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--primary); margin-bottom: .25rem;
}
.hist-q-text {
    font-size: .95rem; font-weight: 600; color: var(--text);
    line-height: 1.45; margin-bottom: .9rem;
}

.hist-divider {
    border: none; border-top: 1px dashed var(--border);
    margin: .75rem 0;
}

.hist-a-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #059669; margin-bottom: .4rem;
}
.hist-a-body {
    font-size: .87rem; color: var(--text); line-height: 1.65;
}
.hist-a-body h1,.hist-a-body h2,.hist-a-body h3 {
    font-size: .93rem; font-weight: 700; margin: .5rem 0 .25rem;
}
.hist-a-body p { margin: .3rem 0; }
.hist-a-body ul,.hist-a-body ol { padding-left: 1.2rem; margin: .3rem 0; }

/* Audio row inside card */
.hist-audio-row {
    display: flex; align-items: center; gap: .65rem;
    margin-top: .9rem; padding: .65rem .9rem;
    background: rgba(37,99,235,.05);
    border: 1px solid rgba(37,99,235,.12);
    border-radius: 10px;
}
.hist-audio-play-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: var(--primary); color: #fff; font-size: .8rem;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: filter .15s;
}
.hist-audio-play-btn:hover { filter: brightness(1.12); }
.hist-audio-play-btn:disabled { background: var(--border); cursor: not-allowed; }
.hist-audio-label { font-size: .78rem; color: var(--text-light); flex: 1; }
.hist-audio-dl {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .7rem; border-radius: 999px;
    background: transparent;
    border: 1px solid var(--border);
    font-size: .72rem; font-weight: 600; color: var(--text-light);
    font-family: inherit; cursor: pointer;
    transition: all .14s;
}
.hist-audio-dl:hover { border-color: var(--primary); color: var(--primary); }

/* Separator between cards */
.hist-card-sep {
    display: flex; align-items: center; gap: .75rem;
    margin: .25rem 0 1rem; color: var(--text-light);
    font-size: .7rem;
}
.hist-card-sep::before,.hist-card-sep::after {
    content:''; flex: 1; height: 1px; background: var(--border);
}

/* Dark mode */
body.dark-mode .hist-item { background: #141929; }
body.dark-mode .hist-audio-row { background: rgba(37,99,235,.08); }
body.dark-mode .hist-modal { background: #1a2035; }
/* Use `scrollbar-color` only in browsers that support it (avoids compatibility warnings)
   WebKit/Blink browsers use the custom scrollbar rules below as a fallback. */
@supports (scrollbar-color: auto) {
    body.dark-mode .hist-modal-body { scrollbar-color: #2563eb #141929; }
}

/* Fallback for browsers that don't support `scrollbar-color` (WebKit/Blink) */
body.dark-mode .hist-modal-body::-webkit-scrollbar { width: 10px; height: 10px; }
body.dark-mode .hist-modal-body::-webkit-scrollbar-track { background: #141929; }
body.dark-mode .hist-modal-body::-webkit-scrollbar-thumb {
    background: #2563eb; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
body.dark-mode .hist-modal-body::-webkit-scrollbar-thumb:hover { background: #1e40af; }

/* No-audio placeholder row */
.hist-no-audio {
    display: flex; align-items: flex-start; gap: .55rem;
    margin-top: .9rem; padding: .65rem .9rem;
    background: rgba(245,158,11,.06);
    border: 1px dashed rgba(245,158,11,.35);
    border-radius: 10px;
    font-size: .8rem; color: #92400e; line-height: 1.5;
}
.hist-no-audio-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.hist-no-audio-msg strong { color: #b45309; }
body.dark-mode .hist-no-audio { background: rgba(245,158,11,.08); color: #fbbf24; }
body.dark-mode .hist-no-audio-msg strong { color: #fcd34d; }

/* Responsive */
@media (max-width: 600px) {
    .hist-modal { border-radius: 14px; }
    .hist-modal-body { padding: 1rem; }
}

/* ============================= */
/* 🧹 CLEAR HISTORY BUTTON */
/* ============================= */

.hist-clear-btn {
    background: #f59e0b; /* amber */
    color: white;
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Hover */
.hist-clear-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Click */
.hist-clear-btn:active {
    transform: scale(0.96);
}

/* Dark mode */
body.dark-mode .hist-clear-btn {
    background: #fbbf24;
    color: #1e293b;
}

.search-container { position: relative; }

#suggestBox {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

#suggestList {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px;
}

#suggestList li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 0.93rem;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}

#suggestList li:hover,
#suggestList li.sg-active {
    background: rgba(37,99,235,0.07);
}

.sg-icon {
    color: var(--text-light);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sg-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode #suggestBox {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

body.dark-mode #suggestList li:hover,
body.dark-mode #suggestList li.sg-active {
    background: rgba(37,99,235,0.15);
}

/* ── Inline Ghost Autocomplete ── */
.suggest-input-wrap {
    position: relative;
    flex: 1;
}

.ghost-input,
.real-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    box-sizing: border-box;
}

.ghost-input {
    color: #adb5bd;
    border-color: transparent;
    pointer-events: none;
    z-index: 1;
    background: white;
}

body.dark-mode .ghost-input {
    background: var(--card-bg);
    color: #475569;
}

.real-input {
    color: var(--text);
    border-color: var(--border);
    z-index: 2;
    background: transparent;
    caret-color: var(--primary);
}

.real-input:focus {
    outline: none;
    border-color: var(--primary);
    background: transparent;
}

/* Make wrap take height from real input */
.suggest-input-wrap {
    height: 58px;
}

/* ── Streaming cursor ── */
.stream-cursor {
    display: inline-block;
    color: var(--primary);
    font-weight: bold;
    animation: cursorBlink 0.7s step-end infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.streaming-body {
    min-height: 40px;
}

.btn-start-module--summary {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
}

/* ── Section headers (Strength / Focus) ── */
.lp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    cursor: default;
    user-select: none;
}

.lp-section-header--strength {
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.2);
    cursor: pointer;
}

.lp-section-header--strength:hover {
    background: rgba(16,185,129,0.12);
}

.lp-section-header--focus {
    background: rgba(37,99,235,0.06);
    border: 1px solid rgba(37,99,235,0.15);
}

.lp-section-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.lp-section-icon { font-size: 1.1rem; }

.lp-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}

.lp-section-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(37,99,235,0.1);
    color: var(--primary);
}

.lp-section-header--strength .lp-section-count {
    background: rgba(16,185,129,0.12);
    color: #059669;
}

.lp-section-chevron {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.25s ease;
}

body.dark-mode .lp-section-header--strength { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }
body.dark-mode .lp-section-header--focus    { background: rgba(37,99,235,0.08);  border-color: rgba(37,99,235,0.2);  }
