/* =========================================
   CodeForge - Cyberpunk-inspired DSA Editor
   ========================================= */

:root {
    /* Core palette - Midnight with electric accents */
    --bg-void: #0a0a0f;
    --bg-deep: #0d0d14;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a24;
    --bg-hover: #22222e;
    
    /* Text hierarchy */
    --text-primary: #e8e8ed;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;
    --text-ghost: #3a3a4a;
    
    /* Accent colors - Electric cyan & magenta */
    --accent-primary: #00d4ff;
    --accent-secondary: #ff3d9a;
    --accent-success: #00ff88;
    --accent-warning: #ffb800;
    --accent-error: #ff4757;
    
    /* Difficulty colors */
    --difficulty-easy: #00ff88;
    --difficulty-medium: #ffb800;
    --difficulty-hard: #ff4757;
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #7b2fff 50%, #ff3d9a 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
    --gradient-surface: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-visible: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 212, 255, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.2);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 56px;
    --panel-min-width: 320px;
}

/* =========================================
   Reset & Base Styles
   ========================================= */

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* =========================================
   App Container & Layout
   ========================================= */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-void);
    position: relative;
}

/* Ambient background glow */
.app-container::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(123, 47, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 61, 154, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* =========================================
   Header
   ========================================= */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.4));
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-tabs {
    display: flex;
    gap: var(--space-xs);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-tab.active {
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

.nav-tab svg {
    opacity: 0.7;
}

.nav-tab.active svg {
    opacity: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.15) 0%, rgba(255, 61, 154, 0.15) 100%);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-warning);
}

.streak-badge svg {
    filter: drop-shadow(0 0 4px rgba(255, 184, 0, 0.5));
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* =========================================
   Main Content & Panels
   ========================================= */

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.panel {
    display: flex;
    flex-direction: column;
    min-width: var(--panel-min-width);
    overflow: hidden;
}

.problem-panel {
    flex: 0 0 45%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
}

.editor-panel {
    flex: 1;
    background: var(--bg-deep);
}

/* Resizer */
.resizer {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    transition: background var(--transition-fast);
}

.resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 40px;
    background: var(--bg-hover);
    border-radius: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.resizer:hover::after,
.resizer.dragging::after {
    opacity: 1;
}

.resizer:hover,
.resizer.dragging {
    background: var(--border-accent);
}

/* =========================================
   Problem Panel
   ========================================= */

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.problem-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.problem-dropdown {
    padding: var(--space-sm) var(--space-md);
    padding-right: 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border-visible);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all var(--transition-fast);
}

.problem-dropdown:hover {
    border-color: var(--accent-primary);
}

