/* ==========================================================================
   LEARNFORFREE — ARCHITECTURAL LAYOUT & VISUALIZATION (LAYOUT.CSS)
   ========================================================================== */

main,
.bar,
footer {
    width: 90%;
    max-width: 1180px;
    margin: auto;
}

main {
    animation: fadeSlideUp 0.5s var(--ease) both;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.spread {
    justify-content: space-between;
}

/* ==========================================================================
   1. STUDIO GLASS NAVIGATION BAR WITH SPECTRUM HAIRLINE
   ========================================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 6, 13, 0.82);
    backdrop-filter: blur(26px) saturate(190%);
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    box-shadow: 0 12px 42px rgba(2, 2, 8, 0.65);
}

header::after {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(99, 102, 241, 0.5) 28%,
        rgba(168, 85, 247, 0.6) 50%,
        rgba(56, 189, 248, 0.45) 72%,
        transparent 100%
    );
}

.bar {
    padding: 13px 0;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 4px 0;
    color: #ffffff;
    font-family: Bricolage, sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand:hover {
    color: var(--lavender);
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.48);
    transition: transform 0.24s var(--ease-spring), box-shadow 0.24s var(--ease);
}

.brand:hover img {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 8px 28px rgba(168, 85, 247, 0.65);
}

header .row,
header nav {
    gap: 8px;
}

header a:not(.brand):not(.button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: -0.01em;
}

header a:not(.brand):not(.button):hover {
    color: #ffffff;
    background-color: rgba(139, 92, 246, 0.18);
    border-color: rgba(167, 139, 250, 0.42);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.24);
}

header a:not(.brand):not(.button)[aria-current] {
    color: #ffffff;
    background-color: rgba(139, 92, 246, 0.26);
    border-color: rgba(167, 139, 250, 0.52);
    font-weight: 700;
}

header .button,
header button {
    padding: 8px 18px;
    font-size: 0.92rem;
    border-radius: 10px;
    margin-left: 2px;
}

header form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

/* ==========================================================================
   2. FOOTER
   ========================================================================== */
footer {
    margin-top: 96px;
    padding: 32px 0 48px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   3. HERO STAGE WITH ORBITAL GLOW & FLOATING ILLUSTRATION
   ========================================================================== */
.feature {
    position: relative;
    padding: 84px 0 76px;
    justify-content: space-between;
    gap: 48px;
}

/* Dual-layer indigo/cyan aura ring behind the book */
.feature::before {
    content: "";
    position: absolute;
    right: 5%;
    top: 16%;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 1px dashed rgba(167, 139, 250, 0.22);
    box-shadow: inset 0 0 60px rgba(99, 102, 241, 0.12);
    pointer-events: none;
    z-index: -1;
}

.feature::after {
    content: "";
    position: absolute;
    right: 1%;
    top: 10%;
    width: 46%;
    height: 80%;
    border-radius: 999px;
    background: radial-gradient(
        circle,
        rgba(139, 92, 246, 0.28) 0%,
        rgba(99, 102, 241, 0.14) 42%,
        rgba(56, 189, 248, 0.06) 62%,
        transparent 75%
    );
    filter: blur(32px);
    pointer-events: none;
    z-index: -1;
    animation: auraPulse 6s ease-in-out infinite;
}

.intro {
    width: 53%;
}

.book {
    width: 42%;
    height: auto;
    border: 0 !important;
    outline: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    mix-blend-mode: lighten;
    filter:
        drop-shadow(0 28px 50px rgba(99, 102, 241, 0.32))
        drop-shadow(0 14px 26px rgba(0, 0, 0, 0.65));
    animation: bookFloat 5.5s ease-in-out infinite;
    transition: filter 0.3s var(--ease);
}

.book:hover {
    filter:
        drop-shadow(0 36px 62px rgba(168, 85, 247, 0.44))
        drop-shadow(0 18px 32px rgba(56, 189, 248, 0.25));
}

.intro h1 {
    font-size: clamp(2.95rem, 2.1rem + 3.2vw, 4.75rem);
    line-height: 0.97;
    letter-spacing: -0.04em;
}

.intro em {
    font-style: normal;
    background: linear-gradient(120deg, #818cf8 0%, #c084fc 35%, #38bdf8 70%, #818cf8 100%);
    background-size: 220% 220%;
    animation: gradientShift 7s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro p {
    margin: 24px 0 34px;
    max-width: 530px;
    font-size: 1.13rem;
    line-height: 1.72;
    color: var(--text-secondary);
}

.intro a:not(.button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1.48rem;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: var(--highlight-top), var(--shadow-sm);
}

.intro a:not(.button):hover {
    background: var(--surface-3);
    border-color: var(--lavender);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--highlight-top), var(--shadow-md);
}

/* ==========================================================================
   4. COURSE CATALOG & ILLUMINATED CARDS
   ========================================================================== */
.catalog,
.inner {
    padding-top: 48px;
}

.catalog {
    border-top: 1px solid var(--line);
}

.card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(22, 24, 44, 0.82) 0%, var(--surface-1) 100%);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--highlight-top), var(--shadow-sm);
    transition:
        transform 0.22s var(--ease),
        border-color 0.22s var(--ease),
        background 0.22s var(--ease),
        box-shadow 0.22s var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(167, 139, 250, 0.5);
    background: linear-gradient(180deg, #1c1f3b 0%, var(--surface-2) 100%);
    box-shadow: var(--highlight-strong), 0 20px 46px rgba(4, 4, 16, 0.74), 0 0 28px rgba(99, 102, 241, 0.14);
}

.card:hover h3 {
    color: var(--lavender-bright);
}

.card h3 {
    margin-bottom: 0.3rem;
    transition: color 0.18s var(--ease);
}

.card p {
    margin: 0;
}

.cover {
    padding: 15px 20px;
    border: 1px solid rgba(167, 139, 250, 0.34);
    border-radius: 12px;
    background: linear-gradient(145deg, #2b275c, #171636);
    color: var(--lavender);
    font-family: Bricolage, sans-serif;
    font-weight: 800;
    text-align: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 16px rgba(99, 102, 241, 0.26);
    transition: transform 0.22s var(--ease-spring), border-color 0.22s var(--ease), color 0.22s var(--ease);
}

.card:hover .cover {
    transform: scale(1.06) rotate(-2deg);
    border-color: var(--cyan);
    color: #ffffff;
}

.meta {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.18), rgba(99, 102, 241, 0.12));
    border: 1px solid rgba(167, 139, 250, 0.28);
    color: var(--lavender);
    font-size: 0.84rem;
    font-weight: 650;
    white-space: nowrap;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.card:hover .meta {
    border-color: rgba(56, 189, 248, 0.45);
    color: #ffffff;
}

.search {
    display: flex;
    align-items: stretch;
    gap: 10px;
    max-width: 500px;
    margin-bottom: 30px;
}

.search input {
    margin-top: 0;
    margin-bottom: 0;
}

/* ==========================================================================
   5. LESSON READER, UNITS & AUTH PANELS
   ========================================================================== */
.unit,
.paper,
.outline {
    position: relative;
    min-width: 0;
    padding: 34px 38px;
    margin: 24px 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(16, 18, 34, 0.88) 0%, var(--surface-1) 100%);
    box-shadow: var(--highlight-top), var(--shadow-sm);
}

