/* ==========================================================================
   SQL PRACTICE CONSOLE STYLESHEET
   Professional Developer Console with 3 Themes:
   1. Navy + Cyan (Our Theme)
   2. Black (Midnight Dark)
   3. White (Clean Light)
   ========================================================================== */

/* --------------------------------------------------------------------------
   THEME PRESETS (Scoped strictly to .sql-practice-console)
   -------------------------------------------------------------------------- */

/* 1. Navy + Cyan (Our Theme - Default) */
.sql-practice-console,
.sql-practice-console[data-theme="navy-cyan"] {
    --console-bg: #070d18;
    --console-panel-bg: rgba(11, 19, 36, 0.88);
    --console-panel-header-bg: rgba(7, 14, 28, 0.96);
    --console-editor-bg: #040914;
    --console-gutter-bg: rgba(4, 9, 20, 0.8);
    --console-border: rgba(56, 189, 248, 0.12);
    --console-border-hover: rgba(56, 189, 248, 0.35);
    --console-border-active: #00e5ff;

    --console-cyan: #00e5ff;
    --console-cyan-glow: rgba(0, 229, 255, 0.30);
    --console-cyan-dark: #00b4d8;
    --console-accent-gradient: linear-gradient(135deg, #00e5ff 0%, #00b4d8 100%);
    --console-accent-hover: linear-gradient(135deg, #38e1ff 0%, #06c0e5 100%);
    --console-btn-text: #021224;

    --console-text-primary: #f1f5f9;
    --console-text-secondary: #94a3b8;
    --console-text-muted: #64748b;
    --console-text-dim: #475569;

    --console-table-th-bg: #091224;
    --console-table-hover: rgba(56, 189, 248, 0.04);
    --console-code-color: #e2e8f0;
    --console-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    --console-menu-shadow: 0 10px 30px rgba(0, 0, 0, 0.40);

    --console-success: #10b981;
    --console-warning: #f59e0b;
    --console-danger: #f43f5e;

    --editor-font: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --editor-line-height: 1.6;

    /* SQL Syntax Highlighting System - Vibrant Tokyo Night / One Dark Palette */
    --sql-keyword: #e879f9;
    /* Primary Keywords: Radiant Orchid / Magenta */
    --sql-keyword-logical: #fb923c;
    /* Logical / Conditional: Sunset Tangerine */
    --sql-function: #22d3ee;
    /* Functions: Electric Aqua Cyan */
    --sql-table: #4ade80;
    /* Table names: Crisp Spring Emerald */
    --sql-column: #f1f5f9;
    /* Column names: Crisp Pearl White */
    --sql-string: #fde047;
    /* Strings: Golden Canary Yellow */
    --sql-number: #f472b6;
    /* Numbers: Neon Coral Pink */
    --sql-operator: #cbd5e1;
    /* Operators: Light Slate */
    --sql-punctuation: #94a3b8;
    /* Commas, parentheses, semicolons: Slate */
    --sql-comment: #64748b;
    /* Comments: Muted slate blue italic */
    --sql-special: #a78bfa;
    /* Boolean / NULL / DEFAULT: Royal Lavender */
    --sql-parameter: #67e8f9;
    /* Parameters / placeholders: Sky Cyan */
    --sql-text: #f1f5f9;
    /* Normal code text */
    --sql-cursor: #00e5ff;
    /* Caret cursor */
    --sql-selection: rgba(232, 121, 249, 0.25);
    /* Text selection */
    --sql-active-line: rgba(232, 121, 249, 0.08);
    /* Active line / gutter */
}

/* 2. Black Theme (Pure Deep Dark) */
.sql-practice-console[data-theme="black"] {
    --console-bg: #000000;
    --console-panel-bg: #09090b;
    --console-panel-header-bg: #111115;
    --console-editor-bg: #050507;
    --console-gutter-bg: #0a0a0d;
    --console-border: rgba(255, 255, 255, 0.12);
    --console-border-hover: rgba(255, 255, 255, 0.30);
    --console-border-active: #00e5ff;

    --console-cyan: #00e5ff;
    --console-cyan-glow: rgba(0, 229, 255, 0.35);
    --console-cyan-dark: #00b4d8;
    --console-accent-gradient: linear-gradient(135deg, #00e5ff 0%, #00b4d8 100%);
    --console-accent-hover: linear-gradient(135deg, #38e1ff 0%, #06c0e5 100%);
    --console-btn-text: #021224;

    --console-text-primary: #ffffff;
    --console-text-secondary: #a1a1aa;
    --console-text-muted: #71717a;
    --console-text-dim: #52525b;

    --console-table-th-bg: #111115;
    --console-table-hover: rgba(255, 255, 255, 0.05);
    --console-code-color: #ffffff;
    --console-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
    --console-menu-shadow: 0 10px 35px rgba(0, 0, 0, 0.60);

    /* SQL Syntax Highlighting System - Black Theme (Midnight Synth / Dracula Pro) */
    --sql-keyword: #f472b6;
    /* Primary Keywords: Radiant Hot Pink */
    --sql-keyword-logical: #f59e0b;
    /* Logical / Conditional: Golden Amber */
    --sql-function: #06b6d4;
    /* Functions: Vivid Aqua */
    --sql-table: #34d399;
    /* Table names: Electric Mint */
    --sql-column: #ffffff;
    /* Column names: High-contrast Pure White */
    --sql-string: #facc15;
    /* Strings: Bright Gold */
    --sql-number: #fb7185;
    /* Numbers: Warm Coral */
    --sql-operator: #e2e8f0;
    /* Operators: Light Silver */
    --sql-punctuation: #a1a1aa;
    /* Commas, parentheses, semicolons: Zinc */
    --sql-comment: #71717a;
    /* Comments: Muted gray italic */
    --sql-special: #c084fc;
    /* Boolean / NULL / DEFAULT: Soft Violet */
    --sql-parameter: #38bdf8;
    /* Parameters / placeholders: Bright Blue */
    --sql-text: #ffffff;
    /* Normal code text */
    --sql-cursor: #f472b6;
    /* Caret cursor */
    --sql-selection: rgba(244, 114, 182, 0.28);
    /* Text selection */
    --sql-active-line: rgba(244, 114, 182, 0.08);
    /* Active line */
}

/* 3. Muted Soft Light Theme (Gentle warm gray / cream tone instead of stark white) */
.sql-practice-console[data-theme="soft-light"],
.sql-practice-console[data-theme="white"] {
    --console-bg: #eef2f6;
    --console-panel-bg: #f8fafc;
    --console-panel-header-bg: #e2e8f0;
    --console-editor-bg: #fbfcfe;
    --console-gutter-bg: #edf2f7;
    --console-border: rgba(148, 163, 184, 0.38);
    --console-border-hover: rgba(100, 116, 139, 0.65);
    --console-border-active: #6366f1;

    --console-cyan: #0284c7;
    --console-cyan-glow: rgba(2, 132, 199, 0.20);
    --console-cyan-dark: #0369a1;
    --console-accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --console-accent-hover: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --console-btn-text: #ffffff;

    --console-text-primary: #0f172a;
    --console-text-secondary: #334155;
    --console-text-muted: #64748b;
    --console-text-dim: #94a3b8;

    --console-table-th-bg: #e2e8f0;
    --console-table-hover: rgba(99, 102, 241, 0.05);
    --console-code-color: #0f172a;
    --console-shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --console-menu-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);

    /* SQL Syntax Highlighting System - Muted Soft Light Theme */
    --sql-keyword: #6d28d9;
    /* Primary Keywords: Royal Purple/Violet */
    --sql-keyword-logical: #c2410c;
    /* Logical / Conditional: Warm Terracotta Orange */
    --sql-function: #0284c7;
    /* Functions: Deep Teal Cyan */
    --sql-table: #059669;
    /* Table names: Deep Jewel Emerald */
    --sql-column: #0f172a;
    /* Column names: Deep Charcoal */
    --sql-string: #b45309;
    /* Strings: Warm Amber */
    --sql-number: #be185d;
    /* Numbers: Deep Raspberry Magenta */
    --sql-operator: #334155;
    /* Operators: Deep Slate */
    --sql-punctuation: #64748b;
    /* Commas, parentheses, semicolons: Slate */
    --sql-comment: #64748b;
    /* Comments: Muted slate italic */
    --sql-special: #7c3aed;
    /* Boolean / NULL / DEFAULT: Electric Violet */
    --sql-parameter: #0891b2;
    /* Parameters / placeholders: Cyan */
    --sql-text: #0f172a;
    /* Normal code text */
    --sql-cursor: #6366f1;
    /* Caret cursor */
    --sql-selection: rgba(99, 102, 241, 0.16);
    /* Text selection */
    --sql-active-line: rgba(99, 102, 241, 0.05);
    /* Active line */
}

/* Soft Light Theme Specific Contrast Tweaks */
.sql-practice-console[data-theme="soft-light"] .pk-badge,
.sql-practice-console[data-theme="white"] .pk-badge {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}

.sql-practice-console[data-theme="soft-light"] .meta-success,
.sql-practice-console[data-theme="white"] .meta-success {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

/* =========================================================
   1. MAIN CONSOLE CONTAINER
========================================================= */
.sql-practice-console {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px - 65px);
    min-height: 560px;
    background: var(--console-bg) !important;
    color: var(--console-text-primary) !important;
    margin: -2rem;
    padding: 14px 20px 16px 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sql-practice-console h1,
.sql-practice-console h2,
.sql-practice-console h3,
.sql-practice-console h4,
.sql-practice-console h5,
.sql-practice-console h6 {
    color: var(--console-text-primary) !important;
}

/* =========================================================
   2. TOP CONSOLE CONTROL BAR
========================================================= */
.console-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
    min-height: 44px;
    margin-bottom: 10px;
    padding: 0 4px;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--console-text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.18s ease;
}

.back-link:hover {
    color: var(--console-cyan);
}

.topbar-divider {
    color: var(--console-text-dim);
    font-size: 0.80rem;
}

.question-tracker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-level {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--console-cyan);
    border: 1px solid var(--console-border);
}


.category-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--console-text-primary);
}

