/* ═══════════════════════════════════════════════════
   ReazonBi Academy - Shared Component Styles
   Reusable across all 42+ inner pages
   References CSS variables from style.css
   ═══════════════════════════════════════════════════ */

/* ═══════════════ PASSWORD GATE ═══════════════ */

#rba-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #202239;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#rba-gate.rba-gate-out {
    opacity: 0;
    pointer-events: none;
}

.rba-gate-box {
    background: rgba(15, 25, 50, 0.95);
    border: 1px solid rgba(180, 168, 228,0.25);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6), 0 0 40px rgba(180, 168, 228,0.05);
}

/* Logo */
.rba-gate-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rba-gate-logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #B4A8E4, #a8893e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #202239;
    font-family: 'Playfair Display', serif;
}

.rba-gate-logo-text {
    display: flex;
    flex-direction: column;
}

.rba-gate-logo-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #B4A8E4;
    letter-spacing: 0.04em;
}

.rba-gate-logo-sub {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: rgba(180, 168, 228,0.55);
    font-weight: 600;
}

/* Text */
.rba-gate-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f0e6cc;
    margin: 0;
    text-align: center;
}

.rba-gate-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.5;
}

/* Row */
.rba-gate-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.rba-gate-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(180, 168, 228,0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
    text-align: left;
}

.rba-gate-input:focus {
    border-color: rgba(180, 168, 228,0.6);
}

.rba-gate-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.rba-gate-btn {
    padding: 12px 22px;
    background: linear-gradient(135deg, #B4A8E4, #a8893e);
    color: #202239;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.rba-gate-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Error */
.rba-gate-err {
    color: #e05555;
    font-size: 0.85rem;
    min-height: 20px;
    margin: 0;
    text-align: center;
}

/* Shake animation */
@keyframes rbaShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

.rba-gate-shake {
    animation: rbaShake 0.4s ease;
}

/* Mobile - 480px */
@media (max-width: 480px) {
    .rba-gate-box {
        padding: 32px 20px;
        border-radius: 16px;
    }
    .rba-gate-row {
        flex-direction: column;
    }
    .rba-gate-btn {
        width: 100%;
        min-height: 44px;
    }
    .rba-gate-input {
        min-height: 44px;
        font-size: 1rem;
    }
    .rba-gate-title {
        font-size: 1.2rem;
    }
}

/* Mobile Small - 375px */
@media (max-width: 375px) {
    .rba-gate-box {
        padding: 24px 16px;
    }
    .rba-gate-logo-name {
        font-size: 1rem;
    }
}

/* ═══════════════ LAYOUT COMPONENTS ═══════════════ */

/* Page Container - centered content for inner pages */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    padding-top: 96px; /* below fixed header */
    min-height: 100vh;
}

/* Page Header - title + subtitle + breadcrumb area */
.page-header {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-2xl);
}

.page-header .page-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.page-header .page-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 300;
    margin-bottom: var(--space-md);
}

/* Breadcrumb - navigation trail */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--gold);
}

.breadcrumb .breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0.6;
    user-select: none;
}

[dir="rtl"] .breadcrumb .breadcrumb-separator {
    transform: scaleX(-1);
}

.breadcrumb .breadcrumb-current {
    color: var(--gold);
    font-weight: 500;
}

/* Content Grid - flexible card grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

/* Sidebar Layout - main + sidebar */
.sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    align-items: start;
}

[dir="rtl"] .sidebar-layout {
    grid-template-columns: 300px 1fr;
}

.sidebar-layout .sidebar-main {
    min-width: 0;
}

.sidebar-layout .sidebar-aside {
    position: sticky;
    top: 96px;
}

/* Section Divider - gold-accented separator */
.section-divider {
    height: 1px;
    border: none;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-active),
        var(--gold),
        var(--border-active),
        transparent
    );
    margin: var(--space-2xl) 0;
    opacity: 0.6;
}


/* ═══════════════ CARD COMPONENTS ═══════════════ */

/* Base Card - glass effect */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    opacity: 0;
    transition: var(--transition-normal);
}

.card:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-active);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.card:hover::before {
    opacity: 1;
}

/* Card Unit - learning unit card */
.card-unit {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.card-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    opacity: 0;
    transition: var(--transition-normal);
}

.card-unit:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-active);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.card-unit:hover::before {
    opacity: 1;
}

.card-unit .card-unit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.card-unit .card-unit-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-unit .card-unit-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
}

