/* ==========================================================================
   SPARK IDE - NEXT-GEN MAHARASHTRA HSC ONLINE COMPILER STYLESHEET
   Developed for 12th HSC IT & CS Students
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg-darkest: #070b14;
    --bg-dark: #0d1322;
    --sidebar-bg: #111827;
    --editor-bg: #090e1a;
    --header-bg: #131b2e;
    --card-bg: #1e293b;
    --card-hover: #27354f;
    
    --accent: #38bdf8;
    --accent-hover: #0284c7;
    --accent-glow: rgba(56, 189, 248, 0.35);
    
    --purple: #8b5cf6;
    --purple-hover: #7c3aed;
    --purple-glow: rgba(139, 92, 246, 0.35);

    --success: #10b981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.35);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.14);
    
    --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-code: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-darkest);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Main Container */
.ide-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--bg-darkest);
}

/* ==========================================================================
   HEADER / TOP TOOLBAR
   ========================================================================== */
header.spark-header {
    background: linear-gradient(180deg, #162035 0%, #0f172a 100%);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    height: 52px;
    z-index: 100;
    gap: 12px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.spark-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spark-logo .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 6px;
    color: #fff;
    -webkit-text-fill-color: #fff;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.hsc-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-code);
    padding-left: 10px;
    border-left: 1px solid var(--border);
}
.breadcrumb-path b {
    color: #e2e8f0;
}

/* Header Controls Toolbar */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
    user-select: none;
}
.btn:active {
    transform: scale(0.97);
}

/* Glowing Run Button */
.btn-run {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 0 12px var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-weight: 700;
    padding: 6px 16px;
}
.btn-run:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 0 18px var(--success-glow);
    transform: translateY(-1px);
}

.btn-save {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.btn-save:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 0 12px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-light);
    color: #fff;
}

.btn-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.4);
}
.btn-purple:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    box-shadow: 0 0 12px var(--purple-glow);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: #ef4444;
    color: white;
}

/* User Pill / Account Area */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}
.user-pill img {
    border-radius: 50%;
    border: 1.5px solid var(--accent);
}
.guest-tag {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
}

/* Dropdown Menu styling */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #162035;
    min-width: 200px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 6px 0;
    backdrop-filter: blur(8px);
}
.dropdown.show .dropdown-menu {
    display: block;
    animation: fadeInSlide 0.15s ease-out;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.dropdown-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent);
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

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

/* ==========================================================================
   MAIN IDE WORKSPACE (3-COLUMN LAYOUT)
   ========================================================================== */
main.spark-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    height: calc(100vh - 52px - 26px);
}

/* Sidebar (Left) */
.sidebar {
    width: 250px;
    min-width: 200px;
    max-width: 380px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    user-select: none;
    transition: width 0.2s ease;
}

.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.sidebar-section-header .section-title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-section-header .section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-section-header .icon-btn {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 2px 4px;
}
.sidebar-section-header .icon-btn:hover {
    color: var(--accent);
}

.sidebar-actions-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}
.sidebar-actions-bar .btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.sidebar-actions-bar .btn-action:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--accent);
}

/* File Tree View */
.file-tree-container {
    padding: 6px 0;
    flex: 1;
    overflow-y: auto;
}

.file-tree-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.folder-details summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    cursor: pointer;
    list-style: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
    transition: background 0.15s;
}
.folder-details summary::-webkit-details-marker { display: none; }
.folder-details summary:hover { background: rgba(255, 255, 255, 0.04); }
.folder-details[open] > summary .arrow { transform: rotate(90deg); }
.folder-details .arrow {
    transition: transform 0.15s ease;
    display: inline-block;
}

.folder-actions, .file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}
.folder-details summary:hover .folder-actions,
.file-item:hover .file-actions {
    opacity: 1;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px 6px 28px;
    font-size: 12.5px;
    font-family: var(--font-code);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}
.file-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
}
.file-item.active {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-left-color: var(--accent);
    font-weight: 600;
}

