/**
 * Web Playground Styles
 * HTML, CSS & JavaScript Playground
 */

/* ===================================
   CSS Variables
   =================================== */
:root {
    /* Colors - Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    
    /* Sizing */
    --navbar-height: 56px;
    --footer-height: 48px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ===================================
   Loading Overlay
   =================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-profile-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
}

.loading-profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid var(--accent-primary);
}

.loading-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-rings .ring {
    position: absolute;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: ring-pulse 2s ease-out infinite;
}

.ring-1 { width: 90px; height: 90px; top: -45px; left: -45px; animation-delay: 0s; }
.ring-2 { width: 110px; height: 110px; top: -55px; left: -55px; animation-delay: 0.4s; }
.ring-3 { width: 130px; height: 130px; top: -65px; left: -65px; animation-delay: 0.8s; }

@keyframes ring-pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.loading-subtitle {
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 24px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Author section styling */
.loading-author-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.loading-powered {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.loading-author-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loading-author-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.loading-author-link:hover::before {
    left: 100%;
}

.loading-author-link:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.loading-author-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.loading-author-website {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.3px;
}

/* ===================================
   Main Layout
   =================================== */
.playground-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ===================================
   Navbar
   =================================== */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 28px;
    width: auto;
}

.navbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.navbar-title i {
    color: var(--accent-primary);
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.theme-btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    opacity: 0.9;
}

/* ===================================
   Main Container
   =================================== */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===================================
   Tabs Container
   =================================== */
.tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.tab i {
    font-size: 1.1rem;
}

.tab-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auto-run-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-run-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.auto-run-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.primary {
    background: var(--success);
    color: white;
}

.action-btn.primary:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* ===================================
   Content Area
   =================================== */
.content-area {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--bg-primary);
}

.content-area.vertical-layout {
    flex-direction: column;
}

/* ===================================
   Editors Panel
   =================================== */