.problem-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.problem-dropdown option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.problem-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.difficulty {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty.easy {
    color: var(--difficulty-easy);
    background: rgba(0, 255, 136, 0.1);
}

.difficulty.medium {
    color: var(--difficulty-medium);
    background: rgba(255, 184, 0, 0.1);
}

.difficulty.hard {
    color: var(--difficulty-hard);
    background: rgba(255, 71, 87, 0.1);
}

.acceptance {
    color: var(--text-secondary);
    font-size: 12px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

/* Problem Content Styles */
.problem-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.problem-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.problem-description p {
    margin-bottom: var(--space-md);
}

.problem-description code {
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 2px 6px;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--accent-primary);
}

.example {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
}

.example-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.example-content {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
}

.example-content strong {
    color: var(--accent-secondary);
}

.example-content .value {
    color: var(--accent-primary);
}

.constraints {
    margin-top: var(--space-lg);
}

.constraints-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.constraints-list {
    list-style: none;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.constraints-list li {
    padding: var(--space-xs) 0;
    padding-left: var(--space-md);
    position: relative;
}

.constraints-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.topic-tag {
    padding: 4px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.topic-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* =========================================
   Editor Panel
   ========================================= */

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.language-dropdown {
    padding: 6px 12px;
    padding-right: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-visible);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all var(--transition-fast);
}

.language-dropdown:hover {
    border-color: var(--accent-primary);
}

.language-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.language-dropdown option {
    background: var(--bg-elevated);
}

.editor-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-visible);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.editor-container {
    flex: 1;
    overflow: hidden;
}

/* =========================================
   Console Area
   ========================================= */

.console-area {
    display: flex;
    flex-direction: column;
    height: 220px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.console-tabs {
    display: flex;
    gap: var(--space-xs);
}

.console-tab {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.console-tab:hover {
    color: var(--text-primary);
}

.console-tab.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.console-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-run {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-visible);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-run svg {
    color: var(--accent-success);
}

.btn-submit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--accent-success);
    border: none;
    border-radius: 6px;
    color: var(--bg-void);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.btn-submit:hover {
    background: #00e67a;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
    transform: translateY(-1px);
}

.btn-submit svg {
    stroke: var(--bg-void);
}

.console-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

/* Testcase Panel */
.testcase-panel {
    height: 100%;
}

.testcase-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.testcase-tab {
    padding: 6px 14px;
    background: var(--bg-hover);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.testcase-tab:hover {
    color: var(--text-primary);
}

.testcase-tab.active {
    background: var(--bg-elevated);
    border-color: var(--border-visible);
    color: var(--text-primary);
}

.add-testcase {
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed var(--border-visible);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.add-testcase:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.testcase-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-field {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    resize: vertical;
    min-height: 36px;
    transition: all var(--transition-fast);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-surface);
}

/* Result Panel */
.result-panel {
    height: 100%;
}

.result-panel.hidden {
    display: none;
}

.result-content {
    padding: var(--space-sm);
}

.result-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.result-status.accepted {
    color: var(--accent-success);
}

.result-status.rejected {
    color: var(--accent-error);
}

.result-status svg {
    width: 20px;
    height: 20px;
}

.result-status span {
    font-size: 16px;
    font-weight: 600;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.result-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-deep);
    border-radius: 6px;
}

.result-row .label {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 80px;
}

.result-row .value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.test-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.test-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-deep);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.test-result-item.passed {
    border-left-color: var(--accent-success);
}

.test-result-item.failed {
    border-left-color: var(--accent-error);
}

.test-result-item .test-name {
    font-weight: 500;
    min-width: 80px;
}

.test-result-item .test-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
}

.test-result-item.passed .test-status {
    color: var(--accent-success);
}

.test-result-item.failed .test-status {
    color: var(--accent-error);
}

.test-result-item .test-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Error styling */
.error-row {
    flex-direction: column;
    gap: var(--space-sm);
}

.error-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-error);
    background: rgba(255, 71, 87, 0.1);
    padding: var(--space-md);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    margin: 0;
}

/* Warning styling */
.warning-row {
    flex-direction: column;
    gap: var(--space-sm);
}

.warning-message {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-warning);
    background: rgba(255, 184, 0, 0.1);
    padding: var(--space-md);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 100px;
    overflow-y: auto;
    margin: 0;
    border-left: 3px solid var(--accent-warning);
}

.warning-row .label {
    color: var(--accent-warning);
}

.value.wrong {
    color: var(--accent-error);
}

/* Failed test case details */
.failed-details {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.failed-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

/* =========================================
   Loading Overlay
   ========================================= */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-hover);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* =========================================
   Editor Loading Overlay
   ========================================= */

.editor-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.editor-loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--bg-hover);
    border-top-color: var(--accent-primary);
    border-right-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* =========================================
   Success Modal
   ========================================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-visible);
    border-radius: 16px;
    padding: var(--space-xl);
    min-width: 360px;
    text-align: center;
    animation: slideUp 0.3s ease-out;
    box-shadow: var(--shadow-lg);
}

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

.success-modal .success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    background: rgba(0, 255, 136, 0.1);
    border-radius: 50%;
    color: var(--accent-success);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-modal h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-success);
    margin-bottom: var(--space-lg);
}

.success-stats {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.success-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: 12px;
    min-width: 120px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-percentile {
    font-size: 11px;
    color: var(--accent-primary);
}

.btn-primary {
    padding: 12px 32px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: var(--bg-void);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: #00b8e6;
    transform: translateY(-1px);
}

/* =========================================
   YouTube Subscribe Button
   ========================================= */

.youtube-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    background: #ff0000;
    border: none;
    border-radius: 20px;
    color: white;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.youtube-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.youtube-btn svg {
    flex-shrink: 0;
}

/* =========================================
   Videos View
   ========================================= */

.videos-view {
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.videos-view.hidden {
    display: none;
}

.videos-container {
    display: flex;
    height: 100%;
}

/* Playlists Sidebar */
.playlists-sidebar {
    width: 300px;
    min-width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.channel-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 6px;
    color: #ff4444;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.channel-link:hover {
    background: rgba(255, 0, 0, 0.2);
}

.playlists-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-xs);
}

