/* =========================================================
   LOGIC TUTOR - Light Theme with Vibrant Colors
   Colors: Pink, Yellow, Blue, Cyan, Purple, Red
   Background: White/Light
   ========================================================= */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
    /* Brand Colors - Vibrant & Bright */
    --pink:         #e91e8c;
    --pink-light:   #f06abd;
    --pink-soft:    #fce4f3;

    --yellow:       #ffe033;
    --yellow-dark:  #d4a000;
    --yellow-light: #fff3b0;
    --yellow-soft:  #fffae0;

    --blue:         #1a73e8;
    --blue-light:   #5ba3ff;
    --blue-soft:    #deeaff;

    --cyan:         #00b4d8;
    --cyan-dark:    #0077b6;
    --cyan-soft:    #d0f4fc;

    --purple:       #7c3aed;
    --purple-light: #a78bfa;
    --purple-soft:  #ede9fe;

    --red:          #e53e3e;
    --red-light:    #fc8181;
    --red-soft:     #ffe5e5;

    --indigo:       #4f46e5;
    --indigo-soft:  #e0e7ff;

    --green:        #16a34a;
    --green-soft:   #dcfce7;

    /* Neutral - Light Theme */
    --white:        #ffffff;
    --bg-main:      #f5f7ff;
    --bg-card:      #ffffff;
    --bg-sidebar:   #1e1b4b;

    /* Typography */
    --text-primary:  #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted:    #7878a0;
    --text-white:    #ffffff;

    /* Borders & Shadows */
    --border-color:  #e5e7f0;
    --border-radius: 16px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.10);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);

    /* Gradients */
    --grad-primary:  linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
    --grad-pink:     linear-gradient(135deg, var(--pink) 0%, #ff8a65 100%);
    --grad-cyan:     linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
    --grad-warm:     linear-gradient(135deg, var(--yellow) 0%, var(--pink) 100%);
    --grad-hero:     linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #e91e8c 100%);
    --grad-sidebar:  linear-gradient(180deg, #1e1b4b 0%, #2d2264 100%);

    /* Primary alias */
    --primary: var(--blue);
    --primary-dark: #1557b0;

    --font-main: 'Outfit', 'Sarabun', sans-serif;
    --sidebar-width: 260px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body.login-mode {
    background: #f0f4ff;
    overflow: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { padding-left: 20px; }
ul li, ol li { margin-bottom: 6px; }
hr { border: none; border-top: 1.5px solid var(--border-color); margin: 24px 0; }
h1, h2, h3, h4, h5 { line-height: 1.35; }
p { color: var(--text-secondary); line-height: 1.7; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-yellow { color: var(--yellow-dark); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-pink { color: var(--pink); }
.text-blue { color: var(--blue); }
.font-medium { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.ml-3 { margin-left: 12px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.p-4 { padding: 16px; }
.rounded-lg { border-radius: 12px; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4ff 0%, #fce4f3 40%, #e8f4fd 100%);
}

/* Animated background blobs */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: blobFloat 8s ease-in-out infinite alternate;
    pointer-events: none;
}
.blob-1 { width: 400px; height: 400px; background: var(--pink-soft); top: -100px; left: -100px; animation-delay: 0s; }
.blob-2 { width: 300px; height: 300px; background: var(--blue-soft); bottom: -80px; right: -60px; animation-delay: -3s; }
.blob-3 { width: 250px; height: 250px; background: var(--yellow-light); top: 30%; right: 25%; animation-delay: -5s; }
.blob-4 { width: 200px; height: 200px; background: var(--purple-soft); bottom: 20%; left: 25%; animation-delay: -2s; }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, -30px) scale(1.08); }
}

.login-container {
    display: flex;
    width: min(920px, 95vw);
    min-height: 560px;
    background: var(--white);
    border-radius: 28px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124,58,237,0.06);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* ---- Left panel ---- */
.login-left {
    flex: 0 0 380px;
    background: var(--grad-hero);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 8px;
    backdrop-filter: blur(10px);
}

.logo-symbol {
    font-family: 'Outfit', 'Georgia', serif;
    font-size: 22px;
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    line-height: 1;
    font-style: italic;
}

/* Sidebar logo-icon uses logo-symbol too */
.logo-icon .logo-symbol {
    font-size: 18px;
    color: white;
}

.brand-name {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
}
.brand-name span { color: var(--yellow); }

.brand-tag {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
}

/* Feature list on left panel */
.login-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.12);
    padding: 12px 16px;
    border-radius: 14px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.18);
}