.editors-panel {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.vertical-layout .editors-panel {
    flex: 1;
    min-height: 100px;
    width: 100%;
    height: auto;
}

.editor-container {
    display: none;
    flex-direction: column;
    height: 100%;
}

.editor-container.active {
    display: flex;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.editor-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.editor-label i {
    font-size: 1rem;
}

.editor-label .fa-html5 { color: #e34f26; }
.editor-label .fa-css3-alt { color: #1572b6; }
.editor-label .fa-js-square { color: #f7df1e; }

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

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.monaco-editor-container {
    flex: 1;
    min-height: 0;
}

/* ===================================
   Resizer
   =================================== */
.resizer {
    width: 12px;
    background: var(--border-color);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

/* Larger invisible hit area */
.resizer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -6px;
    right: -6px;
    cursor: col-resize;
}

.vertical-layout .resizer {
    width: 100%;
    height: 12px;
    cursor: row-resize;
}

.vertical-layout .resizer::before {
    left: 0;
    right: 0;
    top: -6px;
    bottom: -6px;
    cursor: row-resize;
}

.resizer:hover,
.resizer:active {
    background: var(--accent-primary);
}

.resizer-handle {
    width: 4px;
    height: 50px;
    background: var(--text-tertiary);
    border-radius: 2px;
    pointer-events: none;
}

.resizer:hover .resizer-handle,
.resizer:active .resizer-handle {
    background: white;
}

.vertical-layout .resizer-handle {
    width: 50px;
    height: 4px;
}

/* ===================================
   Preview Panel
   =================================== */
.preview-panel {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.vertical-layout .preview-panel {
    flex: 1;
    min-height: 100px;
    width: 100%;
    height: auto;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.preview-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.preview-label i {
    color: var(--accent-primary);
}

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

.preview-container {
    flex: 1;
    background: white;
    overflow: hidden;
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===================================
   Footer
   =================================== */
.footer {
    height: var(--footer-height);
    background: linear-gradient(to right, var(--bg-secondary), var(--bg-tertiary));
    border-top: 2px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: footerShimmer 3s infinite;
}

@keyframes footerShimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.footer-tip:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.footer-tip i {
    color: var(--accent-primary);
    font-size: 1.1rem;
    animation: iconPulse 2s ease-in-out infinite;
}

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

.shortcuts-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcuts-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shortcut-divider {
    color: var(--border-color);
    font-weight: bold;
}

.key-separator {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin: 0 2px;
}

.shortcut-desc {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-left: 4px;
}

.footer-tip kbd {
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    min-width: 24px;
    text-align: center;
}

.footer-tip kbd:hover {
    transform: translateY(-1px);
    border-color: var(--accent-primary);
    box-shadow: 
        0 4px 8px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.template-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-select:hover {
    border-color: var(--accent-primary);
}

.footer-credits {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.footer-credits::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.footer-credits:hover::before {
    left: 100%;
}

.footer-credits:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.credits-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.credits-heart {
    color: #ef4444;
    font-size: 0.9rem;
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.2); }
    20%, 40% { transform: scale(1); }
}

.credits-author {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.credits-author::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.credits-author:hover::before {
    width: 300px;
    height: 300px;
}

.author-name {
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.credits-icon {
    color: white;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.credits-author:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.credits-author:hover .credits-icon {
    opacity: 1;
    transform: translateX(2px) translateY(-2px);
}

/* ===================================
   Toast Notifications
   =================================== */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--error); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--accent-primary); }

/* ===================================
   Mobile Responsive
   =================================== */
@media (max-width: 768px) {
    .navbar-title span,
    .nav-link span,
    .auto-run-toggle span,
    .action-btn span,
    .tab span {
        display: none;
    }

    .navbar {
        padding: 0 12px;
    }

    .tabs-container {
        padding: 8px 12px;
    }

    .tab {
        padding: 10px 14px;
    }

    .action-btn {
        padding: 10px 14px;
    }

    .footer {
        padding: 0 12px;
    }

    .footer-tip {
        display: none;
    }

    .content-area {
        flex-direction: column !important;
    }

    .editors-panel,
    .preview-panel {
        width: 100% !important;
        height: 50% !important;
    }

    .resizer {
        width: 100% !important;
        height: 8px !important;
        cursor: row-resize !important;
    }

    .resizer-handle {
        width: 40px !important;
        height: 4px !important;
    }
}

@media (max-width: 480px) {
    .navbar-logo {
        display: none;
    }

    .footer-credits {
        display: none;
    }
}

/* ===================================
   Share Modal
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-header h3 i {
    color: var(--accent-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Fira Code', monospace;
}

.share-link-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.share-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.share-copy-btn.copied {
    background: var(--success);
}

.share-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.share-info i {
    color: var(--accent-primary);
    margin-top: 0.15rem;
}

/* Share Stats */
.share-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.share-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.share-stats .stat i {
    font-size: 0.75rem;
}

.share-stats .stat.compression {
    color: var(--success);
}

/* Share Warning */
.share-warning {
    text-align: center;
    padding: 1rem 0;
}

.share-warning .warning-icon {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 1rem;
}

.share-warning h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.share-warning p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.share-warning .warning-suggestion {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Warning Tips */
.warning-tips {
    text-align: left;
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.warning-tips p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.warning-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.warning-tips li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

/* Keyboard Shortcuts Modal */
.modal-wide {
    max-width: 700px;
}

.shortcuts-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 600px) {
    .shortcuts-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.shortcuts-column h4 {
    color: var(--accent-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    gap: 1rem;
}

.shortcut-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.shortcut-keys kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.shortcut-keys code {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

/* View HTML Modal */
.modal-large {
    max-width: 900px;
    max-height: 80vh;
}

.modal-large .modal-body {
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.html-view-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.html-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.html-view-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.html-output {
    margin: 0;
    padding: 1rem;
    max-height: 400px;
    overflow: auto;
    background: var(--bg-tertiary);
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre;
    overflow-x: auto;
}

.html-output code {
    display: block;
}

/* Syntax highlighting for HTML output */
.html-output .html-tag {
    color: #e06c75;
}

.html-output .html-attr {
    color: #d19a66;
}

.html-output .html-value {
    color: #98c379;
}

.html-output .html-comment {
    color: #5c6370;
    font-style: italic;
}

/* ===================================
   CONSOLE PANEL
   =================================== */

.console-panel {
    display: flex;
    flex-direction: column;
    border-top: 2px solid var(--border-color);
    background: var(--bg-secondary);
    height: 40px; /* Collapsed - just header */
    min-height: 40px;
    max-height: 50%;
    transition: height 0.2s ease;
    position: relative;
}

.console-panel.expanded {
    height: 200px;
}

.console-resizer {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 8px;
    cursor: row-resize;
    z-index: 10;
}

.console-resizer:hover {
    background: var(--accent-primary);
    opacity: 0.5;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.console-header:hover {
    background: var(--bg-secondary);
}

.console-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.console-actions {
    display: flex;
    gap: 0.25rem;
}

#expandConsole i {
    transition: transform 0.2s ease;
}

.console-panel.expanded #expandConsole i {
    transform: rotate(180deg);
}

.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.8rem;
    display: none;
}

.console-panel.expanded .console-output {
    display: block;
}

.console-line {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.console-line:last-child {
    border-bottom: none;
}

.console-line.log { color: var(--text-primary); }
.console-line.info { color: #3b82f6; }
.console-line.warn { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.console-line.error { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.console-line .console-icon {
    flex-shrink: 0;
    width: 16px;
}

.console-line .console-message {
    flex: 1;
    word-break: break-all;
}

/* ===================================
   RESPONSIVE PREVIEW BUTTONS
   =================================== */

.responsive-btns {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px;
}

.responsive-btn {
    padding: 0.4rem 0.6rem !important;
    border-radius: 4px !important;
}

.responsive-btn.active {
    background: var(--accent-color) !important;
    color: white !important;
}

.preview-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.preview-container {
    position: relative;
    display: flex;
    justify-content: center;
    background: #f0f0f0;
}

[data-theme="dark"] .preview-container {
    background: #1a1a2e;
}

.preview-container iframe {
    transition: width 0.3s ease;
    background: white;
}

/* ===================================
   SPLIT VIEW
   =================================== */

.split-view.editors-panel {
    display: flex !important;
    flex-direction: row;
    gap: 2px;
    background: var(--border-color);
}

.split-view .editor-container {
    display: flex !important;
    flex-direction: column;
    background: var(--bg-primary);
    flex: 1;
    min-width: 0;
}

.split-view .editor-container .editor-header {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--accent-primary);
}

.split-view .editor-container[data-editor="html"] .editor-header {
    border-bottom-color: #e34c26;
}

.split-view .editor-container[data-editor="css"] .editor-header {
    border-bottom-color: #264de4;
}

.split-view .editor-container[data-editor="js"] .editor-header {
    border-bottom-color: #f0db4f;
}

/* In split view, hide the main tabs */
.content-area.split-view ~ .tabs-container .tabs,
.tabs-container:has(~ .content-area.split-view) .tabs {
    opacity: 0.5;
    pointer-events: none;
}

/* Vertical layout split view */
.vertical-layout.split-view.editors-panel {
    flex-direction: column;
}

/* Responsive: stack on small screens */
@media (max-width: 900px) {
    .split-view.editors-panel {
        flex-direction: column;
    }
    
    .split-view .editor-container {
        min-height: 150px;
    }
}

/* ===================================
   LIBRARIES MODAL
   =================================== */

.modal-medium {
    max-width: 650px;
    width: 95%;
}

.libraries-section {
    margin-bottom: 1.5rem;
}

.libraries-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.libraries-section-title i {
    font-size: 1rem;
}

.libraries-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .libraries-grid {
        grid-template-columns: 1fr;
    }
}

.library-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.library-item:hover {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.library-item.added {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.library-item.added:hover {
    border-color: #16a34a;
}

.library-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.library-icon i {
    font-size: 1.2rem;
}

.library-icon svg {
    fill: currentColor;
}

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

.library-info strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.library-info small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.library-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.library-add-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.library-add-btn:disabled {
    cursor: default;
}

.library-item.added .library-add-btn {
    background: #22c55e;
}

.library-item.added .library-add-btn:hover {
    background: #16a34a;
    transform: scale(1.1);
}

.libraries-custom {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.libraries-custom label,
.libraries-active label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.libraries-custom label i,
.libraries-active label i {
    color: var(--accent-color);
}

.custom-library-input {
    display: flex;
    gap: 0.75rem;
}

.custom-library-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.custom-library-input input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.custom-library-input input::placeholder {
    color: var(--text-secondary);
}

.custom-library-input button {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.libraries-active {
    margin-top: 1.25rem;
}

.active-libraries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.active-library-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
}

.active-library-tag .remove-lib {
    cursor: pointer;
    opacity: 0.8;
}

.active-library-tag .remove-lib:hover {
    opacity: 1;
}

.no-libraries {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.active-library-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.library-type {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.library-type.css {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.library-type.js {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.library-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.library-remove-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: auto;
}

.library-remove-btn:hover {
    background: #ef4444;
    color: white;
}

/* Console type label */
.console-type {
    font-weight: bold;
    font-size: 0.7rem;
    min-width: 45px;
}

.console-log .console-type { color: var(--text-secondary); }
.console-info .console-type { color: #3b82f6; }
.console-warn .console-type { color: #f59e0b; }
.console-error .console-type { color: #ef4444; }

/* Nav button active state */
.nav-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Responsive mode indicator */
.preview-container.responsive-mode {
    padding: 1rem;
}

.preview-container.responsive-mode iframe {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===================================
   THEME PICKER MODAL
   =================================== */

.theme-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
}

.theme-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.theme-picker-modal.active {
    opacity: 1;
    visibility: visible;
}

.theme-picker-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease;
}

.theme-picker-modal.active .theme-picker-content {
    transform: translateY(0) scale(1);
}

.theme-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--accent-gradient);
    color: white;
}

.theme-picker-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-picker-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.theme-picker-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-picker-search {
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-picker-search i {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.theme-picker-search input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.theme-picker-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.theme-picker-search input::placeholder {
    color: var(--text-tertiary);
}

.theme-picker-body {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 55vh;
}

.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.theme-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.theme-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.theme-card-preview {
    display: flex;
    height: 80px;
    overflow: hidden;
}

.theme-preview-sidebar {
    width: 30%;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-preview-accent {
    height: 8px;
    border-radius: 3px;
    width: 80%;
}

.theme-preview-main {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-preview-line {
    height: 6px;
    border-radius: 3px;
    opacity: 0.4;
}

.theme-preview-line.short {
    width: 60%;
    opacity: 1;
}

.theme-card-info {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-color);
}

.theme-icon {
    font-size: 1.1rem;
}

.theme-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.theme-card.active .theme-card-check {
    opacity: 1;
    transform: scale(1);
}

.theme-picker-footer {
    padding: 14px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.theme-count {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.theme-count i {
    color: var(--accent-primary);
}

/* Theme Toast */
.theme-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    z-index: 10001;
    animation: toastSlideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

.theme-toast i {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.theme-toast.fade-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* ===================================
   ALL THEME VARIABLES
   =================================== */

/* Dracula Theme */
[data-theme="dracula"] {
    --bg-primary: #282a36;
    --bg-secondary: #21222c;
    --bg-tertiary: #343746;
    --text-primary: #f8f8f2;
    --text-secondary: #6272a4;
    --text-tertiary: #44475a;
    --border-color: #44475a;
    --accent-primary: #bd93f9;
    --accent-secondary: #ff79c6;
    --accent-gradient: linear-gradient(135deg, #bd93f9, #ff79c6);
    --success: #50fa7b;
    --warning: #f1fa8c;
    --error: #ff5555;
}

/* Monokai Theme */
[data-theme="monokai"] {
    --bg-primary: #272822;
    --bg-secondary: #1e1f1c;
    --bg-tertiary: #3e3d32;
    --text-primary: #f8f8f2;
    --text-secondary: #a6a58f;
    --text-tertiary: #75715e;
    --border-color: #3e3d32;
    --accent-primary: #66d9ef;
    --accent-secondary: #a6e22e;
    --accent-gradient: linear-gradient(135deg, #66d9ef, #a6e22e);
    --success: #a6e22e;
    --warning: #e6db74;
    --error: #f92672;
}

/* Solarized Dark Theme */
[data-theme="solarized-dark"] {
    --bg-primary: #002b36;
    --bg-secondary: #073642;
    --bg-tertiary: #094d5a;
    --text-primary: #839496;
    --text-secondary: #657b83;
    --text-tertiary: #586e75;
    --border-color: #073642;
    --accent-primary: #268bd2;
    --accent-secondary: #2aa198;
    --accent-gradient: linear-gradient(135deg, #268bd2, #2aa198);
    --success: #859900;
    --warning: #b58900;
    --error: #dc322f;
}

/* Solarized Light Theme */
[data-theme="solarized-light"] {
    --bg-primary: #fdf6e3;
    --bg-secondary: #eee8d5;
    --bg-tertiary: #e4ddc8;
    --text-primary: #657b83;
    --text-secondary: #93a1a1;
    --text-tertiary: #839496;
    --border-color: #eee8d5;
    --accent-primary: #268bd2;
    --accent-secondary: #2aa198;
    --accent-gradient: linear-gradient(135deg, #268bd2, #2aa198);
    --success: #859900;
    --warning: #b58900;
    --error: #dc322f;
}

/* GitHub Dark Theme */
[data-theme="github-dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --border-color: #30363d;
    --accent-primary: #58a6ff;
    --accent-secondary: #1f6feb;
    --accent-gradient: linear-gradient(135deg, #58a6ff, #1f6feb);
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
}

/* GitHub Light Theme */
[data-theme="github-light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-tertiary: #8c959f;
    --border-color: #d0d7de;
    --accent-primary: #0969da;
    --accent-secondary: #0550ae;
    --accent-gradient: linear-gradient(135deg, #0969da, #0550ae);
    --success: #1a7f37;
    --warning: #9a6700;
    --error: #cf222e;
}

/* One Dark Pro Theme */
[data-theme="one-dark"] {
    --bg-primary: #282c34;
    --bg-secondary: #21252b;
    --bg-tertiary: #323842;
    --text-primary: #abb2bf;
    --text-secondary: #7f848e;
    --text-tertiary: #5c6370;
    --border-color: #3e4451;
    --accent-primary: #61afef;
    --accent-secondary: #c678dd;
    --accent-gradient: linear-gradient(135deg, #61afef, #c678dd);
    --success: #98c379;
    --warning: #e5c07b;
    --error: #e06c75;
}

/* Nord Theme */
[data-theme="nord"] {
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #434c5e;
    --text-primary: #d8dee9;
    --text-secondary: #81a1c1;
    --text-tertiary: #4c566a;
    --border-color: #4c566a;
    --accent-primary: #88c0d0;
    --accent-secondary: #5e81ac;
    --accent-gradient: linear-gradient(135deg, #88c0d0, #5e81ac);
    --success: #a3be8c;
    --warning: #ebcb8b;
    --error: #bf616a;
}

/* Material Theme */
[data-theme="material"] {
    --bg-primary: #263238;
    --bg-secondary: #1e272e;
    --bg-tertiary: #37474f;
    --text-primary: #eeffff;
    --text-secondary: #b0bec5;
    --text-tertiary: #546e7a;
    --border-color: #37474f;
    --accent-primary: #82aaff;
    --accent-secondary: #c792ea;
    --accent-gradient: linear-gradient(135deg, #82aaff, #c792ea);
    --success: #c3e88d;
    --warning: #ffcb6b;
    --error: #ff5370;
}

/* High Contrast Theme */
[data-theme="high-contrast"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #a0a0a0;
    --border-color: #333333;
    --accent-primary: #00ffff;
    --accent-secondary: #ff00ff;
    --accent-gradient: linear-gradient(135deg, #00ffff, #ff00ff);
    --success: #00ff00;
    --warning: #ffff00;
    --error: #ff0000;
}

/* Catppuccin Theme */
[data-theme="catppuccin"] {
    --bg-primary: #1e1e2e;
    --bg-secondary: #181825;
    --bg-tertiary: #313244;
    --text-primary: #cdd6f4;
    --text-secondary: #a6adc8;
    --text-tertiary: #6c7086;
    --border-color: #313244;
    --accent-primary: #cba6f7;
    --accent-secondary: #f5c2e7;
    --accent-gradient: linear-gradient(135deg, #cba6f7, #f5c2e7);
    --success: #a6e3a1;
    --warning: #f9e2af;
    --error: #f38ba8;
}

/* Tokyo Night Theme */
[data-theme="tokyo-night"] {
    --bg-primary: #1a1b26;
    --bg-secondary: #16161e;
    --bg-tertiary: #24283b;
    --text-primary: #c0caf5;
    --text-secondary: #9aa5ce;
    --text-tertiary: #565f89;
    --border-color: #292e42;
    --accent-primary: #7aa2f7;
    --accent-secondary: #bb9af7;
    --accent-gradient: linear-gradient(135deg, #7aa2f7, #bb9af7);
    --success: #9ece6a;
    --warning: #e0af68;
    --error: #f7768e;
}

/* Ayu Dark Theme */
[data-theme="ayu-dark"] {
    --bg-primary: #0b0e14;
    --bg-secondary: #0d1017;
    --bg-tertiary: #151a21;
    --text-primary: #bfbdb6;
    --text-secondary: #6d7178;
    --text-tertiary: #464b51;
    --border-color: #1f2430;
    --accent-primary: #e6b450;
    --accent-secondary: #ff8f40;
    --accent-gradient: linear-gradient(135deg, #e6b450, #ff8f40);
    --success: #7fd962;
    --warning: #ffb454;
    --error: #d95757;
}

/* Synthwave 84 Theme */
[data-theme="synthwave"] {
    --bg-primary: #2b213a;
    --bg-secondary: #241b2f;
    --bg-tertiary: #3a2c4d;
    --text-primary: #f4eee4;
    --text-secondary: #b6b1ab;
    --text-tertiary: #6c6783;
    --border-color: #3a2c4d;
    --accent-primary: #ff7edb;
    --accent-secondary: #72f1b8;
    --accent-gradient: linear-gradient(135deg, #ff7edb, #72f1b8);
    --success: #72f1b8;
    --warning: #fede5d;
    --error: #fe4450;
}

/* Gruvbox Theme */
[data-theme="gruvbox"] {
    --bg-primary: #282828;
    --bg-secondary: #1d2021;
    --bg-tertiary: #3c3836;
    --text-primary: #ebdbb2;
    --text-secondary: #a89984;
    --text-tertiary: #665c54;
    --border-color: #3c3836;
    --accent-primary: #fabd2f;
    --accent-secondary: #fe8019;
    --accent-gradient: linear-gradient(135deg, #fabd2f, #fe8019);
    --success: #b8bb26;
    --warning: #fabd2f;
    --error: #fb4934;
}

/* Cobalt2 Theme */
[data-theme="cobalt2"] {
    --bg-primary: #193549;
    --bg-secondary: #122738;
    --bg-tertiary: #1f4662;
    --text-primary: #e1efff;
    --text-secondary: #7dc5f5;
    --text-tertiary: #517d9d;
    --border-color: #1f4662;
    --accent-primary: #ffc600;
    --accent-secondary: #ff9d00;
    --accent-gradient: linear-gradient(135deg, #ffc600, #ff9d00);
    --success: #3ad900;
    --warning: #ffc600;
    --error: #ff628c;
}

/* Night Owl Theme */
[data-theme="night-owl"] {
    --bg-primary: #011627;
    --bg-secondary: #0b1d2e;
    --bg-tertiary: #112a3c;
    --text-primary: #d6deeb;
    --text-secondary: #7fdbca;
    --text-tertiary: #5f7e97;
    --border-color: #1d3b53;
    --accent-primary: #7fdbca;
    --accent-secondary: #82aaff;
    --accent-gradient: linear-gradient(135deg, #7fdbca, #82aaff);
    --success: #addb67;
    --warning: #f78c6c;
    --error: #ef5350;
}

/* Palenight Theme */
[data-theme="palenight"] {
    --bg-primary: #292d3e;
    --bg-secondary: #242837;
    --bg-tertiary: #343a4f;
    --text-primary: #a6accd;
    --text-secondary: #676e95;
    --text-tertiary: #4e5579;
    --border-color: #3a3f58;
    --accent-primary: #c792ea;
    --accent-secondary: #82aaff;
    --accent-gradient: linear-gradient(135deg, #c792ea, #82aaff);
    --success: #c3e88d;
    --warning: #ffcb6b;
    --error: #ff5370;
}

/* Horizon Theme */
[data-theme="horizon"] {
    --bg-primary: #1c1e26;
    --bg-secondary: #16181e;
    --bg-tertiary: #232530;
    --text-primary: #d5d8da;
    --text-secondary: #6c6f93;
    --text-tertiary: #4e5166;
    --border-color: #2e303e;
    --accent-primary: #e95678;
    --accent-secondary: #fab795;
    --accent-gradient: linear-gradient(135deg, #e95678, #fab795);
    --success: #27d796;
    --warning: #fab795;
    --error: #e95678;
}

/* Shades of Purple Theme */
[data-theme="shades-of-purple"] {
    --bg-primary: #2d2b55;
    --bg-secondary: #1e1d40;
    --bg-tertiary: #3d3a6d;
    --text-primary: #a599e9;
    --text-secondary: #7b6fcb;
    --text-tertiary: #5a4f9c;
    --border-color: #3d3a6d;
    --accent-primary: #fad000;
    --accent-secondary: #ff9d00;
    --accent-gradient: linear-gradient(135deg, #fad000, #ff9d00);
    --success: #9effff;
    --warning: #fad000;
    --error: #ff628c;
}

/* Winter is Coming Theme */
[data-theme="winter-is-coming"] {
    --bg-primary: #011627;
    --bg-secondary: #0b2942;
    --bg-tertiary: #13395a;
    --text-primary: #d6deeb;
    --text-secondary: #82aaff;
    --text-tertiary: #5f7e97;
    --border-color: #1d3b53;
    --accent-primary: #82aaff;
    --accent-secondary: #c792ea;
    --accent-gradient: linear-gradient(135deg, #82aaff, #c792ea);
    --success: #22da6e;
    --warning: #ecc48d;
    --error: #ef5350;
}

/* Rosé Pine Theme */
[data-theme="rosepine"] {
    --bg-primary: #191724;
    --bg-secondary: #1f1d2e;
    --bg-tertiary: #26233a;
    --text-primary: #e0def4;
    --text-secondary: #908caa;
    --text-tertiary: #6e6a86;
    --border-color: #26233a;
    --accent-primary: #ebbcba;
    --accent-secondary: #c4a7e7;
    --accent-gradient: linear-gradient(135deg, #ebbcba, #c4a7e7);
    --success: #9ccfd8;
    --warning: #f6c177;
    --error: #eb6f92;
}

/* Everforest Theme */
[data-theme="everforest"] {
    --bg-primary: #2d353b;
    --bg-secondary: #272e33;
    --bg-tertiary: #343f44;
    --text-primary: #d3c6aa;
    --text-secondary: #859289;
    --text-tertiary: #5c6a72;
    --border-color: #3d484d;
    --accent-primary: #a7c080;
    --accent-secondary: #7fbbb3;
    --accent-gradient: linear-gradient(135deg, #a7c080, #7fbbb3);
    --success: #a7c080;
    --warning: #dbbc7f;
    --error: #e67e80;
}

/* Vitesse Theme */
[data-theme="vitesse"] {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #dbd7caee;
    --text-secondary: #9e9e9e;
    --text-tertiary: #6e6e6e;
    --border-color: #2e2e2e;
    --accent-primary: #4d9375;
    --accent-secondary: #6394bf;
    --accent-gradient: linear-gradient(135deg, #4d9375, #6394bf);
    --success: #4d9375;
    --warning: #d6a954;
    --error: #cb7676;
}

@media (max-width: 768px) {
    .theme-picker-content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .theme-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .theme-card-preview {
        height: 65px;
    }
}