.question-counter {
    font-size: 0.80rem;
    color: var(--console-text-muted);
}

.question-counter strong {
    color: var(--console-text-primary);
}

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



/* UTILITY CONTROLS: THEME & HIDE TABLE */
.console-utilities {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-console-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    color: var(--console-text-secondary);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-console-tool:hover {
    color: var(--console-cyan);
    border-color: var(--console-border-hover);
    background: var(--console-panel-header-bg);
}

.btn-console-tool.btn-tool-active {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--console-cyan);
    color: var(--console-cyan);
    box-shadow: 0 0 12px var(--console-cyan-glow);
}

.tool-chevron {
    font-size: 0.65rem;
    margin-left: 2px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.console-theme-dropdown[aria-expanded="true"] .tool-chevron,
.btn-console-tool[aria-expanded="true"] .tool-chevron {
    transform: rotate(180deg);
}

/* THEME MENU DROPDOWN */
.console-theme-dropdown {
    position: relative;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 120;
    min-width: 175px;
    background: var(--console-panel-header-bg);
    border: 1px solid var(--console-border-hover);
    border-radius: 10px;
    padding: 6px;
    box-shadow: var(--console-menu-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: menuFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--console-text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.theme-opt:hover {
    background: var(--console-panel-bg);
    color: var(--console-text-primary);
}

.theme-opt.is-active {
    background: var(--console-panel-bg);
    color: var(--console-cyan);
    font-weight: 600;
}

.theme-swatch {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
}

.swatch-navy-cyan {
    background: linear-gradient(135deg, #070d18 0%, #00e5ff 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.swatch-black {
    background: #000000;
    border: 1px solid #555555;
}

.swatch-soft-light,
.swatch-white {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #94a3b8;
}

.theme-name {
    flex: 1 1 auto;
}

.theme-check {
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.theme-opt.is-active .theme-check {
    opacity: 1;
}

/* =========================================================
   3. RESIZABLE 4-PANEL WORKSPACE
========================================================= */
.practice-workspace {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    position: relative;
    gap: 0;
    overflow: hidden;
}

.workspace-col {
    display: flex;
    flex-direction: column;
    min-width: 260px;
    min-height: 0;
    position: relative;
    transition: width 0.18s cubic-bezier(0.16, 1, 0.3, 1), flex 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-left {
    flex: 0 0 60%;
    width: 60%;
}

.workspace-right {
    flex: 1 1 auto;
    width: 40%;
}

/* =========================================================
   4. DRAGGABLE RESIZE HANDLES
========================================================= */
.resize-handle {
    background: transparent;
    position: relative;
    z-index: 10;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.resize-handle.resize-col {
    width: 10px;
    cursor: col-resize;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle.resize-col::after {
    content: '';
    width: 2px;
    height: 100%;
    background: var(--console-border);
    border-radius: 2px;
    transition: background 0.2s ease, width 0.2s ease, box-shadow 0.2s ease;
}

.resize-handle.resize-col:hover::after,
.resize-handle.resize-col.is-dragging::after {
    background: var(--console-cyan);
    width: 3px;
    box-shadow: 0 0 10px var(--console-cyan-glow);
}

.resize-handle.resize-row {
    height: 10px;
    cursor: row-resize;
    margin: 2px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle.resize-row::after {
    content: '';
    height: 2px;
    width: 100%;
    background: var(--console-border);
    border-radius: 2px;
    transition: background 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.resize-handle.resize-row:hover::after,
.resize-handle.resize-row.is-dragging::after {
    background: var(--console-cyan);
    height: 3px;
    box-shadow: 0 0 10px var(--console-cyan-glow);
}

body.resizing {
    user-select: none !important;
}

body.resizing-col {
    cursor: col-resize !important;
}

body.resizing-row {
    cursor: row-resize !important;
}

/* =========================================================
   5. CONSOLE PANELS (COMMON STYLING)
========================================================= */
.console-panel {
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 130px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--console-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, height 0.18s cubic-bezier(0.16, 1, 0.3, 1), flex 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.console-panel:focus-within {
    border-color: var(--console-border-hover);
}

/* Initial panel height distributions */
.sql-editor-panel {
    flex: 0 0 55%;
    height: 55%;
}

.results-panel {
    flex: 1 1 auto;
    height: 45%;
}

.question-panel {
    flex: 0 0 42%;
    height: 42%;
}

.schema-panel {
    flex: 1 1 auto;
    height: 58%;
}

/* PANEL HEADER */
.panel-header {
    height: 42px;
    min-height: 42px;
    background: var(--console-panel-header-bg);
    border-bottom: 1px solid var(--console-border);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title h2 {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--console-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.panel-icon-cyan {
    color: var(--console-cyan);
    font-size: 0.95rem;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-btn-action,
.panel-btn-maximize {
    background: transparent;
    border: 1px solid transparent;
    color: var(--console-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.80rem;
    transition: all 0.16s ease;
    box-sizing: border-box;
}

.panel-btn-action:hover,
.panel-btn-maximize:hover {
    color: var(--console-cyan);
    background: var(--console-panel-bg);
    border-color: var(--console-border);
}

/* =========================================================
   INDEPENDENT PANEL VISIBILITY STATES
========================================================= */

/* State A: Question panel hidden */
.sql-practice-console.question-hidden #panelQuestion {
    display: none !important;
}

.sql-practice-console.question-hidden #handleRowRight {
    display: none !important;
}

.sql-practice-console.question-hidden:not(.table-hidden) #panelSchema {
    flex: 1 1 100% !important;
    height: 100% !important;
}

/* State B: Table schema hidden */
.sql-practice-console.table-hidden #panelSchema {
    display: none !important;
}

.sql-practice-console.table-hidden #handleRowRight {
    display: none !important;
}

.sql-practice-console.table-hidden:not(.question-hidden) #panelQuestion {
    flex: 1 1 100% !important;
    height: 100% !important;
}

/* State C: BOTH Question and Table hidden (entire right workspace collapses) */
.sql-practice-console.question-hidden.table-hidden #workspaceRight {
    display: none !important;
}

.sql-practice-console.question-hidden.table-hidden #handleCol {
    display: none !important;
}

.sql-practice-console.question-hidden.table-hidden #workspaceLeft {
    flex: 1 1 100% !important;
    width: 100% !important;
}

/* =========================================================
   VIEW STATE 3: MAXIMIZED PANEL OVERLAY
========================================================= */
.console-panel.panel--maximized {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 100 !important;
    border-radius: 12px !important;
    border-color: var(--console-cyan) !important;
    box-shadow: 0 0 35px var(--console-cyan-glow) !important;
    flex: 1 1 100% !important;
    background: var(--console-panel-bg) !important;
}

.console-panel.panel--maximized.question-panel .question-body {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 24px;
}

/* =========================================================
   INTERNAL SCROLLABLE BODY
========================================================= */
.panel-scroll-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--console-border-hover) transparent;
}

.panel-scroll-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.panel-scroll-body::-webkit-scrollbar-thumb {
    background: var(--console-border-hover);
    border-radius: 4px;
}

/* =========================================================
   6. SQL EDITOR PANEL & THEME-AWARE SYNTAX HIGHLIGHTING
========================================================= */
.editor-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    position: relative;
    background: var(--console-editor-bg);
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.editor-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.editor-gutter {
    width: 44px;
    min-width: 44px;
    background: var(--console-gutter-bg);
    border-right: 1px solid var(--console-border);
    padding: 12px 6px 12px 0;
    text-align: right;
    user-select: none;
    color: var(--console-text-muted);
    font-family: var(--editor-font);
    font-size: var(--editor-font-size, 0.84rem);
    line-height: var(--editor-line-height);
    overflow: hidden;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.editor-gutter span {
    display: block;
    height: calc(var(--editor-font-size, 0.84rem) * var(--editor-line-height));
    padding-right: 4px;
    border-radius: 3px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.editor-gutter span.active-line {
    color: var(--sql-keyword);
    font-weight: 700;
    background: var(--sql-active-line);
}

.editor-code-container {
    flex: 1 1 auto;
    width: calc(100% - 44px);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Syntax Highlighting Display Layer */
.editor-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 12px 14px;
    box-sizing: border-box;
    pointer-events: none;
    overflow: hidden;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
    font-family: var(--editor-font);
    font-size: var(--editor-font-size, 0.84rem);
    line-height: var(--editor-line-height);
    tab-size: 4;
    -moz-tab-size: 4;
    color: var(--sql-text);
    background: transparent;
    border: none;
    z-index: 1;
}

.editor-highlight code {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
    word-wrap: normal;
    color: inherit;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
    display: block;
}

/* Interactive SQL Textarea (Transparent text overlays precisely over highlighted layer) */
.sql-code-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: var(--sql-text);
    caret-color: var(--sql-cursor);
    font-family: var(--editor-font);
    font-size: var(--editor-font-size, 0.84rem);
    line-height: var(--editor-line-height);
    padding: 12px 14px;
    box-sizing: border-box;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    tab-size: 4;
    -moz-tab-size: 4;
    z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: var(--console-border-hover) transparent;
}

/* When syntax highlighter is active, hide textarea text fill so colored syntax shows cleanly */
.editor-wrapper.editor-highlight-active .sql-code-area {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

.sql-code-area::selection {
    background: var(--sql-selection);
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.sql-code-area::placeholder {
    color: var(--sql-comment);
    -webkit-text-fill-color: var(--sql-comment);
    opacity: 0.55;
    font-style: italic;
}

/* Focus indicator on editor */
.editor-wrapper:focus-within {
    box-shadow: inset 0 0 0 1px var(--console-border-hover);
}

/* =========================================================
   SQL SYNTAX TOKEN CATEGORIES
========================================================= */
.sql-token {
    font-style: normal;
}

/* 1. Primary SQL Keywords (SELECT, FROM, WHERE, JOIN, GROUP BY, etc.) */
.sql-token.sql-keyword {
    color: var(--sql-keyword-custom, var(--sql-keyword));
    font-weight: 600;
}

/* 2. SQL Logical / Conditional Keywords (AND, OR, NOT, IN, BETWEEN, CASE, etc.) */
.sql-token.sql-keyword-logical {
    color: var(--sql-keyword-logical);
    font-weight: 600;
}

/* 3. SQL Functions (COUNT, SUM, AVG, ROUND, COALESCE, etc.) */
.sql-token.sql-function {
    color: var(--sql-function);
    font-weight: 500;
}

/* 4. Table Names */
.sql-token.sql-table {
    color: var(--sql-table-custom, var(--sql-table));
    font-weight: 600;
}

/* 5. Column Names / Identifiers */
.sql-token.sql-column {
    color: var(--sql-column-custom, var(--sql-column));
    font-weight: 400;
}

/* 6. Strings ('Completed', 'Kochi', etc.) */
.sql-token.sql-string {
    color: var(--sql-string);
}

/* 7. Numbers (10, 10000, 3.14, etc.) */
.sql-token.sql-number {
    color: var(--sql-number);
    font-weight: 500;
}

/* 8. Operators (=, >, <, >=, <=, !=, +, -, *, /, %) */
.sql-token.sql-operator {
    color: var(--sql-operator);
}

/* Punctuation (;, ,, (, ), .) */
.sql-token.sql-punctuation {
    color: var(--sql-punctuation);
}

/* 9. Comments (-- comment, /* comment *\/) */
.sql-token.sql-comment {
    color: var(--sql-comment);
    font-style: italic;
    opacity: 0.85;
}

/* 10. Boolean / Special Values (TRUE, FALSE, NULL, DEFAULT) */
.sql-token.sql-special {
    color: var(--sql-special);
    font-weight: 600;
}

/* 11. Parameters / Placeholders (:user_id, $1, %s, ?) */
.sql-token.sql-parameter {
    color: var(--sql-parameter);
    font-weight: 500;
}

/* EDITOR BOTTOM ACTION TOOLBAR */
.editor-footer {
    height: 48px;
    min-height: 48px;
    background: var(--console-panel-header-bg);
    border-top: 1px solid var(--console-border);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.editor-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-console {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.btn-console:focus-visible {
    outline: 2px solid var(--console-cyan);
    outline-offset: 2px;
}

/* PRIMARY CYAN RUN QUERY BUTTON */
.btn-console-primary {
    background: var(--console-accent-gradient);
    color: var(--console-btn-text);
    font-weight: 700;
    box-shadow: 0 2px 12px var(--console-cyan-glow);
    border: 1px solid var(--console-cyan);
}

.btn-console-primary:hover:not(:disabled) {
    background: var(--console-accent-hover);
    box-shadow: 0 4px 18px var(--console-cyan-glow);
    transform: translateY(-1px);
}

.btn-console-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 6px var(--console-cyan-glow);
}

.btn-console-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.shortcut-kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--editor-font);
    color: var(--console-btn-text);
    background: rgba(255, 255, 255, 0.30);
    border-radius: 4px;
    margin-left: 2px;
}

.btn-console-ghost {
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    color: var(--console-text-secondary);
}

.btn-console-ghost:hover:not(:disabled) {
    background: var(--console-panel-header-bg);
    color: var(--console-text-primary);
    border-color: var(--console-border-hover);
}

.btn-console-danger:hover:not(:disabled) {
    color: var(--console-danger);
    background: rgba(244, 63, 94, 0.10);
    border-color: rgba(244, 63, 94, 0.25);
}

.editor-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--console-text-muted);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--console-success);
}

.editor-status.status--running .status-dot {
    background: var(--console-cyan);
    animation: statusPulse 1.2s infinite ease-in-out;
}

.editor-status.status--error .status-dot {
    background: var(--console-danger);
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* =========================================================
   7. QUESTION DETAILS PANEL
========================================================= */
.question-body {
    padding: 16px 20px;
}



.question-header {
    margin-bottom: 12px;
}

.question-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.question-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--console-text-primary);
    margin: 0;
    line-height: 1.35;
}

.category-chip {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--console-cyan);
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid var(--console-border-hover);
    border-radius: 6px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================================
   7. QUESTION DETAILS PANEL: NOTE-BASED THEME STRUCTURE
========================================================= */
.question-body {
    padding: 16px 18px;
}

.question-note-view {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.question-note-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--console-border);
}

.question-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.question-category-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--console-cyan);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
}