.feat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.feature-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: white;
}
.feature-item p {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    margin: 0;
    line-height: 1.4;
}

/* Decorative circles */
.login-deco-circles { position: absolute; bottom: 0; right: 0; opacity: 0.15; pointer-events: none; }
.deco-c { border-radius: 50%; border: 2px solid white; position: absolute; }
.c1 { width: 150px; height: 150px; bottom: -50px; right: -50px; }
.c2 { width: 90px; height: 90px; bottom: 30px; right: 20px; }
.c3 { width: 50px; height: 50px; bottom: 60px; right: 80px; }

/* ---- Right panel (form) ---- */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 44px;
    background: var(--white);
}

.login-form-wrapper {
    width: 100%;
    max-width: 360px;
}

.login-header {
    margin-bottom: 32px;
}
.login-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.login-header p {
    font-size: 13.5px;
    color: var(--text-muted);
}

/* Form elements */
.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}
.form-group label i { margin-right: 6px; color: var(--blue); }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 48px 13px 18px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-main);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.13);
}

.input-wrapper input::placeholder { color: #c0c0d0; }

.input-icon {
    position: absolute;
    right: 14px;
    font-size: 15px;
    color: #c0c0d0;
    pointer-events: none;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 15px;
    padding: 4px;
    transition: color 0.2s;
}
.toggle-password-btn:hover { color: var(--blue); }

.hint-text {
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-muted);
}
.hint-text strong { color: var(--blue); }

/* Error box */
.login-error {
    background: var(--red-soft);
    border: 1.5px solid var(--red-light);
    color: var(--red);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shakeError 0.3s ease;
}
@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px 20px;
    background: var(--grad-primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 6px 20px rgba(26,115,232,0.30);
    letter-spacing: 0.2px;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26,115,232,0.38);
    opacity: 0.93;
}
.btn-login:active { transform: translateY(0); }

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 12px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Guest button */
.btn-guest {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    margin-bottom: 20px;
}
.btn-guest:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: var(--purple-soft);
}

.login-note {
    font-size: 11.5px;
    color: #aaa;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.login-note i { margin-top: 2px; }

/* =========================================================
   MAIN APP LAYOUT
   ========================================================= */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-main);
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--grad-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--grad-warm);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.logo-text h2 {
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
}
.logo-text h2 span { color: var(--yellow); }
.logo-text p {
    font-size: 10.5px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

/* Navigation */
.nav-menu { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
    padding: 12px 10px 6px;
    margin-top: 8px;
}

.nav-group-header {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    padding: 10px 10px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.nav-sub-list { display: flex; flex-direction: column; gap: 2px; padding-left: 6px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.70);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.10);
    color: white;
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    font-weight: 700;
}

.nav-item.sub-item {
    font-size: 12.5px;
    padding: 7px 12px;
    gap: 8px;
}

.lesson-num {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.12);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.07);
    padding: 10px 12px;
    border-radius: 13px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--grad-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-rank { font-size: 11px; color: rgba(255,255,255,0.5); }

.logout-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.6);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}
.logout-btn:hover { background: var(--red-soft); color: var(--red); }

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---------- Header ---------- */
.main-header {
    background: var(--white);
    padding: 0 32px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.main-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
    display: none;
    padding: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-badge {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-primary);
}

.xp-badge { border-color: var(--yellow); background: var(--yellow-soft); }
.xp-badge .text-yellow { color: var(--yellow-dark); }

.header-user-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--grad-primary);
    color: white;
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* =========================================================
   CONTENT WRAPPER & VIEWS
   ========================================================= */
.content-wrapper {
    padding: 32px;
    flex: 1;
}

