/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark Theme (Default) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --bg-elevated: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    
    --accent-primary: #c0c0c0;
    --accent-secondary: #a0a0a0;
    
    --border-primary: #404040;
    --border-secondary: #4a4a4a;
    
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #ef4444;
    --info: #60a5fa;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e5e5e5;
    --bg-elevated: #fafafa;
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #808080;
    
    --accent-primary: #404040;
    --accent-secondary: #606060;
    
    --border-primary: #e0e0e0;
    --border-secondary: #d0d0d0;
}

/* Midnight Theme */
[data-theme="midnight"] {
    --bg-primary: #0a0e27;
    --bg-secondary: #0f1433;
    --bg-tertiary: #1a1f3a;
    --bg-elevated: #252b4a;
    
    --text-primary: #e0e7ff;
    --text-secondary: #a5b4fc;
    --text-muted: #6366f1;
    
    --accent-primary: #818cf8;
    --accent-secondary: #6366f1;
    
    --border-primary: #1e293b;
    --border-secondary: #334155;
}

/* Ocean Theme */
[data-theme="ocean"] {
    --bg-primary: #0d1b2a;
    --bg-secondary: #1b263b;
    --bg-tertiary: #1b3a52;
    --bg-elevated: #2d4a5e;
    
    --text-primary: #e0f2fe;
    --text-secondary: #7dd3fc;
    --text-muted: #0ea5e9;
    
    --accent-primary: #38bdf8;
    --accent-secondary: #0ea5e9;
    
    --border-primary: #1e3a52;
    --border-secondary: #2d4a5e;
}

/* Sunset Theme */
[data-theme="sunset"] {
    --bg-primary: #1a0f0a;
    --bg-secondary: #2d1810;
    --bg-tertiary: #3d2318;
    --bg-elevated: #4d2e20;
    
    --text-primary: #fff5eb;
    --text-secondary: #ffb088;
    --text-muted: #ff8c42;
    
    --accent-primary: #ff6b35;
    --accent-secondary: #ff8c42;
    
    --border-primary: #3d2318;
    --border-secondary: #4d2e20;
}

/* Forest Theme */
[data-theme="forest"] {
    --bg-primary: #0a1f0f;
    --bg-secondary: #0f2b17;
    --bg-tertiary: #1a3d24;
    --bg-elevated: #254d31;
    
    --text-primary: #e7f5ec;
    --text-secondary: #86efac;
    --text-muted: #4ade80;
    
    --accent-primary: #22c55e;
    --accent-secondary: #16a34a;
    
    --border-primary: #1a3d24;
    --border-secondary: #254d31;
}

/* Purple Haze Theme */
[data-theme="purple"] {
    --bg-primary: #1a0a1f;
    --bg-secondary: #2d1438;
    --bg-tertiary: #3d1f4d;
    --bg-elevated: #4d2a5e;
    
    --text-primary: #f5e7ff;
    --text-secondary: #d8b4fe;
    --text-muted: #c084fc;
    
    --accent-primary: #a855f7;
    --accent-secondary: #9333ea;
    
    --border-primary: #3d1f4d;
    --border-secondary: #4d2a5e;
}

/* Cyberpunk Theme */
[data-theme="cyberpunk"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #141829;
    --bg-tertiary: #1f2437;
    --bg-elevated: #2a3047;
    
    --text-primary: #00ffff;
    --text-secondary: #ff00ff;
    --text-muted: #00ff88;
    
    --accent-primary: #ff00ff;
    --accent-secondary: #00ffff;
    
    --border-primary: #ff00ff;
    --border-secondary: #00ffff;
}

/* Monokai Theme */
[data-theme="monokai"] {
    --bg-primary: #272822;
    --bg-secondary: #2e2f2a;
    --bg-tertiary: #3e3d32;
    --bg-elevated: #49483e;
    
    --text-primary: #f8f8f2;
    --text-secondary: #a6e22e;
    --text-muted: #75715e;
    
    --accent-primary: #66d9ef;
    --accent-secondary: #a6e22e;
    
    --border-primary: #49483e;
    --border-secondary: #75715e;
}

/* Nord Theme */
[data-theme="nord"] {
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #434c5e;
    --bg-elevated: #4c566a;
    
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --text-muted: #88c0d0;
    
    --accent-primary: #88c0d0;
    --accent-secondary: #81a1c1;
    
    --border-primary: #434c5e;
    --border-secondary: #4c566a;
}

/* Dracula Theme */
[data-theme="dracula"] {
    --bg-primary: #282a36;
    --bg-secondary: #2f3241;
    --bg-tertiary: #383a4a;
    --bg-elevated: #44475a;
    
    --text-primary: #f8f8f2;
    --text-secondary: #bd93f9;
    --text-muted: #6272a4;
    
    --accent-primary: #ff79c6;
    --accent-secondary: #bd93f9;
    
    --border-primary: #44475a;
    --border-secondary: #6272a4;
}