.sql-practice-console[data-theme="white"] .question-category-tag {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0284c7;
}

.question-note-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--console-text-primary);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

/* Open Note Document Flow (Supports Paragraphs, Bullets, Lists, Notes) */
.question-note-doc {
    width: 100%;
}

.question-statement-body {
    font-size: 0.94rem;
    line-height: 1.7;
    color: var(--console-text-primary);
}

.question-statement-body p,
.note-p {
    margin: 0 0 14px 0;
    color: var(--console-text-primary);
    line-height: 1.7;
    font-size: 0.94rem;
}

.question-statement-body p:last-child,
.note-p:last-child {
    margin-bottom: 0;
}

/* Note Bullet Lists */
.question-statement-body ul,
.note-ul {
    margin: 10px 0 14px 0;
    padding-left: 20px;
    list-style: none;
}

.question-statement-body ul li,
.note-ul li {
    position: relative;
    padding-left: 6px;
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--console-text-primary);
    font-size: 0.92rem;
}

.question-statement-body ul li::before,
.note-ul li::before {
    content: "•";
    color: var(--console-cyan);
    font-weight: bold;
    font-size: 1.15em;
    position: absolute;
    left: -14px;
    top: -1px;
}

.sql-practice-console[data-theme="white"] .question-statement-body ul li::before,
.sql-practice-console[data-theme="white"] .note-ul li::before {
    color: #0284c7;
}