.card-unit .card-unit-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-top: auto;
}

/* Card Prompt - prompt card */
.card-prompt {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card-prompt:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-active);
}

.card-prompt .card-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    gap: var(--space-sm);
}

.card-prompt .card-prompt-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-prompt .card-prompt-code {
    background: var(--navy-darkest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent-green);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
    direction: ltr;
    text-align: left;
    overflow-x: auto;
}

.card-prompt .card-prompt-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* Card Term - glossary term */
.card-term {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    transition: var(--transition-normal);
    cursor: pointer;
}

.card-term:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

.card-term .card-term-name {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: var(--space-xs);
}

.card-term .card-term-preview {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Error - error card */
.card-error {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    transition: var(--transition-normal);
    border-inline-start: 3px solid var(--accent-red);
}

.card-error:hover {
    background: var(--surface-card-hover);
    border-color: var(--border-active);
    border-inline-start-color: var(--accent-red);
}

.card-error .card-error-code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-red);
    margin-bottom: var(--space-xs);
    direction: ltr;
    text-align: left;
}

.card-error .card-error-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.card-error .card-error-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
}

/* Card Room - room card */
.card-room {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.card-room:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-gold);
    border-color: var(--border-active);
}

.card-room .card-room-icon {
    font-size: 1.6rem;
    color: var(--gold);
    margin-bottom: var(--space-xs);
}

.card-room .card-room-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-room .card-room-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
}

.card-room .card-room-capacity {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 16px;
    background: rgba(180, 168, 228, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-size: 0.82rem;
    color: var(--gold);
}

.card-room .card-room-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.card-room .card-room-status.status-open {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.card-room .card-room-status.status-full {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-room .card-room-status.status-scheduled {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Card Achievement - achievement badge card */
.card-achievement {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.card-achievement:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.card-achievement .card-achievement-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(180, 168, 228, 0.2), rgba(180, 168, 228, 0.05));
    border: 1.5px solid var(--gold);
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--gold);
}

.card-achievement .card-achievement-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-achievement .card-achievement-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 300;
}

.card-achievement.locked {
    opacity: 0.5;
    filter: grayscale(0.6);
}

.card-achievement.locked .card-achievement-icon {
    border-color: var(--text-muted);
    color: var(--text-muted);
    background: rgba(107, 116, 136, 0.1);
}


/* ═══════════════ LEVEL BADGES ═══════════════ */

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.level-badge.level-1 {
    background: rgba(180, 168, 228, 0.08);
    color: var(--gold-light);
    border: 1px solid rgba(180, 168, 228, 0.2);
}

.level-badge.level-2 {
    background: rgba(180, 168, 228, 0.12);
    color: var(--gold);
    border: 1px solid rgba(180, 168, 228, 0.25);
}

.level-badge.level-3 {
    background: rgba(74, 59, 122, 0.2);
    color: #6B9FD4;
    border: 1px solid rgba(74, 59, 122, 0.35);
}

.level-badge.level-4 {
    background: rgba(74, 59, 122, 0.3);
    color: #4A8BC7;
    border: 1px solid rgba(74, 59, 122, 0.45);
}

.level-badge.level-5 {
    background: rgba(32, 34, 57, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(180, 168, 228, 0.15);
}


/* ═══════════════ WORLD TAGS ═══════════════ */

.world-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.world-tag.world-api {
    background: rgba(59, 130, 246, 0.12);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.world-tag.world-sdk {
    background: rgba(34, 197, 94, 0.12);
    color: #4ADE80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.world-tag.world-mcp {
    background: rgba(168, 85, 247, 0.12);
    color: #C084FC;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.world-tag.world-agents {
    background: rgba(249, 115, 22, 0.12);
    color: #FB923C;
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.world-tag.world-rag {
    background: rgba(236, 72, 153, 0.12);
    color: #F472B6;
    border: 1px solid rgba(236, 72, 153, 0.25);
}

.world-tag.world-evals {
    background: rgba(20, 184, 166, 0.12);
    color: #2DD4BF;
    border: 1px solid rgba(20, 184, 166, 0.25);
}

.world-tag.world-aws {
    background: rgba(251, 191, 36, 0.12);
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.world-tag.world-production {
    background: rgba(239, 68, 68, 0.12);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}


/* ═══════════════ FILTER / SEARCH COMPONENTS ═══════════════ */

/* Filter Bar - horizontal bar with filters and search */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

/* Filter Chip - toggleable filter button */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.filter-chip:hover {
    border-color: rgba(180, 168, 228, 0.3);
    color: var(--text-primary);
    background: var(--navy-light);
}

.filter-chip.active {
    background: rgba(180, 168, 228, 0.15);
    border-color: var(--border-active);
    color: var(--gold);
}

/* Search Inline - search input with icon */
.search-inline {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-inline .search-inline-input {
    width: 100%;
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    background: var(--navy-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

[dir="rtl"] .search-inline .search-inline-input {
    padding-right: 36px;
}

[dir="ltr"] .search-inline .search-inline-input {
    padding-left: 36px;
}

.search-inline .search-inline-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(180, 168, 228, 0.1);
}

.search-inline .search-inline-input::placeholder {
    color: var(--text-muted);
}

.search-inline .search-inline-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

[dir="rtl"] .search-inline .search-inline-icon {
    right: 12px;
}

[dir="ltr"] .search-inline .search-inline-icon {
    left: 12px;
}


/* ═══════════════ PROGRESS COMPONENTS ═══════════════ */

/* Progress Bar - horizontal with gold fill */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--navy-dark);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    transition: width 0.6s ease;
    position: relative;
}

.progress-bar .progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    animation: progressShine 2s ease infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.progress-sm {
    height: 4px;
}

.progress-bar.progress-lg {
    height: 10px;
    border-radius: 5px;
}

.progress-bar.progress-lg .progress-bar-fill {
    border-radius: 5px;
}

/* Progress Ring - circular SVG indicator */
.progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring .progress-ring-bg {
    fill: none;
    stroke: var(--navy-dark);
    stroke-width: 4;
}

.progress-ring .progress-ring-fill {
    fill: none;
    stroke: var(--gold);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring .progress-ring-text {
    position: absolute;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
}

/* XP Counter */
.xp-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(180, 168, 228, 0.2), rgba(180, 168, 228, 0.05));
    border: 1px solid rgba(180, 168, 228, 0.3);
    border-radius: 50px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
}

.xp-counter .xp-value {
    transition: all 0.3s ease;
}

.xp-counter .xp-label {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-counter.xp-animate .xp-value {
    animation: xpPulse 0.5s ease;
}

@keyframes xpPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--gold-light); }
    100% { transform: scale(1); }
}

/* Streak Badge */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.25);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #FB923C;
}