.view-section { display: none; animation: fadeInUp 0.35s ease; }
.view-section.active { display: block; }

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

/* =========================================================
   DASHBOARD
   ========================================================= */

/* Hero Banner */
.hero-card {
    background: var(--grad-hero);
    border-radius: var(--border-radius);
    padding: 36px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(79,70,229,0.30);
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 65%; }
.hero-content h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; color: white; }
.hero-content p { color: rgba(255,255,255,0.82); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.hero-graphic {
    font-size: 90px;
    opacity: 0.15;
    position: relative;
    z-index: 1;
    animation: rotateSlow 20s linear infinite;
}
@keyframes rotateSlow { to { transform: rotate(360deg); } }

.section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--blue-light);
}

.lesson-status-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.lesson-status-tag.locked { background: #f0f0f8; color: #a0a0c0; border: 1px solid #e0e0f0; }
.lesson-status-tag.in-progress { background: var(--yellow-soft); color: var(--yellow-dark); border: 1px solid var(--yellow); }
.lesson-status-tag.completed { background: var(--green-soft); color: var(--green); border: 1px solid #a3f0be; }

.lesson-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.lesson-card h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.lesson-card p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 0.2px;
}
.badge-pink { background: var(--pink-soft); color: var(--pink); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-cyan { background: var(--cyan-soft); color: var(--cyan-dark); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow-dark); border: 1px solid var(--yellow); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(26,115,232,0.28);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(26,115,232,0.38);
    opacity: 0.92;
}

.btn-outline-primary {
    background: transparent;
    color: var(--blue);
    border-color: var(--blue);
}
.btn-outline-primary:hover {
    background: var(--blue-soft);
    transform: translateY(-1px);
}

.btn-outline-danger {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}
.btn-outline-danger:hover { background: var(--red-soft); }

.btn-outline-success {
    background: transparent;
    color: var(--green);
    border-color: var(--green);
}
.btn-outline-success:hover { background: var(--green-soft); }

.btn-success {
    background: var(--green);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(22,163,74,0.25);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22,163,74,0.35); }

.btn-danger { background: var(--red); color: white; border-color: transparent; }
.btn-sm { padding: 7px 16px; font-size: 12.5px; border-radius: 10px; }

.btn-sm.btn-success { background: var(--green); color: white; border: none; }
.btn-sm.btn-danger { background: var(--red); color: white; border: none; }

/* =========================================================
   GLASS PANEL
   ========================================================= */
.glass-panel {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 32px;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.glass-panel h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.lesson-intro {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.7;
}

/* =========================================================
   THEORY BLOCKS & LESSON CONTENT
   ========================================================= */
.theory-block {
    background: var(--bg-main);
    border-left: 4px solid var(--blue);
    border-radius: 0 12px 12px 0;
    padding: 18px 22px;
    margin-bottom: 20px;
}
.theory-block h3 {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.theory-block h4 { font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin: 12px 0 6px; }
.theory-block p { font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); }
.theory-block ul, .theory-block ol { font-size: 13.5px; color: var(--text-secondary); }

.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.theory-block.card-style {
    border-left: none;
    border-radius: 14px;
    padding: 18px 20px;
}
.logic-formula {
    display: inline-block;
    margin-top: 8px;
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
}

/* Concept Columns */
.concept-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.concept-card {
    border-radius: 14px;
    padding: 18px 20px;
    border: 1.5px solid;
}
.true-concept { background: var(--green-soft); border-color: #a7f3c8; }
.true-concept h4 { color: var(--green); }
.false-concept { background: var(--red-soft); border-color: var(--red-light); }
.false-concept h4 { color: var(--red); }
.concept-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 10px; }
.concept-card .desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-style: italic; }
.concept-card ul { font-size: 13px; color: var(--text-secondary); }

/* Formula list (lesson 4) */
.formula-list { display: flex; flex-direction: column; gap: 10px; }
.formula-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    flex-wrap: wrap;
}
.form-left, .form-right { font-weight: 700; color: var(--blue); }
.form-eq { font-size: 18px; font-weight: 900; color: var(--purple); }
.form-desc { font-size: 12px; color: var(--text-muted); flex: 1; min-width: 120px; }