/* Numbered / Ordered Lists */
.question-statement-body ol,
.note-ol {
    margin: 10px 0 14px 0;
    padding-left: 22px;
}

.question-statement-body ol li,
.note-ol li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--console-text-primary);
    font-size: 0.92rem;
}

/* Note Callouts (Tips, Hints, Constraints) */
.note-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(0, 229, 255, 0.05);
    border-left: 3px solid var(--console-cyan);
    padding: 12px 14px;
    border-radius: 0 8px 8px 0;
    margin: 14px 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--console-text-secondary);
}

.note-callout i {
    color: var(--console-cyan);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.sql-practice-console[data-theme="white"] .note-callout {
    background: rgba(2, 132, 199, 0.05);
    border-left-color: #0284c7;
    color: #334155;
}

.sql-practice-console[data-theme="white"] .note-callout i {
    color: #0284c7;
}

/* Inline Code in Notes - Clean, normal readable font with NO border */
.question-statement-body code,
.note-code {
    font-family: inherit;
    font-size: 0.96em;
    font-weight: 600;
    padding: 0 3px;
    border: none !important;
    background: transparent !important;
    color: var(--console-cyan, #38bdf8);
}

.sql-practice-console[data-theme="white"] .question-statement-body code,
.sql-practice-console[data-theme="white"] .note-code {
    background: transparent !important;
    border: none !important;
    color: #0284c7;
}

/* Tokens and highlights in question text - Clean, readable, NO borders, normal font flow */
.hl-token {
    display: inline;
    padding: 0;
    margin: 0;
    border: none !important;
    background: transparent !important;
    border-radius: 0;
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    box-shadow: none !important;
}

.hl-token i {
    display: none !important;
}

.hl-token.hl-table,
.hl-token.hl-col,
.hl-token.hl-condition,
.hl-token.hl-num,
.hl-token.hl-keyword {
    border: none !important;
    background: transparent !important;
    color: inherit;
    font-weight: 600;
}

.sql-practice-console[data-theme="white"] .hl-token.hl-table,
.sql-practice-console[data-theme="white"] .hl-token.hl-col,
.sql-practice-console[data-theme="white"] .hl-token.hl-condition,
.sql-practice-console[data-theme="white"] .hl-token.hl-num,
.sql-practice-console[data-theme="white"] .hl-token.hl-keyword {
    border: none !important;
    background: transparent !important;
    color: inherit;
}

/* =========================================================
   8. TABLE SCHEMA PANEL
========================================================= */
.schema-body {
    padding: 0;
}

.schema-selector-wrapper {
    display: inline-flex;
    align-items: center;
}

.schema-table-select {
    background: var(--console-panel-header-bg);
    border: 1px solid var(--console-border);
    color: var(--console-cyan);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.18s ease;
}

.schema-table-select:focus {
    border-color: var(--console-cyan);
}

.schema-table-select option {
    background: var(--console-panel-bg);
    color: var(--console-text-primary);
}

.pk-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.datatype-tag {
    font-family: var(--editor-font);
    font-size: 0.74rem;
    color: var(--console-cyan);
    background: rgba(2, 132, 199, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--console-border);
}

/* =========================================================
   9. QUERY RESULTS PANEL & STATES
========================================================= */
.results-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-family: var(--editor-font);
}

.meta-tag {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.meta-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.meta-count {
    color: var(--console-text-primary);
}

.meta-time {
    color: var(--console-text-muted);
}

/* RESULTS PANEL ACTION BUTTONS (TEST RESULT & CLEAR RESULT) */
.btn-panel-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    font-size: 0.74rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
    vertical-align: middle;
}

.btn-panel-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* 1. SOLID PROMINENT GREEN BUTTON FORMAT FOR TEST RESULT */
.btn-panel-test {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid #10b981;
    color: #ffffff !important;
    font-weight: 700;
    padding: 0 13px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.btn-panel-test:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    border-color: #34d399;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.50);
    transform: translateY(-1px);
}

.btn-panel-test:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.30);
}