/* Tokyo Night Theme */
[data-theme="tokyo"] {
    --bg-primary: #1a1b26;
    --bg-secondary: #24283b;
    --bg-tertiary: #2f3549;
    --bg-elevated: #3b4261;
    
    --text-primary: #c0caf5;
    --text-secondary: #7aa2f7;
    --text-muted: #565f89;
    
    --accent-primary: #7aa2f7;
    --accent-secondary: #bb9af7;
    
    --border-primary: #2f3549;
    --border-secondary: #3b4261;
}

/* Gruvbox Theme */
[data-theme="gruvbox"] {
    --bg-primary: #282828;
    --bg-secondary: #32302f;
    --bg-tertiary: #3c3836;
    --bg-elevated: #504945;
    
    --text-primary: #ebdbb2;
    --text-secondary: #d5c4a1;
    --text-muted: #a89984;
    
    --accent-primary: #fe8019;
    --accent-secondary: #fabd2f;
    
    --border-primary: #3c3836;
    --border-secondary: #504945;
}

/* Solarized Dark Theme */
[data-theme="solarized"] {
    --bg-primary: #002b36;
    --bg-secondary: #073642;
    --bg-tertiary: #0e4b5a;
    --bg-elevated: #155968;
    
    --text-primary: #fdf6e3;
    --text-secondary: #93a1a1;
    --text-muted: #657b83;
    
    --accent-primary: #268bd2;
    --accent-secondary: #2aa198;
    
    --border-primary: #0e4b5a;
    --border-secondary: #155968;
}

/* Cherry Blossom Theme */
[data-theme="cherry"] {
    --bg-primary: #1f0a14;
    --bg-secondary: #2d1420;
    --bg-tertiary: #3d1f2d;
    --bg-elevated: #4d2a3a;
    
    --text-primary: #ffe4f0;
    --text-secondary: #ffc0e0;
    --text-muted: #ff9dd0;
    
    --accent-primary: #ff6bb5;
    --accent-secondary: #ff4d9f;
    
    --border-primary: #3d1f2d;
    --border-secondary: #4d2a3a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 24px;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.brand-icon i {
    color: var(--bg-primary);
    font-size: 18px;
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.brand-text span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-badge.connected .status-indicator {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-badge.teleporting .status-indicator {
    background: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    overflow-y: auto;
    padding: 24px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h2 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h2::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-lg {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.2);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.2);
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.2);
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

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

/* Info Card */
.info-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.1);
}

.avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.avatar-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.2);
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 32px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-primary);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-label i {
    color: var(--accent-secondary);
    width: 16px;
}

.info-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Teleport Monitor */
.teleport-monitor {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
}

.monitor-display {
    text-align: center;
    margin-bottom: 16px;
}

.monitor-state {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.monitor-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.monitor-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.monitor-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.monitor-details {
    text-align: center;
}

.monitor-details span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    padding: 0 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title i {
    color: var(--accent-secondary);
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* Editor Section */
.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

/* Tabs Container */
.tabs-container {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border-primary);
    padding: 8px 16px;
    gap: 6px;
}

.tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.tabs-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    max-width: 180px;
    position: relative;
}

.tab.tab-new {
    animation: slideInTab 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInTab {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tab:hover {
    background: var(--bg-elevated);
}

.tab.active {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(192, 192, 192, 0.05));
    box-shadow: inset 0 0 0 1px rgba(192, 192, 192, 0.2);
}

.tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px 2px 0 0;
}

.tab-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: color 0.2s ease;
}

.tab.active .tab-name {
    color: var(--text-primary);
    font-weight: 600;
}

.tab-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.tab-close i {
    font-size: 11px;
}

.new-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.new-tab-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.new-tab-btn i {
    font-size: 13px;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 6px;
    min-width: 180px;
    z-index: 10000;
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu.show {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    color: var(--text-primary);
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
}

.context-menu-item i {
    width: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.context-menu-item:hover i {
    color: var(--accent-secondary);
}

.context-menu-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 6px 0;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-modal.show {
    display: flex;
    opacity: 1;
}

.settings-modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    width: 90%;
    max-width: 800px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.settings-modal.show .settings-modal-content {
    transform: scale(1);
}

.settings-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 20px;
}

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

.settings-body-simple {
    padding: 32px;
}

.theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.theme-selector::-webkit-scrollbar {
    width: 8px;
}

.theme-selector::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.theme-selector::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 4px;
}

.theme-selector::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.theme-option.active {
    border-color: var(--accent-secondary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.1);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: 1px solid var(--border-primary);
}