.playlist-item:hover {
    background: var(--bg-hover);
}

.playlist-item.active {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-accent);
}

.playlist-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 8px;
}

.playlist-info {
    flex: 1;
    min-width: 0;
}

.playlist-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-count {
    font-size: 12px;
    color: var(--text-muted);
}

.playlist-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--transition-fast);
}

.playlist-item:hover .playlist-arrow,
.playlist-item.active .playlist-arrow {
    opacity: 1;
}

.playlist-item.active .playlist-arrow {
    color: var(--accent-primary);
}

/* Videos Main Content */
.videos-main {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    background: var(--bg-deep);
}

.current-playlist-header {
    margin-bottom: var(--space-xl);
}

.current-playlist-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.current-playlist-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Video Player Section */
.video-player-section {
    position: relative;
    margin-bottom: var(--space-xl);
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.video-player-section.hidden {
    display: none;
}

.close-player-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-player-btn:hover {
    background: rgba(255, 71, 87, 0.9);
    transform: scale(1.1);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-void);
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: var(--space-lg);
}

.video-info h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.video-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Video Player Title */
.video-player-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Video Tabs */
.video-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.video-tab {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.video-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.video-tab.active {
    background: var(--accent-primary);
    color: var(--bg-deep);
}

.video-tab.active svg {
    stroke: var(--bg-deep);
}

.tab-badge {
    background: var(--accent-secondary);
    color: var(--bg-deep);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.video-tab.active .tab-badge {
    background: var(--bg-deep);
    color: var(--accent-primary);
}

/* Tab Content */
.video-tab-content {
    padding: var(--space-lg);
    max-height: 400px;
    overflow-y: auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-empty {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-xl);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* About Tab */
.tab-panel .video-description,
#tabAbout .video-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
}

/* Playlist Tab */
.playlist-videos-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.playlist-video-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.playlist-video-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.playlist-video-item.current {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.1);
}

.playlist-video-thumb {
    width: 120px;
    height: 68px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-deep);
}

.playlist-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-video-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playlist-video-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.playlist-video-item.current .playlist-video-title {
    color: var(--accent-primary);
}

.playlist-video-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* Problems Tab */
.problems-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Problem Resource Item */
.problem-resource-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.problem-resource-item:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
}