.btn-panel-test i {
    font-size: 0.88rem;
}

/* 2. CLEAR RESULT BUTTON */
.btn-panel-clear {
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    color: var(--console-text-secondary);
    font-weight: 600;
    padding: 0 11px;
}

.btn-panel-clear:hover:not(:disabled) {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.35);
    box-shadow: 0 2px 8px rgba(251, 113, 133, 0.20);
    transform: translateY(-1px);
}

.btn-panel-clear:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-panel-clear i {
    font-size: 0.84rem;
}

/* White Theme button tweaks */
.sql-practice-console[data-theme="white"] .btn-panel-test {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.sql-practice-console[data-theme="white"] .btn-panel-test:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.sql-practice-console[data-theme="white"] .btn-panel-clear {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.sql-practice-console[data-theme="white"] .btn-panel-clear:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.30);
    color: #e11d48;
}

/* TEST FEEDBACK BANNER */
.test-feedback-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 10px 14px 4px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    animation: bannerSlideDown 0.2s ease-out;
    flex-shrink: 0;
}

@keyframes bannerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-feedback-banner.test-pass {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.test-feedback-banner.test-pass .test-banner-icon {
    color: #10b981;
    font-size: 1.15rem;
}

.test-feedback-banner.test-fail {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.test-feedback-banner.test-fail .test-banner-icon {
    color: #f59e0b;
    font-size: 1.15rem;
}

.test-feedback-banner.test-error {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #f87171;
}

.test-feedback-banner.test-error .test-banner-icon {
    color: #f43f5e;
    font-size: 1.15rem;
}

.test-banner-content {
    flex: 1 1 auto;
}

.test-banner-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.test-banner-details {
    font-size: 0.76rem;
    opacity: 0.9;
}

.test-banner-close {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.7;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.test-banner-close:hover {
    opacity: 1;
}

/* Result States */
.results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    margin: auto;
    max-width: 440px;
}

.state-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    display: grid;
    place-items: center;
    color: var(--console-cyan);
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.results-state h3 {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--console-text-primary);
    margin: 0 0 6px 0;
}

.results-state p {
    font-size: 0.80rem;
    color: var(--console-text-muted);
    line-height: 1.5;
    margin: 0;
}

.results-state kbd {
    background: var(--console-panel-bg);
    border: 1px solid var(--console-border);
    border-radius: 4px;
    padding: 1px 4px;
    font-family: var(--editor-font);
    font-size: 0.74rem;
    color: var(--console-text-primary);
}

/* Loading state spinner */
.state-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--console-border);
    border-top-color: var(--console-cyan);
    border-radius: 50%;
    animation: spinnerSpin 0.75s linear infinite;
    margin-bottom: 14px;
}

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