.streak-badge .streak-icon {
    font-size: 0.85rem;
}

.streak-badge .streak-count {
    font-family: var(--font-mono);
}


/* ═══════════════ INTERACTIVE COMPONENTS ═══════════════ */

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--navy-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    flex-shrink: 0;
    padding: 8px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--navy-mid);
}

.tab.active {
    color: var(--gold);
    background: var(--navy-mid);
    box-shadow: var(--shadow-sm);
}

/* Accordion */
.accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.accordion-item {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
}

.accordion-item.open {
    border-color: var(--border-active);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    width: 100%;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: inherit;
}

.accordion-header:hover {
    background: var(--surface-card-hover);
}

.accordion-header .accordion-icon {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

.accordion-item.open .accordion-header .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.accordion-item.open .accordion-body {
    max-height: 1000px;
}

.accordion-body-inner {
    padding: 0 var(--space-lg) var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.modal.open {
    display: flex;
}

.modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 24, 0.85);
    backdrop-filter: blur(8px);
}

.modal .modal-dialog {
    position: relative;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.modal .modal-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.modal .modal-dialog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal .modal-dialog-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal .modal-dialog-close:hover {
    color: var(--text-primary);
}

.modal .modal-dialog-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal .modal-dialog-footer {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.85rem;
    color: var(--text-primary);
    transform: translateY(120%);
    opacity: 0;
    transition: all var(--transition-normal);
    max-width: 400px;
}

[dir="rtl"] .toast {
    right: 24px;
}

[dir="ltr"] .toast {
    left: 24px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast .toast-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.toast-success {
    border-inline-start: 3px solid var(--accent-green);
}

.toast.toast-success .toast-icon {
    color: var(--accent-green);
}

.toast.toast-error {
    border-inline-start: 3px solid var(--accent-red);
}

.toast.toast-error .toast-icon {
    color: var(--accent-red);
}

.toast.toast-info {
    border-inline-start: 3px solid var(--accent-blue);
}

.toast.toast-info .toast-icon {
    color: var(--accent-blue);
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    margin-inline-start: var(--space-sm);
    transition: var(--transition-fast);
}

.toast .toast-close:hover {
    color: var(--text-primary);
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 12px;
    background: var(--navy-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 100;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--navy-light);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ═══════════════ BUTTON EXTENSIONS ═══════════════ */

/* Icon-only button */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--navy-light);
    color: var(--gold);
    border-color: var(--border-active);
}

/* WhatsApp share button */
.btn-share-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #25D366;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-share-whatsapp:hover {
    background: #1DA851;
    transform: translateY(-1px);
}