.problem-resource-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.problem-resource-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.problem-resource-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.problem-resource-difficulty {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.problem-resource-difficulty.easy {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.problem-resource-difficulty.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.problem-resource-difficulty.hard {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.problem-resource-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-solve {
    padding: 6px 12px;
    background: var(--accent-primary);
    color: var(--bg-deep);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-solve:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

/* Responsive: Stack on smaller screens */
@media (max-width: 900px) {
    .video-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .video-resources {
        max-height: none;
    }
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.video-card {
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 212, 255, 0.2);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--bg-elevated);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    font-family: var(--font-mono);
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay svg {
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.video-card:hover .play-overlay svg {
    transform: scale(1);
}

.video-details {
    padding: var(--space-md);
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-description {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty States */
.empty-state,
.empty-playlist {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) * 2;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg,
.empty-playlist svg {
    color: var(--accent-primary);
    opacity: 0.5;
    margin-bottom: var(--space-lg);
}

.empty-state h3,
.empty-playlist h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state p,
.empty-playlist p {
    max-width: 400px;
    line-height: 1.6;
}

.subscribe-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding: 12px 24px;
    background: #ff0000;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.subscribe-cta:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

/* Loading States */
.loading-playlists,
.loading-videos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-hover);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

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

/* Setup Instructions */
.setup-notice,
.error-notice,
.no-playlists {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-secondary);
}

.setup-notice svg,
.error-notice svg {
    color: var(--accent-warning);
    margin-bottom: var(--space-sm);
}

.error-notice svg {
    color: var(--accent-error);
}

.error-notice small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.retry-btn {
    margin-top: var(--space-md);
    padding: 8px 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: var(--bg-void);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.retry-btn:hover {
    background: #00b8e6;
}

.setup-instructions {
    grid-column: 1 / -1;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-xl);
    text-align: center;
}

.setup-icon {
    margin-bottom: var(--space-lg);
}

.setup-icon svg {
    color: var(--accent-warning);
    opacity: 0.8;
}

.setup-instructions h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.setup-instructions > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.setup-steps {
    text-align: left;
    margin-bottom: var(--space-xl);
}

.setup-step {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-surface);
    border-radius: 12px;
    margin-bottom: var(--space-sm);
    border: 1px solid var(--border-subtle);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: var(--bg-void);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.step-content a {
    color: var(--accent-primary);
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

.code-snippet {
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    text-align: left;
    overflow-x: auto;
}

.code-snippet code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-success);
    line-height: 1.8;
}

.visit-channel-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 28px;
    background: #ff0000;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.visit-channel-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.3);
}

/* Video card playing state */
.video-card.playing {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
}

.video-card.playing .video-thumbnail::after {
    content: 'Now Playing';
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: var(--accent-primary);
    color: var(--bg-void);
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

/* =========================================
   Toast Notifications
   ========================================= */

.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-visible);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification svg {
    color: #ff0000;
    flex-shrink: 0;
}

/* Protocol Notice */
.protocol-notice {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 16px;
    margin-bottom: var(--space-lg);
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 8px;
    color: var(--accent-warning);
    font-size: 13px;
}

.protocol-notice svg {
    flex-shrink: 0;
}

.protocol-notice span {
    flex: 1;
}

.protocol-notice button {
    background: none;
    border: none;
    color: var(--accent-warning);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.protocol-notice button:hover {
    opacity: 1;
}

/* =========================================
   User Section & Authentication
   ========================================= */

.user-section {
    display: flex;
    align-items: center;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: var(--bg-void);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-login:hover {
    background: #00b8e6;
    transform: translateY(-1px);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    background: var(--bg-elevated);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.user-avatar:hover {
    border-color: var(--accent-secondary);
    transform: scale(1.05);
}

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

.user-avatar img[src=""],
.user-avatar img:not([src]) {
    display: none;
}

#userInitial {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
}

.user-avatar img[src]:not([src=""]) + #userInitial {
    display: none;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-visible);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1000;
    animation: dropdownFade 0.2s ease-out;
}

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

.user-dropdown.hidden {
    display: none;
}

.user-info {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item svg {
    opacity: 0.7;
}

/* Auth Modal */
.auth-modal {
    width: 400px;
    max-width: 90vw;
    padding: var(--space-xl);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group.hidden {
    display: none;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input {
    width: 100%;
    padding: 12px var(--space-md);
    background: var(--bg-deep);
    border: 1px solid var(--border-visible);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: 8px;
    color: var(--accent-error);
    font-size: 13px;
    margin-bottom: var(--space-md);
}

.auth-error.hidden {
    display: none;
}

.btn-auth-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: var(--bg-void);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-auth-submit:hover {
    background: #00b8e6;
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    padding: 0 var(--space-md);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-visible);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.auth-footer {
    margin-top: var(--space-lg);
    text-align: center;
}

.auth-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.link-btn:hover {
    color: #00b8e6;
    text-decoration: underline;
}

.forgot-link {
    margin-top: var(--space-sm);
}

.forgot-link.hidden {
    display: none;
}

/* Submissions Modal */
.submissions-modal {
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    padding: var(--space-xl);
}

.submissions-modal h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.submissions-list {
    max-height: 500px;
    overflow-y: auto;
}

.submission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: 8px;
    margin-bottom: var(--space-sm);
    border-left: 3px solid transparent;
}

.submission-item.passed {
    border-left-color: var(--accent-success);
}

.submission-item.failed {
    border-left-color: var(--accent-error);
}

.submission-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.submission-problem {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.submission-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.submission-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.submission-status.accepted {
    color: var(--accent-success);
}

.submission-status.rejected {
    color: var(--accent-error);
}

.submission-status svg {
    width: 16px;
    height: 16px;
}

.no-submissions {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.no-submissions svg {
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* =========================================
   Utility Classes
   ========================================= */

.hidden {
    display: none !important;
}

/* =========================================
   Responsive Design
   ========================================= */

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .problem-panel {
        flex: none;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .resizer {
        width: 100%;
        height: 6px;
        cursor: row-resize;
    }
    
    .resizer::after {
        width: 40px;
        height: 4px;
    }
    
    .editor-panel {
        flex: 1;
    }
    
    .console-area {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 var(--space-md);
    }
    
    .nav-tabs {
        gap: 0;
    }
    
    .nav-tab span:not(.nav-tab svg) {
        display: none;
    }
    
    .youtube-btn span {
        display: none;
    }
    
    .youtube-btn {
        padding: 8px 12px;
        border-radius: 50%;
    }
    
    .problem-title {
        font-size: 20px;
    }
    
    .success-stats {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    /* Videos responsive */
    .videos-container {
        flex-direction: column;
    }
    
    .playlists-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .playlists-list {
        display: flex;
        overflow-x: auto;
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .playlist-item {
        flex-shrink: 0;
        margin-bottom: 0;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================
   Test Category Badges
   ========================================= */

.test-category {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-category.basic {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-primary);
}

.test-category.edge {
    background: rgba(255, 184, 0, 0.15);
    color: var(--accent-warning);
}

.test-category.adversarial {
    background: rgba(255, 61, 154, 0.15);
    color: var(--accent-secondary);
}

.test-category.boundary {
    background: rgba(138, 43, 226, 0.15);
    color: #b366ff;
}

.test-category.overflow {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-error);
}

.test-category.performance {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
}

.test-category.not_found {
    background: rgba(90, 90, 106, 0.15);
    color: var(--text-secondary);
}

.test-category.complex {
    background: rgba(255, 61, 154, 0.15);
    color: var(--accent-secondary);
}

.test-category.no_overlap {
    background: rgba(138, 138, 154, 0.15);
    color: var(--text-secondary);
}

/* =========================================
   TLE and Error Status Styling
   ========================================= */

.result-status.tle {
    background: linear-gradient(135deg, rgba(255, 184, 0, 0.15), rgba(255, 120, 0, 0.1));
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.result-status.tle svg {
    fill: var(--accent-warning);
}

.test-result-item.tle {
    border-left: 3px solid var(--accent-warning);
    background: rgba(255, 184, 0, 0.05);
}

.tle-message {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: var(--accent-warning);
}

.tle-message h4 {
    color: var(--accent-warning);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tle-tips {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.tle-tips ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.tle-tips li {
    margin-bottom: 0.25rem;
}

/* =========================================
   Problems List View
   ========================================= */

.problems-list-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.problems-list-header {
    text-align: center;
    margin-bottom: 2rem;
}

.problems-list-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.problems-list-header p {
    color: var(--text-secondary);
}

.problems-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.problems-filters .filter-group {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.problems-filters .filter-group.search {
    flex: 2;
    max-width: 400px;
}

.problems-filters select,
.problems-filters input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.problems-filters select:focus,
.problems-filters input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.problems-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.problem-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.problem-card:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.problem-card .problem-number {
    width: 40px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.problem-card .problem-info {
    flex: 1;
}

.problem-card .problem-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.problem-card .problem-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.problem-card .problem-difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.problem-card .problem-difficulty.easy {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-success);
}

.problem-card .problem-difficulty.medium {
    background: rgba(255, 184, 0, 0.15);
    color: var(--accent-warning);
}

.problem-card .problem-difficulty.hard {
    background: rgba(255, 71, 87, 0.15);
    color: var(--accent-error);
}

.problem-card .problem-status {
    margin-left: 1rem;
    color: var(--text-muted);
}

.problem-card .problem-status.solved {
    color: var(--accent-success);
}

.loading-problems {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.back-to-problems {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    position: absolute;
    top: 70px;
    left: 1rem;
    z-index: 10;
}

.back-to-problems:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.main-content {
    position: relative;
}

/* Dropdown divider */
.dropdown-divider {
    height: 1px;
    background: var(--bg-elevated);
    margin: 0.25rem 0;
}