/* Error State */
.results-error-state {
    width: 100%;
    max-width: 600px;
    padding: 24px;
}

.error-banner {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: 10px;
    padding: 14px 18px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f43f5e;
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.error-message {
    font-family: var(--editor-font);
    font-size: 0.80rem;
    color: #f87171;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* =========================================================
   10. COMMON CONSOLE TABLE (RESULTS & SCHEMA)
========================================================= */
.table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--console-border-hover) transparent;
}

.table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--console-border-hover);
    border-radius: 4px;
}

.console-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.80rem;
    color: var(--console-text-primary);
    white-space: nowrap;
}

.console-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--console-table-th-bg);
}

.console-table th {
    padding: 9px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--console-text-secondary);
    border-bottom: 1px solid var(--console-border);
    border-right: 1px solid var(--console-border);
    user-select: none;
}

.console-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--console-border);
    border-right: 1px solid var(--console-border);
    font-family: var(--editor-font);
    font-size: 0.80rem;
    color: var(--console-code-color);
}

.console-table tr:hover td {
    background: var(--console-table-hover);
}

.console-table .cell-row-num {
    color: var(--console-text-dim);
    text-align: right;
    user-select: none;
    width: 44px;
    min-width: 44px;
}

.console-table .cell-null {
    color: var(--console-text-muted);
    font-style: italic;
    opacity: 0.75;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {

    .sql-practice-console,
    .workspace-col,
    .console-panel,
    .btn-console,
    .btn-console-tool,
    .theme-menu {
        transition: none !important;
        animation: none !important;
    }
}

/* =========================================================
   11. RESPONSIVE BREAKPOINTS
========================================================= */
@media (max-width: 992px) {
    .sql-practice-console {
        height: auto;
        min-height: auto;
        overflow: visible;
        margin: -1.25rem;
        padding: 14px 16px;
    }

    .practice-workspace {
        flex-direction: column;
        height: auto;
        overflow: visible;
        gap: 16px;
    }

    .workspace-col {
        width: 100% !important;
        flex: none !important;
    }

    .resize-handle {
        display: none !important;
    }

    .btn-restore-info {
        display: none !important;
    }

    .console-panel {
        height: auto !important;
        min-height: 240px;
    }

    .sql-editor-panel {
        height: 320px !important;
    }

    .results-panel {
        min-height: 280px !important;
    }

    .question-panel {
        min-height: 200px !important;
    }

    .schema-panel {
        min-height: 220px !important;
    }

    .console-topbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        gap: 10px;
        margin-bottom: 14px;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .editor-actions-left {
        gap: 4px;
    }

    .btn-console {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .shortcut-kbd {
        display: none;
    }

    .console-utilities {
        gap: 4px;
    }

    .btn-console-tool {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}

animation: none !important;
}
}

/* =========================================================
   11. RESPONSIVE BREAKPOINTS
========================================================= */
@media (max-width: 992px) {
    .sql-practice-console {
        height: auto;
        min-height: auto;
        overflow: visible;
        margin: -1.25rem;
        padding: 14px 16px;
    }

    .practice-workspace {
        flex-direction: column;
        height: auto;
        overflow: visible;
        gap: 16px;
    }

    .workspace-col {
        width: 100% !important;
        flex: none !important;
    }

    .resize-handle {
        display: none !important;
    }

    .btn-restore-info {
        display: none !important;
    }

    .console-panel {
        height: auto !important;
        min-height: 240px;
    }

    .sql-editor-panel {
        height: 320px !important;
    }

    .results-panel {
        min-height: 280px !important;
    }

    .question-panel {
        min-height: 200px !important;
    }

    .schema-panel {
        min-height: 220px !important;
    }

    .console-topbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        gap: 10px;
        margin-bottom: 14px;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .editor-actions-left {
        gap: 4px;
    }

    .btn-console {
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    .shortcut-kbd {
        display: none;
    }

    .console-utilities {
        gap: 4px;
    }

    .btn-console-tool {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
}

/* =========================================================
   12. ANTI-COPY & ANTI-PASTE PROTECTION SYSTEM
========================================================= */

/* Disable text selection and callouts on question panel and all children */
.no-copy-panel,
.no-copy-panel *,
.question-panel,
.question-panel *,
.question-note-view,
.question-note-view *,
.question-statement-body,
.question-statement-body *,
.unselectable,
.unselectable * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

.question-panel {
    cursor: default;
}

/* Warning status dot state */
.editor-status.status--warning .status-dot {
    background: var(--console-warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

/* Protection Floating Toast Notification */
.console-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(11, 19, 36, 0.96);
    border: 1px solid rgba(244, 63, 94, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(244, 63, 94, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f8fafc;
    padding: 11px 22px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.console-toast.toast-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.console-toast i {
    color: #f43f5e;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sql-practice-console[data-theme="soft-light"] .console-toast,
.sql-practice-console[data-theme="white"] .console-toast {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 16px rgba(244, 63, 94, 0.2);
}

/* =========================================================
   13. CONTINUOUS LIVE SOLVING TIMER (ATTRACTIVE RED ACCENT)
========================================================= */
.console-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(15, 23, 42, 0.90);
    border: 1px solid rgba(244, 63, 94, 0.45);
    border-radius: 20px;
    padding: 3px 12px 3px 8px;
    font-size: 0.74rem;
    color: #fecdd3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(244, 63, 94, 0.22);
    transition: all 0.22s ease;
    user-select: none;
    margin-left: 6px;
}

.console-timer:hover {
    border-color: #f43f5e;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.45);
}

.timer-icon-wrap {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f43f5e;
    font-size: 0.78rem;
}

.timer-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fb7185;
}

.timer-digits {
    font-family: var(--editor-font);
    font-weight: 800;
    font-size: 0.84rem;
    color: #ffffff;
    letter-spacing: 0.06em;
    min-width: 44px;
    text-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.timer-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e, 0 0 12px #f43f5e;
    animation: redTimerPulse 1.2s infinite ease-in-out;
}

@keyframes redTimerPulse {

    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.35);
    }
}

.sql-practice-console[data-theme="soft-light"] .console-timer,
.sql-practice-console[data-theme="white"] .console-timer {
    background: #ffffff;
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.15);
}

.sql-practice-console[data-theme="soft-light"] .timer-digits,
.sql-practice-console[data-theme="white"] .timer-digits {
    color: #e11d48;
    text-shadow: none;
}

/* =========================================================
   14. TEST CASE EVALUATION CONTAINER (OUR OWN CLEAN STYLE)
========================================================= */
.testcase-check-container {
    background: rgba(11, 19, 36, 0.94);
    border: 1px solid var(--console-border);
    border-radius: 10px;
    padding: 16px 18px;
    margin: 12px 14px 10px 14px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.18s ease-out;
    flex-shrink: 0;
}

.test-result-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.test-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.test-result-badge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.test-result-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.12);
    color: var(--console-cyan);
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.test-result-card.card-passed .test-result-icon-box {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.test-result-card.card-failed .test-result-icon-box {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
}

.test-result-headings {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.test-result-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--console-text-primary);
    line-height: 1.3;
}

.test-result-card.card-passed .test-result-title {
    color: #10b981;
}

.test-result-card.card-failed .test-result-title {
    color: #f43f5e;
}

.test-result-subtitle {
    margin: 0;
    font-size: 0.80rem;
    color: var(--console-text-muted);
}

.test-result-card.card-passed .test-result-subtitle {
    color: #a7f3d0;
}

.test-result-card.card-failed .test-result-subtitle {
    color: #fca5a5;
}

.btn-dismiss-testcase {
    background: transparent;
    border: none;
    color: var(--console-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.btn-dismiss-testcase:hover {
    color: var(--console-text-primary);
}

/* VALIDATION METRICS ROW */
.test-metrics-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.test-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--console-border);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
}

.metric-label {
    color: var(--console-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.metric-value {
    color: var(--console-text-primary);
    font-weight: 700;
}

.test-result-card.card-passed .metric-value {
    color: #10b981;
}

.test-result-card.card-failed #valMetricStatus,
.test-result-card.card-failed #valMetricMatch {
    color: #f43f5e;
}

/* FEEDBACK BOX */
.testcase-feedback-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.5;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--console-border);
}

.testcase-feedback-box.feedback-failed {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.08);
    color: #fca5a5;
}

