:root {
    /* Premium Color Palette Based on User Reference */
    --primary: #5a80f0;
    --primary-hover: #486ce0;
    --primary-light: rgba(90, 128, 240, 0.15);
    
    /* True Dark Elegant Theme */
    --bg-color: #1a1e2f;
    --surface-color: #212436;
    --text-main: #ffffff;
    --text-muted: #9ba1b4;
    --text-secondary: #c9cedc;
    --border-color: #2f3448;
    --input-bg: #141624;
    
    /* Layout & Styling */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
    /* Ensure dark theme remains consistent if toggled */
    --primary: #5a80f0;
    --primary-hover: #486ce0;
    --primary-light: rgba(90, 128, 240, 0.15);
    --bg-color: #1a1e2f;
    --surface-color: #212436;
    --text-main: #ffffff;
    --text-muted: #9ba1b4;
    --border-color: #2f3448;
    --input-bg: #141624;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color var(--transition), color var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= Navbar ================= */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition), border-color var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
}

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

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
    background-color: var(--bg-color);
}

.nav-signin {
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.nav-signin:hover {
    color: var(--primary);
}

/* ================= View Controller ================= */
.view {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    flex: 1;
}

.view.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ================= Buttons & Inputs ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-outline:hover {
    background-color: var(--bg-color);
    border-color: var(--text-muted);
}

.btn-block {
    width: 100%;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ================= Landing View ================= */
#landing-view {
    background: radial-gradient(circle at 85% 15%, var(--primary-light) 0%, transparent 40%),
                radial-gradient(circle at 15% 85%, var(--primary-light) 0%, transparent 40%);
}

.landing-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    flex: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.join-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 3rem;
    max-width: 480px;
}

.join-box input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.join-btn {
    border-radius: var(--radius-md);
    padding: 0 1.75rem;
}

.features-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Auth Card */
.auth-box {
    display: flex;
    justify-content: flex-end;
}

.auth-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    transition: var(--transition);
}

.auth-tabs {
    display: flex;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background-color: var(--surface-color);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ================= Classroom View ================= */
.classroom-container {
    width: 98%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    flex: 1;
}

.module {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.classroom-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.classroom-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.classroom-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.status-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dot-separator {
    font-size: 1rem;
    line-height: 1;
}

.text-size-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.video-captions-area {
    flex: 1;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 3rem 4rem;
    overflow-y: auto;
    background-color: var(--bg-color);
}

/* Custom Scrollbar for Captions */
.video-captions-area::-webkit-scrollbar {
    width: 8px;
}
.video-captions-area::-webkit-scrollbar-track {
    background: transparent;
}
.video-captions-area::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
}

.captions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.captions-list p {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-main);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.live-partial {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1rem;
    font-style: italic;
    animation: pulseText 2s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.placeholder-text {
    margin: auto;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.25rem;
    transition: opacity 0.4s ease, height 0.4s ease;
}

.hidden-placeholder {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0 !important;
    pointer-events: none;
}

/* Q&A Sidebar */
.qa-sidebar {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    position: sticky;
    top: 80px;
}

.qa-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qa-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.qa-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.active-count {
    background-color: var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.qa-feed {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Custom Scrollbar for QA feed */
.qa-feed::-webkit-scrollbar {
    width: 6px;
}
.qa-feed::-webkit-scrollbar-track {
    background: transparent;
}
.qa-feed::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
}

.message-row {
    display: flex;
    width: 100%;
}

.row-own {
    justify-content: flex-end;
}

.row-other {
    justify-content: flex-start;
}

.qa-message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    animation: slideInUp 0.3s ease forwards;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.msg-own {
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.msg-other {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 0;
    box-shadow: var(--shadow-sm);
}

.qa-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
}

.msg-own .qa-author,
.msg-own .qa-time {
    color: rgba(255, 255, 255, 0.8);
}

.msg-other .qa-author,
.msg-other .qa-time {
    color: var(--text-muted);
}

.qa-author {
    font-weight: 500;
}

.qa-message p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.msg-own p {
    color: white;
}

.msg-other p {
    color: var(--text-main);
}

.qa-input-area {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.qa-textarea {
    min-height: 80px;
    resize: none;
    margin-bottom: 1rem;
}

.qa-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 20px;
    transition: var(--transition);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.submit-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    opacity: 0.6;
    pointer-events: none;
    transition: var(--transition);
}

.submit-btn.active {
    opacity: 1;
    pointer-events: auto;
}

/* ================= Footer ================= */
.bottom-bar {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid transparent;
}

/* ================= Product Landing Sections ================= */
.scrollable-view {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: 100%;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

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

section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* --- Hero --- */
.section-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 85% 15%, var(--primary-light) 0%, transparent 40%),
                radial-gradient(circle at 15% 85%, var(--primary-light) 0%, transparent 40%);
    position: relative;
    overflow: hidden;
}

.display-title {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.section-hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 50%;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* --- Who We Are --- */
.section-who {
    background-color: var(--surface-color);
}

.who-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.who-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.who-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-card:last-child {
    grid-column: span 2;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* --- Intro/Features --- */
.section-intro {
    background-color: var(--bg-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: left;
    transition: transform 0.3s ease;
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- Pricing (Dark Theme UI) --- */
.section-pricing {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.section-pricing .section-title {
    color: var(--text-main);
}

.section-pricing .section-subtitle {
    color: var(--text-muted);
}

.pricing-header {
    text-align: left;
    margin-bottom: 3rem;
    position: relative;
}

.pricing-toggle-wrap {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    padding: 0.25rem;
    display: flex;
}

.pricing-toggle {
    background: transparent;
    border: none;
    padding: 0.5rem 1.5rem;
    color: #a1a1aa;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.pricing-toggle.active {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.price-card {
    background: rgba(20, 20, 20, 0.6) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-popular {
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.save-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #000;
    color: #fff;
    padding: 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    z-index: 10;
}

.card-art {
    height: 180px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #fff;
}

.plan-desc {
    font-size: 0.9rem;
    color: #a1a1aa;
    margin-bottom: 1.5rem;
    min-height: 45px;
}

.price {
    margin-bottom: 1.5rem;
}

.price span:first-child {
    font-size: 2.5rem;
    font-weight: 600;
}

.price .period {
    color: #a1a1aa;
    font-size: 0.9rem;
}

.btn-upgrade {
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    margin-bottom: 2rem;
}

.btn-upgrade:hover {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
}

.popular-btn:hover {
    opacity: 0.9;
}

.plan-section {
    margin-bottom: 1.5rem;
}

.plan-section h4 {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.plan-section ul {
    list-style: none;
}

.plan-section li {
    font-size: 0.85rem;
    color: #a1a1aa;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plan-section li svg {
    color: #fff;
}

/* --- Demo (Original Landing UI) --- */
.section-demo {
    padding: 6rem 0;
    background-color: var(--surface-color);
}


/* Responsive Design */
@media (max-width: 1024px) {
    .landing-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin: 2rem auto;
    }
    
    .hero {
        text-align: center;
    }
    
    .join-box {
        margin: 0 auto 2rem;
    }
    
    .features-badges {
        justify-content: center;
    }
    
    .auth-box {
        justify-content: center;
    }
    
    .classroom-container {
        grid-template-columns: 1fr;
    }
    
    .qa-sidebar {
        height: 500px;
        position: static;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .who-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card:last-child {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    .hero-title, .display-title {
        font-size: 2.5rem;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .who-stats {
        grid-template-columns: 1fr;
    }
}