/* Email share button */
.btn-share-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-share-email:hover {
    background: var(--navy-light);
    color: var(--gold);
    border-color: var(--border-active);
}

/* Copy to clipboard button */
.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--navy-mid);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-copy:hover {
    background: var(--navy-light);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-copy.copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent-green);
}

/* Save / Bookmark button */
.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-save:hover {
    color: var(--gold);
    border-color: var(--border-active);
}

.btn-save.saved {
    background: rgba(180, 168, 228, 0.15);
    border-color: var(--border-active);
    color: var(--gold);
}


/* ═══════════════ FORM COMPONENTS ═══════════════ */

/* Styled Select */
.select-styled {
    position: relative;
    display: inline-block;
}

.select-styled select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 8px 36px 8px 14px;
    background: var(--navy-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
    min-width: 140px;
}

[dir="rtl"] .select-styled select {
    padding: 8px 14px 8px 36px;
}

.select-styled select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(180, 168, 228, 0.1);
}

.select-styled::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

[dir="rtl"] .select-styled::after {
    left: 14px;
}

[dir="ltr"] .select-styled::after {
    right: 14px;
}

/* Styled Checkbox */
.checkbox-styled {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-styled input[type="checkbox"] {
    display: none;
}

.checkbox-styled .checkbox-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-subtle);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
    background: var(--navy-dark);
}

.checkbox-styled input[type="checkbox"]:checked + .checkbox-box {
    background: var(--gold-dark);
    border-color: var(--gold);
}

.checkbox-styled input[type="checkbox"]:checked + .checkbox-box::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid var(--navy-darkest);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-styled:hover .checkbox-box {
    border-color: var(--gold);
}

/* Styled Radio */
.radio-styled {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}

.radio-styled input[type="radio"] {
    display: none;
}

.radio-styled .radio-circle {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-subtle);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
    background: var(--navy-dark);
}

.radio-styled input[type="radio"]:checked + .radio-circle {
    border-color: var(--gold);
}

.radio-styled input[type="radio"]:checked + .radio-circle::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.radio-styled:hover .radio-circle {
    border-color: var(--gold);
}

/* Styled Textarea */
.textarea-styled {
    width: 100%;
    padding: 12px 16px;
    background: var(--navy-dark);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.textarea-styled:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(180, 168, 228, 0.1);
}

.textarea-styled::placeholder {
    color: var(--text-muted);
}


/* ═══════════════ PAGE TRANSITIONS ═══════════════ */