.testcase-feedback-box.feedback-failed .feedback-icon {
    color: #f43f5e;
    font-size: 0.90rem;
    margin-top: 1px;
}

.testcase-feedback-box.feedback-passed {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    color: #a7f3d0;
}

.testcase-feedback-box.feedback-passed .feedback-icon {
    color: #10b981;
    font-size: 0.90rem;
    margin-top: 1px;
}

/* NEXT QUESTION & RANK LIST ACTION BUTTONS ROW */
.test-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 14px;
}

.btn-next-clean {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10b981 !important;
    border: 1px solid #059669 !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 7px 18px;
    border-radius: 6px;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: background 0.18s ease, transform 0.12s ease;
}

.btn-next-clean:hover {
    background: #059669 !important;
    transform: translateY(-1px);
}

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

.btn-next-clean i {
    font-size: 0.86rem;
    transition: transform 0.15s ease;
}

.btn-next-clean:hover i {
    transform: translateX(3px);
}

/* RANK LIST BUTTON (GOLD ACCENT, CLEAN SLEEK STYLE) */
.btn-rank-clean {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(245, 158, 11, 0.14) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #fbbf24 !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    transition: all 0.18s ease;
    user-select: none;
}

.btn-rank-clean:hover {
    background: rgba(245, 158, 11, 0.26) !important;
    border-color: #f59e0b !important;
    color: #fef08a !important;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

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

.btn-rank-clean i {
    color: #f59e0b;
    font-size: 0.88rem;
}

/* TIMER STOPPED STATE (AFTER TEST PASS) */
.console-timer.timer-stopped {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.3) !important;
}

.console-timer.timer-stopped .timer-icon-wrap {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #10b981 !important;
}

.console-timer.timer-stopped .timer-label {
    color: #6ee7b7 !important;
}

.console-timer.timer-stopped .timer-digits {
    color: #34d399 !important;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4) !important;
}

.console-timer.timer-stopped .timer-pulse-dot {
    background: #10b981 !important;
    box-shadow: 0 0 8px #10b981 !important;
    animation: none !important;
    opacity: 0.8 !important;
}

/* =========================================================
   15. CLASH OF CLANS THEMED INLINE LEADERBOARD (QUERY SIDE)
========================================================= */
.coc-rank-container {
    width: 100%;
    animation: cocFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cocFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coc-rank-card {
    background: radial-gradient(circle at 50% 0%, #15223e 0%, #0a0f1d 85%);
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(254, 240, 138, 0.25);
    overflow: hidden;
}

/* HEADER */
.coc-rank-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-bottom: 1.5px solid rgba(245, 158, 11, 0.35);
}

.coc-rank-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coc-trophy-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
    color: #451a03;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid #fde68a;
    flex-shrink: 0;
}