.file-name-group {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-icon {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.file-icon.html { color: #f97316; }
.file-icon.css { color: #38bdf8; }
.file-icon.js { color: #facc15; }
.file-icon.php { color: #a855f7; }
.file-icon.json { color: #4ade80; }
.file-icon.sql { color: #06b6d4; }
.file-icon.default { color: #94a3b8; }

.action-icon {
    color: var(--text-muted);
    font-size: 11.5px;
    cursor: pointer;
    padding: 3px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
.action-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.action-icon.rename-btn:hover { color: var(--accent); }
.action-icon.delete-btn:hover { color: var(--danger); }

/* Cloud section inside sidebar */
.cloud-accordion {
    border-top: 1px solid var(--border);
    margin-top: 10px;
}

/* Student Practical Helper Card in Sidebar */
.hsc-tips-card {
    margin: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    font-size: 11.5px;
    color: #94a3b8;
}
.hsc-tips-card strong {
    color: #38bdf8;
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
}
.hsc-tips-card ul {
    padding-left: 16px;
    margin-top: 6px;
    line-height: 1.5;
}

/* ==========================================================================
   CENTER EDITOR PANE
   ========================================================================== */
.editor-container {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    background-color: var(--editor-bg);
    border-right: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.editor-header {
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    padding: 0 10px;
    user-select: none;
}

.editor-tabs-strip {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    height: 100%;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 38px;
    background: #0b1120;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-code);
    border-right: 1px solid var(--border);
    border-top: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.editor-tab.active {
    background: var(--editor-bg);
    color: #f8fafc;
    border-top-color: var(--accent);
    font-weight: 600;
}
.editor-tab .close-tab {
    font-size: 11px;
    color: var(--text-muted);
    border-radius: 3px;
    padding: 2px;
}
.editor-tab .close-tab:hover {
    color: var(--danger);
}
.editor-tab .dirty-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    display: none;
}
.editor-tab.dirty .dirty-indicator {
    display: inline-block;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
}
.editor-toolbar .tool-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
}
.editor-toolbar .tool-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Editor Wrapper & Line Numbers */
.editor-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.line-numbers {
    width: 44px;
    background: #0b1120;
    color: #475569;
    padding: 12px 6px;
    font-family: var(--font-code);
    font-size: 13.5px;
    line-height: 1.55;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border);
    overflow: hidden;
    white-space: pre;
}

#code-editor {
    flex: 1;
    background: transparent;
    color: #e2e8f0;
    border: none;
    padding: 12px 14px;
    font-family: var(--font-code);
    font-size: 13.5px;
    line-height: 1.55;
    outline: none;
    resize: none;
    white-space: pre;
    word-break: normal;
    tab-size: 4;
    overflow: auto;
    caret-color: #38bdf8;
}

#code-editor::placeholder {
    color: #334155;
    font-style: italic;
}

/* ==========================================================================
   RIGHT PREVIEW & CONSOLE PANE
   ========================================================================== */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.preview-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    height: 38px;
    padding: 0 10px;
    user-select: none;
}

.preview-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.preview-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 38px;
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.preview-tab-btn:hover {
    color: #f1f5f9;
}
.preview-tab-btn.active {
    color: var(--accent);
    border-top-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}
.badge-count.error {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.preview-controls .icon-action {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
}
.preview-controls .icon-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.preview-controls .icon-action.active {
    color: var(--accent);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Viewport & Frame */
.preview-viewport-frame {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #020617;
    overflow: auto;
    position: relative;
}

#output-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    transition: width 0.25s ease, max-width 0.25s ease;
}

/* Responsive Device Simulation Modes */
.viewport-desktop #output-frame {
    width: 100%;
}
.viewport-tablet #output-frame {
    width: 768px;
    max-width: 95%;
    margin-top: 15px;
    height: calc(100% - 30px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    border: 8px solid #1e293b;
}
.viewport-mobile #output-frame {
    width: 375px;
    max-width: 95%;
    margin-top: 15px;
    height: calc(100% - 30px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    border: 10px solid #1e293b;
}

/* Console Panel Drawer */
.console-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    background: #090e1a;
    font-family: var(--font-code);
    font-size: 12.5px;
    overflow: hidden;
}
.console-panel.active {
    display: flex;
}

.console-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #0f172a;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
}
.console-filters {
    display: flex;
    gap: 8px;
}
.filter-chip {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
}
.filter-chip.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
}

.console-output-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.console-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1.45;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.console-msg.log { color: #cbd5e1; }
.console-msg.info { color: #38bdf8; background: rgba(56, 189, 248, 0.05); }
.console-msg.warn { color: #facc15; background: rgba(250, 204, 21, 0.05); }
.console-msg.error { color: #f87171; background: rgba(248, 113, 113, 0.08); }

.console-time {
    color: #475569;
    font-size: 10.5px;
    flex-shrink: 0;
    margin-top: 1px;
}
.console-text {
    flex: 1;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ==========================================================================
   MODAL WINDOWS & DIALOG SYSTEM
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(6px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.show {
    opacity: 1;
    display: flex;
}

.modal-card {
    background: #111827;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    width: 440px;
    max-width: 95%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: translateY(-16px);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-ui);
}
.modal-overlay.show .modal-card {
    transform: translateY(0);
}

.modal-header {
    background: #162035;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.15s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.modal-header .close-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.modal-body {
    padding: 18px;
}

.modal-footer {
    padding: 12px 18px;
    background: #162035;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Side-by-Side File Creator Form Controls */
.form-group {
    margin-bottom: 14px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.side-by-side-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.side-by-side-input input[type="text"],
.side-by-side-input input[type="password"],
.auth-input,
.url-box {
    flex: 1;
    padding: 9px 12px;
    background: #090e1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-code);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.side-by-side-input input:focus,
.auth-input:focus,
.url-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.extension-select {
    width: 125px;
    padding: 9px 10px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    color: #38bdf8;
    font-family: var(--font-code);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.extension-select:focus {
    border-color: var(--accent);
}

.input-helper-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}
.input-helper-text b {
    color: var(--accent);
}

/* Template Picker Cards */
.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.template-card {
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.template-card:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
}
.template-card .tpl-title {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
}
.template-card .tpl-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ==========================================================================
   STATUS BAR (BOTTOM) - VINIT BRANDING IN EXACT CENTER
   ========================================================================== */
.spark-status-bar {
    height: 28px;
    background: #0b1120;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    color: var(--text-muted);
    user-select: none;
    z-index: 100;
}
.spark-status-bar a {
    color: var(--text-secondary);
    text-decoration: none;
}
.status-left {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: start;
}
.status-center {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: center;
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}
.status-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.vinit-pill {
    font-weight: 700;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12);
    padding: 2px 9px;
    border-radius: 5px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}
.vinit-pill:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}
.beating-heart {
    color: #f87171;
    margin: 0 3px;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15%, 45% { transform: scale(1.25); }
    30% { transform: scale(1); }
}

/* ==========================================================================
   MODERN AUTH MODAL (LOGIN & SIGNUP)
   ========================================================================== */
.auth-card-modern {
    background: linear-gradient(180deg, #111827 0%, #0d1322 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(56, 189, 248, 0.18);
    border-radius: 16px;
    width: 410px;
    max-width: 95%;
    overflow: hidden;
}

.auth-header-hero {
    text-align: center;
    padding: 24px 20px 14px;
    background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.auth-logo-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    margin-bottom: 10px;
}
.auth-hero-title {
    font-size: 18px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.auth-hero-subtitle {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.auth-tabs-pill {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 16px 20px 14px;
}
.auth-tab-pill-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.auth-tab-pill-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
}

.auth-input-group {
    position: relative;
    margin-bottom: 14px;
}
.auth-input-label {
    display: block;
    margin-bottom: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
}
.auth-input-icon {
    position: absolute;
    left: 12px;
    top: 34px;
    color: #64748b;
    font-size: 13px;
    pointer-events: none;
    transition: color 0.2s;
}
.auth-input-with-icon {
    width: 100%;
    padding: 10px 38px 10px 36px;
    background: #090e1a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}
.auth-input-with-icon:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    background: #0d1527;
}
.auth-input-group:focus-within .auth-input-icon {
    color: #38bdf8;
}
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 34px;
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 13px;
    transition: color 0.2s;
    padding: 2px;
}
.password-toggle-btn:hover {
    color: #38bdf8;
}

.auth-submit-btn {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}
.auth-submit-btn:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}
.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn.purple {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}
.auth-submit-btn.purple:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.guest-continue-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #94a3b8;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.guest-continue-link:hover {
    color: #38bdf8;
}

/* ==========================================================================
   STRICT PASTE BLOCKED FLOATING TOAST
   ========================================================================== */
.spark-paste-toast {
    position: fixed;
    top: 62px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(220, 38, 38, 0.95);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.spark-paste-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ==========================================================================
   MOBILE & RESPONSIVE ADAPTATIONS
   ========================================================================== */
@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 500;
        width: 260px;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6);
    }
    .sidebar.open {
        left: 0;
    }
    main.spark-main {
        flex-direction: column;
    }
    .editor-container {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}