.page-content {
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.page-enter {
    animation: pageEnter 0.35s ease forwards;
}

.page-exit {
    animation: pageExit 0.2s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}


/* ═══════════════ CREDIT LINE ═══════════════ */

.credit-line {
    text-align: center;
    padding: 8px var(--space-md);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.3px;
}


/* ═══════════════ RESPONSIVE ═══════════════ */

/* ══════════════════════════════════════════════
   Tablet - 768px
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page-container {
        padding: 0 var(--space-md);
        padding-top: 88px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    [dir="rtl"] .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-layout .sidebar-aside {
        position: static;
        order: -1;
    }

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: var(--space-sm) var(--space-md);
        gap: var(--space-sm);
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .modal .modal-dialog {
        max-width: 100%;
        margin: 0 var(--space-sm);
        padding: var(--space-xl);
    }

    .tabs {
        overflow-x: auto;
    }

    .tabs::-webkit-scrollbar { display: none; }

    /* Cards */
    .card-unit {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* Sandbox */
    .sandbox-btn-row {
        flex-direction: column;
    }

    .sandbox-btn-row .btn {
        width: 100%;
    }

    /* Accordion headers */
    .accordion-header {
        font-size: 0.9rem;
        padding: var(--space-sm) var(--space-md);
    }

    /* Progress bars */
    .progress-bar {
        height: 6px;
    }

    /* Level badges - smaller */
    .level-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    /* Page header */
    .page-header {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .page-header .page-title {
        font-size: 1.5rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    /* Stat cards row → 2 columns */
    .stat-cards-row {
        grid-template-columns: 1fr 1fr;
    }

    /* Quick nav cards → 2 columns */
    .quick-nav-cards {
        grid-template-columns: 1fr 1fr;
    }

    /* World tags wrap */
    .world-tags {
        flex-wrap: wrap;
    }

    /* Footer columns → stack */
    .footer-columns {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    /* Credit line center */
    .credit-line {
        text-align: center;
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ══════════════════════════════════════════════
   Mobile - 480px
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .page-container {
        padding: 0 var(--space-md);
        padding-top: 80px;
    }

    .stat-cards-row {
        grid-template-columns: 1fr;
    }

    .quick-nav-cards {
        grid-template-columns: 1fr;
    }

    /* Table responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Podium - stack */
    .podium {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    /* Rooms cards */
    .room-card-grid {
        grid-template-columns: 1fr;
    }

    /* Prompt card actions */
    .card-prompt .card-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .card-prompt .card-actions .btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    /* Sandbox terminal */
    .sandbox-terminal {
        font-size: 0.78rem;
        padding: 12px;
    }

    /* Modal full screen */
    .modal .modal-dialog {
        margin: 0;
        width: 100vw;
        min-height: 50vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* ══════════════════════════════════════════════
   Mobile Small - 375px
   ══════════════════════════════════════════════ */
@media (max-width: 375px) {
    .page-container {
        padding: 0 12px;
        padding-top: 76px;
    }

    .page-header .page-title {
        font-size: 1.2rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .card,
    .card-unit,
    .card-prompt,
    .card-term,
    .card-error,
    .card-room,
    .card-achievement {
        padding: var(--space-md);
    }

    .filter-bar {
        padding: var(--space-sm);
    }

    .filter-chip {
        padding: 6px 10px;
        font-size: 0.72rem;
        white-space: nowrap;
        min-height: 32px;
    }

    .toast {
        max-width: calc(100vw - 32px);
        font-size: 0.85rem;
    }

    [dir="rtl"] .toast { right: 16px; }
    [dir="ltr"] .toast  { left:  16px; }

    /* Buttons full-width and proper touch target on small */
    .btn-lg {
        width: 100%;
        text-align: center;
        min-height: 44px;
    }

    /* Base btn touch target */
    .btn {
        min-height: 40px;
    }

    /* XP counter compact */
    .xp-counter {
        font-size: 0.85rem;
    }

    /* Level roadmap */
    .level-roadmap {
        gap: var(--space-sm);
    }

    /* Tab labels - icons only on smallest */
    .tab-label-text {
        display: none;
    }

    /* Modal full-width padding */
    .modal {
        padding: var(--space-sm);
    }

    /* Search inline fill container */
    .search-inline {
        min-width: 100%;
    }

    /* Sidebar stacked layout spacing */
    .sidebar-layout {
        gap: var(--space-lg);
    }
}

/* ═══════════════════════════════════════════
   Levels Bar - Homepage Entry
   ═══════════════════════════════════════════ */

.levels-bar-section {
    background: linear-gradient(180deg, rgba(32, 34, 57,0) 0%, rgba(32, 34, 57,0.8) 100%);
    border-bottom: 1px solid rgba(180, 168, 228,0.12);
    padding: 20px 0 24px;
    position: relative;
    z-index: 10;
}

.levels-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.levels-bar-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.levels-bar-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

/* Level Pill Base */
.level-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1.5px solid;
    background: rgba(32, 34, 57, 0.6);
    backdrop-filter: blur(8px);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    overflow: hidden;
    /* Reset button defaults */
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.level-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.level-pill:hover {
    transform: translateY(-2px);
}

.level-pill:hover::before {
    opacity: 1;
}

/* Dot */
.level-pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

/* Name + Sub */
.level-pill-name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
}

.level-pill-sub {
    font-size: 0.72rem;
    opacity: 0.7;
    margin-right: 4px;
    white-space: nowrap;
}

[dir="ltr"] .level-pill-sub {
    margin-right: 0;
    margin-left: 4px;
}

/* ── Level 1 - מתחיל - Gold Light ── */
.level-pill-1 {
    border-color: rgba(212, 186, 122, 0.4);
    color: #C5BBEC;
}
.level-pill-1 .level-pill-dot  { background: #C5BBEC; color: #C5BBEC; }
.level-pill-1::before           { background: rgba(212, 186, 122, 0.06); }
.level-pill-1:hover             { border-color: #C5BBEC; box-shadow: 0 4px 20px rgba(212, 186, 122, 0.2); }

/* ── Level 2 - מתקדמים - Gold ── */
.level-pill-2 {
    border-color: rgba(180, 168, 228, 0.5);
    color: #B4A8E4;
}
.level-pill-2 .level-pill-dot  { background: #B4A8E4; color: #B4A8E4; }
.level-pill-2::before           { background: rgba(180, 168, 228, 0.06); }
.level-pill-2:hover             { border-color: #B4A8E4; box-shadow: 0 4px 20px rgba(180, 168, 228, 0.25); }

/* ── Level 3 - פרופשנל - Academic Blue Light ── */
.level-pill-3 {
    border-color: rgba(107, 159, 212, 0.4);
    color: #6B9FD4;
}
.level-pill-3 .level-pill-dot  { background: #6B9FD4; color: #6B9FD4; }
.level-pill-3::before           { background: rgba(107, 159, 212, 0.06); }
.level-pill-3:hover             { border-color: #6B9FD4; box-shadow: 0 4px 20px rgba(107, 159, 212, 0.2); }

/* ── Level 4 - ארכיטקט - Academic Blue ── */
.level-pill-4 {
    border-color: rgba(74, 139, 199, 0.5);
    color: #4A8BC7;
}
.level-pill-4 .level-pill-dot  { background: #4A8BC7; color: #4A8BC7; }
.level-pill-4::before           { background: rgba(74, 139, 199, 0.06); }
.level-pill-4:hover             { border-color: #4A8BC7; box-shadow: 0 4px 20px rgba(74, 139, 199, 0.25); }

/* ── Level 5 - Production - Steel ── */
.level-pill-5 {
    border-color: rgba(155, 170, 190, 0.3);
    color: #9BAABE;
}
.level-pill-5 .level-pill-dot  { background: #9BAABE; color: #9BAABE; }
.level-pill-5::before           { background: rgba(155, 170, 190, 0.06); }
.level-pill-5:hover             { border-color: #9BAABE; box-shadow: 0 4px 20px rgba(155, 170, 190, 0.2); }

/* Tablet - 768px */
@media (max-width: 768px) {
    .levels-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        padding: 0 var(--space-md);
    }
    .levels-bar-buttons {
        gap: 8px;
        width: 100%;
    }
    .level-pill-sub {
        display: none;
    }
    .level-pill {
        padding: 10px 14px;
        min-height: 44px;
    }
}

/* Mobile - 480px */
@media (max-width: 480px) {
    .levels-bar-section {
        padding: 16px 0 20px;
    }
    .levels-bar-inner {
        gap: var(--space-sm);
        padding: 0 var(--space-md);
    }
    .levels-bar-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
    }
    .level-pill-5 {
        grid-column: 1 / -1;
        justify-content: center;
    }
    .level-pill {
        min-height: 44px;
        padding: 10px 12px;
        justify-content: center;
    }
}

/* Mobile Small - 375px */
@media (max-width: 375px) {
    .levels-bar-inner {
        padding: 0 var(--space-sm);
    }
    .level-pill-name {
        font-size: 0.82rem;
    }
}

/* ═══════════════════════════════════════════
   Sandbox Terminal
   ═══════════════════════════════════════════ */
.sandbox-terminal {
    background: #0a0f1e;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    min-height: 160px;
    max-height: 360px;
    overflow-y: auto;
    direction: ltr;
    text-align: left;
}

.terminal-line {
    padding: 2px 0;
    line-height: 1.6;
    color: #b0b8d0;
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-prompt  { color: var(--gold); }
.terminal-sign    { color: #4ec9b0; }
.terminal-cmd     { color: #ffffff; }
.terminal-ai      { color: #d4e0ff; }
.terminal-success { color: #2ecc71; }
.terminal-error   { color: #e74c3c; }
.terminal-loading { color: #888; font-style: italic; }
.terminal-placeholder { color: #444; font-style: italic; }

.sandbox-terminal-section { margin-top: 16px; }
.sandbox-term-label { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; }
.sandbox-btn-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sandbox-save-status { font-size: 0.85rem; margin-top: 8px; display: none; }
.sandbox-save-ok  { color: #2ecc71; }
.sandbox-save-err { color: #e74c3c; }