.dark-preview {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.light-preview {
    background: linear-gradient(135deg, #ffffff, #f5f5f5);
}

.midnight-preview {
    background: linear-gradient(135deg, #0a0e27, #1a1f3a);
}

.ocean-preview {
    background: linear-gradient(135deg, #0d1b2a, #1b3a52);
}

.sunset-preview {
    background: linear-gradient(135deg, #1a0f0a, #ff6b35);
}

.forest-preview {
    background: linear-gradient(135deg, #0a1f0f, #22c55e);
}

.purple-preview {
    background: linear-gradient(135deg, #1a0a1f, #a855f7);
}

.cyberpunk-preview {
    background: linear-gradient(135deg, #0a0e1a, #ff00ff, #00ffff);
}

.monokai-preview {
    background: linear-gradient(135deg, #272822, #a6e22e);
}

.nord-preview {
    background: linear-gradient(135deg, #2e3440, #88c0d0);
}

.dracula-preview {
    background: linear-gradient(135deg, #282a36, #ff79c6);
}

.tokyo-preview {
    background: linear-gradient(135deg, #1a1b26, #7aa2f7);
}

.gruvbox-preview {
    background: linear-gradient(135deg, #282828, #fe8019);
}

.solarized-preview {
    background: linear-gradient(135deg, #002b36, #268bd2);
}

.cherry-preview {
    background: linear-gradient(135deg, #1f0a14, #ff6bb5);
}

.theme-option span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Custom Modals */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.custom-modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    min-width: 400px;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal.show .custom-modal-content {
    transform: scale(1);
}

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.custom-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-modal-body {
    padding: 24px;
}

.custom-modal-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.custom-modal-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.custom-modal-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.1);
}

.custom-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.custom-modal-footer .btn {
    min-width: 80px;
}

.editor-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-secondary), transparent);
    opacity: 0.3;
}

.editor-container {
    flex: 1;
    display: flex;
    background: var(--bg-primary);
}

.editor-gutter {
    width: 60px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

.line-numbers {
    padding: 0 12px 0 0;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 22px;
    user-select: none;
    text-align: right;
}

.editor-main {
    flex: 1;
    position: relative;
}

.editor {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 22px;
    padding: 20px;
    resize: none;
    tab-size: 4;
}

/* Monaco Editor Container */
#scriptEditor {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Monaco Editor Theme Overrides */
.monaco-editor {
    background: var(--bg-primary) !important;
}

.monaco-editor .margin {
    background: var(--bg-secondary) !important;
}

.monaco-editor .line-numbers {
    color: var(--text-muted) !important;
}

.monaco-editor .current-line {
    border: none !important;
}

.monaco-editor .view-overlays .current-line {
    background: rgba(192, 192, 192, 0.05) !important;
}

/* Monaco Scrollbar Styling */
.monaco-scrollable-element > .scrollbar > .slider {
    background: rgba(192, 192, 192, 0.3) !important;
    border-radius: 4px !important;
}

.monaco-scrollable-element > .scrollbar > .slider:hover {
    background: rgba(192, 192, 192, 0.5) !important;
}

.monaco-scrollable-element > .scrollbar > .slider.active {
    background: rgba(192, 192, 192, 0.7) !important;
}

/* Monaco Minimap Styling */
.monaco-editor .minimap {
    background: var(--bg-secondary) !important;
}

.monaco-editor .minimap-slider {
    background: rgba(192, 192, 192, 0.2) !important;
}

.monaco-editor .minimap-slider:hover {
    background: rgba(192, 192, 192, 0.3) !important;
}

/* Monaco Suggestions/Autocomplete */
.monaco-editor .suggest-widget {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

.monaco-editor .suggest-widget .monaco-list-row {
    color: var(--text-primary) !important;
}

.monaco-editor .suggest-widget .monaco-list-row.focused {
    background: var(--accent-secondary) !important;
    color: var(--bg-primary) !important;
}

.monaco-editor .suggest-widget .monaco-highlighted-label .highlight {
    color: var(--accent-primary) !important;
}

/* Console Section */
.console-section {
    height: 240px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.console-container {
    flex: 1;
    background: var(--bg-primary);
    padding: 20px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.console-entry {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.console-time {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}

.console-message {
    color: var(--text-secondary);
    word-break: break-word;
}

.console-entry.success .console-message {
    color: var(--success);
}

.console-entry.error .console-message {
    color: var(--error);
}

.console-entry.warning .console-message {
    color: var(--warning);
}

.console-entry.info .console-message {
    color: var(--info);
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
    padding: 0 24px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-item i {
    color: var(--accent-secondary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent-primary);
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    border-top-color: var(--accent-secondary);
    animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
    border-top-color: var(--text-muted);
    animation-delay: -0.15s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .console-section {
        height: 200px;
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