/* Quantifier Grid (lesson 7) */
.quantifier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quantifier-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.quantifier-card p { font-size: 13px; line-height: 1.6; }

/* =========================================================
   INTERACTIVE WIDGETS
   ========================================================= */
.interactive-widget {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 22px 24px;
    margin-bottom: 22px;
}
.interactive-widget h3 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.interactive-widget p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.widget-box {
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
}
.widget-question {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.widget-options { display: flex; gap: 12px; flex-wrap: wrap; }
.widget-btn { font-size: 13px !important; }
.widget-feedback {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.widget-feedback.correct { background: var(--green-soft); color: var(--green); border: 1px solid #a7f3c8; }
.widget-feedback.wrong { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-light); }

/* Connective Simulator */
.simulator-box { background: white; border: 1.5px solid var(--border-color); border-radius: 14px; padding: 20px; }
.sim-controls { display: flex; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 10px; }
.control-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.toggle-buttons { display: flex; gap: 6px; }

.sim-results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sim-result-card {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.sim-expression { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.sim-output {
    font-size: 22px;
    font-weight: 900;
    font-family: 'Outfit', monospace;
}
.sim-output.val-T { color: var(--green); }
.sim-output.val-F { color: var(--red); }

/* Interactive Truth Table */
.table-responsive { overflow-x: auto; }
.truth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.truth-table th {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-weight: 800;
    padding: 10px 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 12.5px;
}
.truth-table td {
    padding: 9px 16px;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}
.truth-table tbody tr:nth-child(even) { background: #fafbff; }
.truth-table tbody tr:hover { background: var(--blue-soft); }

.truth-table td.val-T { color: var(--green); font-weight: 800; }
.truth-table td.val-F { color: var(--red); font-weight: 800; }
.truth-table th:last-child { background: var(--purple-soft); color: var(--purple); }

.table-select-val {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 4px 8px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-main);
    cursor: pointer;
    transition: border-color 0.2s;
}
.table-select-val:focus { outline: none; border-color: var(--blue); }
.table-select-val.correct { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.table-select-val.wrong { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.feedback-span { font-size: 13px; font-weight: 700; }

/* Lesson Navigation */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

/* =========================================================
   PRACTICE VIEW
   ========================================================= */
.practice-topics-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.practice-topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 16px;
}
.practice-topic-item:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-sm);
}
.topic-info h4 { font-size: 14px; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.topic-info p { font-size: 12px; color: var(--text-muted); margin: 0; }

/* =========================================================
   QUIZ
   ========================================================= */
.quiz-progress-bar-container { margin-bottom: 20px; }
.quiz-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.quiz-tag {
    font-size: 12px;
    font-weight: 700;
    background: var(--blue-soft);
    color: var(--blue);
    padding: 4px 14px;
    border-radius: 20px;
}
.quiz-q-num { font-size: 13px; font-weight: 700; color: var(--text-muted); }

.progress-bar-bg { height: 8px; background: var(--bg-main); border-radius: 20px; overflow: hidden; border: 1px solid var(--border-color); }
.progress-bar-fill { height: 100%; background: var(--grad-primary); border-radius: 20px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

.question-container { margin: 20px 0; }
.question-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    background: var(--purple-soft);
    color: var(--purple);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.question-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.quiz-options-list { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 13px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.quiz-option:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.quiz-option.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.quiz-option.correct { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.quiz-option.wrong { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.quiz-option:disabled { cursor: not-allowed; opacity: 0.8; }

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: white;
    border: 1.5px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.feedback-card {
    margin-top: 16px;
    padding: 18px 22px;
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border: 2px solid;
}
.feedback-card.correct { background: var(--green-soft); border-color: #a7f3c8; }
.feedback-card.wrong { background: var(--red-soft); border-color: var(--red-light); }

.feedback-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.feedback-card.correct .feedback-icon { color: var(--green); }
.feedback-card.wrong .feedback-icon { color: var(--red); }
.feedback-content h4 { font-size: 15px; font-weight: 800; margin-bottom: 4px; color: var(--text-primary); }
.feedback-content p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

.quiz-controls-area { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* =========================================================
   QUIZ RESULT & CHART
   ========================================================= */
.circular-chart { width: 140px; height: 140px; }
.circle-bg { fill: none; stroke: var(--border-color); stroke-width: 3.5; }
.circle { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.percentage { fill: var(--text-primary); font-family: var(--font-main); font-size: 5px; font-weight: 800; text-anchor: middle; }

/* =========================================================
   SANDBOX
   ========================================================= */
.sandbox-input-area { margin-bottom: 20px; }
.formula-input-wrapper { margin-bottom: 14px; }
.formula-input-wrapper label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; }
.input-row { display: flex; gap: 12px; }
.input-row input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Outfit', monospace;
    font-size: 15px;
    background: var(--bg-main);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.input-row input:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 3px rgba(26,115,232,0.12); }

.keypad { margin-top: 12px; }
.keypad-label { font-size: 12px; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 10px; }
.keys-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.key-btn {
    background: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 7px 16px;
    font-family: 'Outfit', monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-primary);
}
.key-btn:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.btn-clear-text { color: var(--red); border-color: var(--red-light); }
.btn-clear-text:hover { background: var(--red-soft); }

.sandbox-results { margin-top: 8px; }
.result-header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.result-header-row h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.formula-span { color: var(--blue); font-weight: 800; }

#tautology-status-badge { font-size: 12px; font-weight: 700; padding: 6px 16px; border-radius: 20px; }
#tautology-status-badge.is-tautology { background: var(--green-soft); color: var(--green); border: 1px solid #a7f3c8; }
#tautology-status-badge.not-tautology { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-light); }

/* =========================================================
   MATH EXPRESSION STYLES
   ========================================================= */
.math-expr {
    font-family: 'Outfit', 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.93em;
    background: var(--yellow-soft);
    color: var(--text-primary);
    padding: 1px 7px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid #ffe59a;
}
.math-var {
    font-style: italic;
    font-weight: 700;
    color: var(--purple);
    font-family: 'Outfit', 'Georgia', serif;
}

/* =========================================================
   START FIRST LESSON BTN
   ========================================================= */
.start-first-lesson-btn {
    background: white;
    color: var(--blue);
    border: 2px solid white;
    font-weight: 800;
}
.start-first-lesson-btn:hover {
    background: var(--yellow);
    color: var(--text-primary);
    border-color: var(--yellow);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,224,51,0.5);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-260px); width: 260px; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle-btn { display: flex; }
    .concept-columns { grid-template-columns: 1fr; }
    .sim-results { grid-template-columns: repeat(2, 1fr); }
    .content-wrapper { padding: 20px 16px; }
    .hero-card { flex-direction: column; gap: 16px; }
    .hero-content { max-width: 100%; }
    .hero-graphic { font-size: 60px; }
    .lessons-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .login-container { flex-direction: column; min-height: auto; }
    .login-left { flex: none; padding: 32px 28px; }
    .login-right { padding: 32px 24px; }
    .main-header { padding: 0 16px; height: 60px; }
    .main-header h1 { font-size: 15px; }
    .header-user-chip { display: none; }
    .input-row { flex-direction: column; }
    .quiz-controls-area { flex-wrap: wrap; }
    .glass-panel { padding: 20px 18px; }
    .theory-grid { grid-template-columns: 1fr; }
    .quantifier-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   LEADERBOARD
   ========================================================= */
.lb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    transition: box-shadow 0.18s;
}
.lb-row:hover { box-shadow: var(--shadow-sm); }

.lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.lb-rank.gold   { background: #fef9c3; color: #b45309; border: 2px solid #fbbf24; }
.lb-rank.silver { background: #f3f4f6; color: #6b7280; border: 2px solid #d1d5db; }
.lb-rank.bronze { background: #fef3c7; color: #92400e; border: 2px solid #d97706; }

.lb-name { flex: 1; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.lb-xp   { font-size: 13px; font-weight: 800; color: var(--yellow-dark); }