.paper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--indigo), var(--orchid), var(--cyan), transparent);
    opacity: 0.65;
}

.auth,
.reading {
    margin: 56px auto;
}

.auth {
    max-width: 460px;
    padding: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: linear-gradient(180deg, #15172b 0%, var(--surface-1) 100%);
    box-shadow: var(--highlight-strong), var(--shadow-md);
}

.reading {
    max-width: 780px;
}

.reader {
    align-items: flex-start;
    gap: 28px;
}

.reader .outline {
    width: 31%;
    padding: 24px;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.reader .paper {
    flex: 1;
}

.outline .unit {
    padding: 0;
    margin: 12px 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.outline a {
    display: block;
    padding: 7px 11px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--text-secondary);
}

.outline a:hover {
    background-color: rgba(139, 92, 246, 0.14);
    color: #ffffff;
}

.outline a[aria-current] {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.24), rgba(168, 85, 247, 0.16));
    border-left: 2px solid var(--cyan);
    color: #ffffff;
    font-weight: 700;
}

.prose,
.example {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.prose {
    color: var(--text);
    font-size: 1.06rem;
    line-height: 1.82;
}

.example {
    margin: 26px 0;
    padding: 18px 22px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-left: 3px solid var(--cyan);
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    color: #e0f2fe;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

li,
.review {
    padding: 8px 0;
}

small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   6. TABS, QUIZZES & LIVE CLASSROOM POLLS
   ========================================================================== */
.tabs,
.extras {
    margin: 24px 0;
}

.tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    background-color: var(--surface-1);
    border: 1px solid var(--line);
}

.tabs a {
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text-muted);
}

.tabs a:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.tabs a[aria-current] {
    background-color: rgba(139, 92, 246, 0.24);
    color: var(--lavender-bright);
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.4);
}

.editor,
.unit form {
    max-width: 740px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.option-row input[type="text"],
.option-row input:not([type="radio"]) {
    margin-top: 0;
    margin-bottom: 0;
}

.answer-key {
    white-space: nowrap;
    font-weight: 750;
    color: var(--lavender);
}

.score,
.match {
    padding: 20px 24px;
    border-radius: 14px;
    border: 1px solid rgba(52, 211, 153, 0.34);
    background: radial-gradient(circle at 0% 50%, rgba(52, 211, 153, 0.16), rgba(52, 211, 153, 0.06));
}

.score {
    margin: 24px 0;
}

.score b {
    display: block;
    font-family: Bricolage, sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--green);
    text-shadow: 0 0 24px rgba(52, 211, 153, 0.35);
}

.match {
    margin: 12px 0;
}

.match b {
    display: block;
    margin-bottom: 4px;
}

.match.no {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.38);
    background: radial-gradient(circle at 0% 50%, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.06));
}

.live-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.38);
    color: var(--lavender-bright);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.poll-row span {
    color: var(--lavender);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.ballot {
    width: 100%;
    margin: 10px 0;
    padding: 15px 18px;
    justify-content: flex-start;
    text-align: left;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line-strong);
    box-shadow: var(--highlight-top);
}

.ballot:hover {
    background: var(--surface-3);
    border-color: var(--violet);
    color: #ffffff;
}

.poll-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.poll-row:last-child {
    border-bottom: 0;
}

/* ==========================================================================
   7. RESPONSIVE MOBILE & SPLIT-SCREEN ADJUSTMENTS
   ========================================================================== */
@media (max-width: 840px) {
    main,
    .bar,
    footer {
        width: 92%;
    }

    .feature::before {
        display: none;
    }

    .feature::after {
        width: 82%;
        right: 9%;
        top: 45%;
    }

    .intro,
    .book,
    .reader .outline,
    .reader .paper {
        width: 100%;
    }

    .reader .outline {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .reader .paper {
        flex: auto;
    }

    .feature {
        padding: 44px 0;
    }

    .unit,
    .paper,
    .outline,
    .auth {
        padding: 22px;
    }

    .card {
        flex-wrap: wrap;
        padding: 18px;
    }

    .meta {
        margin-left: 0;
    }
}