.coc-rank-headings {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coc-rank-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coc-tag-clash {
    font-size: 0.60rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    background: linear-gradient(90deg, #dc2626 0%, #ea580c 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.4);
}

.coc-rank-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #fef08a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 0.02em;
}

.coc-rank-subtitle {
    margin: 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

.coc-btn-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.90rem;
    transition: all 0.18s ease;
}

.coc-btn-close:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    transform: scale(1.05);
}

/* USER BANNER */
.coc-user-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 16px 4px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(14, 165, 233, 0.14) 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.coc-user-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coc-shield-mini {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.coc-user-banner-status {
    font-size: 0.76rem;
    font-weight: 700;
    color: #a7f3d0;
}

.coc-user-banner-meta {
    font-size: 0.68rem;
    color: #6ee7b7;
}

.coc-user-banner-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-code, 'Fira Code', monospace);
    font-size: 0.95rem;
    font-weight: 800;
    color: #34d399;
}

/* TOP 3 PODIUM SECTION */
.coc-podium-section {
    padding: 10px 16px 12px;
}

.coc-podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-top: 6px;
}

.coc-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 105px;
    text-align: center;
}

.coc-crown-wrap {
    height: 18px;
    margin-bottom: -2px;
}

.coc-crown-icon {
    font-size: 1.25rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
    animation: cocCrownBob 2s ease-in-out infinite alternate;
}

@keyframes cocCrownBob {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-3px);
    }
}

.coc-avatar-frame {
    position: relative;
    border-radius: 50%;
    padding: 3px;
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
}

.coc-avatar-frame.frame-gold {
    border: 2.5px solid #fbbf24;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.6), inset 0 0 8px rgba(251, 191, 36, 0.4);
}

.coc-avatar-frame.frame-silver {
    border: 2px solid #cbd5e1;
    box-shadow: 0 0 10px rgba(203, 213, 225, 0.4);
}

.coc-avatar-frame.frame-bronze {
    border: 2px solid #d97706;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.coc-avatar-img-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frame-gold .coc-avatar-img-wrap {
    width: 56px;
    height: 56px;
}

.coc-avatar-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.coc-avatar-letter {
    font-weight: 800;
    font-size: 1.15rem;
    color: #94a3b8;
}

.frame-gold .coc-avatar-letter {
    color: #fbbf24;
    font-size: 1.3rem;
}

.coc-medal {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.medal-gold {
    background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
    color: #451a03;
}

.medal-silver {
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    color: #0f172a;
}

.medal-bronze {
    background: linear-gradient(135deg, #fb923c 0%, #b45309 100%);
    color: #ffffff;
}

.coc-podium-player {
    font-size: 0.74rem;
    font-weight: 700;
    color: #e2e8f0;
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coc-podium-player.player-gold {
    color: #fef08a;
    font-weight: 800;
    font-size: 0.78rem;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.coc-podium-time {
    font-family: var(--font-code, monospace);
    font-size: 0.70rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 4px;
}

.coc-podium-time.time-gold {
    color: #34d399;
    font-weight: 800;
}

/* PODIUM PILLARS */
.coc-pillar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.pillar-gold {
    height: 70px;
    background: linear-gradient(180deg, #d97706 0%, #78350f 100%);
    border: 1px solid #f59e0b;
    border-bottom: none;
}

.pillar-silver {
    height: 52px;
    background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
    border: 1px solid #94a3b8;
    border-bottom: none;
}

.pillar-bronze {
    height: 40px;
    background: linear-gradient(180deg, #92400e 0%, #451a03 100%);
    border: 1px solid #b45309;
    border-bottom: none;
}

.pillar-label {
    font-weight: 900;
    font-size: 0.80rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* TABLE SECTION */
.coc-table-wrap {
    padding: 0 16px 12px;
}

.coc-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.coc-table-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coc-total-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.coc-table-scroll {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 8px 8px;
    background: rgba(10, 15, 29, 0.8);
}

.coc-rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.coc-rank-table th {
    position: sticky;
    top: 0;
    background: #0f172a;
    padding: 8px 12px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    z-index: 2;
}

.coc-rank-table th.th-rank {
    width: 55px;
    text-align: center;
}

.coc-rank-table th.th-time {
    text-align: right;
    width: 130px;
}

.coc-rank-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    vertical-align: middle;
}

.coc-rank-table tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.coc-rank-table tr.coc-row-current {
    background: rgba(16, 185, 129, 0.12) !important;
    border-left: 3px solid #10b981;
}

.coc-rank-table tr.coc-row-current td {
    color: #a7f3d0;
    font-weight: 700;
}

/* SHIELD RANK BADGES */
.coc-shield-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.coc-shield-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);
    color: #451a03;
    border-color: #fde68a;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.coc-shield-2 {
    background: linear-gradient(135deg, #e2e8f0 0%, #64748b 100%);
    color: #0f172a;
    border-color: #ffffff;
}

.coc-shield-3 {
    background: linear-gradient(135deg, #f97316 0%, #9a3412 100%);
    color: #ffffff;
    border-color: #fdba74;
}

.coc-shield-other {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.08);
}

/* USER CELL */
.coc-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coc-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.coc-user-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #334155;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.coc-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.coc-user-name {
    font-weight: 700;
    color: #f1f5f9;
}

.coc-user-handle {
    font-size: 0.68rem;
    color: #64748b;
}

.coc-badge-you {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: #10b981;
    color: #ffffff;
    margin-left: 6px;
    vertical-align: middle;
}

/* TIME CELL */
.coc-time-cell {
    font-family: var(--font-code, monospace);
    font-weight: 700;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.coc-time-cell i {
    color: #64748b;
    font-size: 0.78rem;
}

.coc-time-fastest {
    color: #fbbf24 !important;
}

.coc-time-fastest i {
    color: #fbbf24 !important;
}

/* FOOTER */
.coc-rank-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.coc-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    padding: 6px 14px;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.coc-btn-back:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}