/*==================================================
Project Name : HTML Online Viewer
Description  : A premium real-time HTML, CSS, and JS editor & preview tool.
Design & Code: Shakib Hosen Sabbir
Portfolio    : https://shakibhosensabbir.netlify.app
GitHub       : https://github.com/shakibhosensabbir
Email        : shakibhossin1234@gmail.com
Technologies : HTML5, CSS3, JavaScript, CodeMirror, html2canvas, JSZip
==================================================*/

:root {
    --bg-dark: #1f1f1f;
    --panel-bg: #1f1f1f;
    
    /* Vibrant Premium Accent Colors */
    --accent-primary: #818cf8;     /* Indigo */
    --accent-primary-glow: rgba(129, 140, 248, 0.3);
    --accent-success: #34d399;     /* Emerald */
    --accent-success-glow: rgba(52, 211, 153, 0.25);
    --accent-warning: #fbbf24;     /* Amber */
    --accent-warning-glow: rgba(251, 191, 36, 0.25);
    --accent-danger: #f87171;      /* Coral Red */
    --accent-danger-glow: rgba(248, 113, 113, 0.25);
    --accent-info: #22d3ee;        /* Cyan */
    --accent-info-glow: rgba(34, 211, 238, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(129, 140, 248, 0.25);
    
    --glass-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    overflow: hidden;
    position: relative;
}

/* Subtle High-Tech Grid Pattern Overlay */
body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(rgba(129, 140, 248, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 140, 248, 0.02) 1px, transparent 1px);
    background-size: 35px 35px;
    pointer-events: none;
    z-index: 0;
}

/* Floating Glassmorphic Toolbar */
.toolbar {
    background: #1f1f1f;
    border: 1px solid var(--border-light);
    padding: 12px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-premium);
    z-index: 100;
}

.url-input-container {
    display: flex;
    gap: 8px;
    background: #1f1f1f;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    flex-grow: 1;
    max-width: 480px;
    transition: var(--transition);
}

.url-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.2);
}

.url-input {
    background: transparent;
    border: none;
    padding: 6px 14px;
    color: white;
    font-size: 13.5px;
    flex-grow: 1;
    outline: none;
    font-family: inherit;
}

.url-input::placeholder {
    color: var(--text-muted);
}

/* Premium Button Designs */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium);
}

.btn i {
    font-size: 13px;
}

/* Specific Toolbar Buttons Style */
.btn-primary { 
    background: var(--accent-primary); 
    color: #070913; 
    border: none; 
}
.btn-primary:hover { 
    background: #a5b4fc; 
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.4); 
}

.btn-run {
    color: var(--accent-success);
    background: rgba(52, 211, 153, 0.05);
    border-color: rgba(52, 211, 153, 0.15);
}
.btn-run:hover {
    background: var(--accent-success);
    color: #070913;
    border-color: var(--accent-success);
    box-shadow: 0 0 15px var(--accent-success-glow);
}

.btn-preview {
    color: var(--accent-info);
    background: rgba(34, 211, 238, 0.05);
    border-color: rgba(34, 211, 238, 0.15);
}
.btn-preview:hover {
    background: var(--accent-info);
    color: #070913;
    border-color: var(--accent-info);
    box-shadow: 0 0 15px var(--accent-info-glow);
}

.btn-screenshot {
    color: #a5b4fc;
    background: rgba(129, 140, 248, 0.05);
    border-color: rgba(129, 140, 248, 0.15);
}
.btn-screenshot:hover {
    background: var(--accent-primary);
    color: #070913;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

.btn-toggle {
    color: #c084fc; /* Purple */
    background: rgba(192, 132, 252, 0.05);
    border-color: rgba(192, 132, 252, 0.15);
}
.btn-toggle:hover {
    background: #c084fc;
    color: #070913;
    border-color: #c084fc;
    box-shadow: 0 0 15px rgba(192, 132, 252, 0.25);
}

.btn-clear {
    color: var(--accent-danger);
    background: rgba(248, 113, 113, 0.05);
    border-color: rgba(248, 113, 113, 0.15);
}
.btn-clear:hover {
    background: var(--accent-danger);
    color: #070913;
    border-color: var(--accent-danger);
    box-shadow: 0 0 15px var(--accent-danger-glow);
}

.btn-download {
    color: var(--accent-warning);
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
}
.btn-download:hover {
    background: var(--accent-warning);
    color: #070913;
    border-color: var(--accent-warning);
    box-shadow: 0 0 15px var(--accent-warning-glow);
}

.btn-import {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-light);
}
.btn-import:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Main Container Workspace layout */
.main-container {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 10px 0px; 
    position: relative;
    min-height: 0;
    z-index: 1;
}

.editor-container, .preview-container {
    flex: 1;
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    overflow: hidden;
    transition: var(--transition);
    min-height: 0;
}

.editor-container:hover, .preview-container:hover {
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.editor-header, .preview-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
}

.preview-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-success);
}

/* CodeMirror Styling Override */
.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: 14px !important;
    background: transparent !important;
    padding: 8px;
    flex: 1;
}

.CodeMirror-scroll {
    overflow: auto !important;
}

.CodeMirror-gutters {
    background: transparent !important;
    border-right: 1px solid var(--border-light) !important;
}

/* Preview Frame Element styling */
.preview-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

/* Floating pill status-bar */
.status-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f1f1f;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.status-bar::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
}

/* Modals & Full page preview */
.fullpage-overlay, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

.modal-overlay.active, 
.fullpage-overlay.active {
    display: flex !important;
}

.fullpage-header {
    background: #1f1f1f;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.modal-content {
    background: #1f1f1f;
    width: 90%;
    max-width: 440px;
    border-radius: 24px;
    padding: 32px;
    margin: auto;
    border: 1px solid var(--border-light);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 12px 18px;
    background: #1f1f1f;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    margin-top: 20px;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.25);
}

/* Responsive configurations */
@media (max-width: 900px) {
    body {
        background: #181818 !important;
    }
    body::before {
        display: none !important; /* Performance and style optimization for mobile */
    }

    .main-container {
        flex-direction: column;
        overflow-y: auto;
        gap: 12px;
        padding: 12px;
    }
    
    .editor-container, .preview-container {
        flex: none;
        height: 380px;
        min-height: 300px;
    }
    
    .main-container.preview-hidden .editor-container {
        height: calc(100vh - 120px);
        flex: 1;
    }
}

@media (max-width: 600px) {
    .toolbar {
        margin: 12px 12px 0 12px;
        padding: 8px 16px;
        gap: 8px;
    }
    .btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    .url-input-container {
        max-width: 100%;
    }
}

/* Toggle Preview Styling */
.main-container.preview-hidden .preview-container {
    display: none !important;
}

/* Custom Scrollbars for Main App & Firefox */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #1e293b var(--bg-dark);
}

/* Premium Copy Button in Editor Header */
.btn-copy {
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.15);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--accent-primary);
    color: #070913;
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

/* Premium Paste Button in Editor Header */
.btn-paste {
    padding: 5px 12px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-info);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: var(--transition);
}

.btn-paste:hover {
    background: var(--accent-info);
    color: #070913;
    box-shadow: 0 0 15px var(--accent-info-glow);
}

/* ==================================================
   Full Page Website Screenshot Studio Styles
   ================================================== */

.screenshot-modal-content {
    max-width: 96vw !important;
    width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 24px 28px !important;
    background: #1F1F1F !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

.screenshot-modal-body.studio-2col-layout {
    display: flex;
    flex: 1;
    gap: 24px;
    align-items: stretch;
    overflow: hidden;
    margin-top: 18px;
    padding-right: 0;
    min-height: 0;
}

/* Left Column: Controls & Configuration */
.studio-col-left {
    flex: 0 0 360px;
    width: 360px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 6px;
}

.studio-col-left::-webkit-scrollbar {
    width: 5px;
}
.studio-col-left::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Right Column: Interactive Live Preview */
.studio-col-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 5px;
    position: relative;
    overflow: hidden;
}

/* Preview Placeholder Empty State */
.studio-preview-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.studio-preview-placeholder .placeholder-icon {
    width: 64px;
    height: 64px;
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--accent-primary);
    margin-bottom: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.studio-preview-placeholder h4 {
    font-size: 15px;
    color: white;
    font-weight: 600;
    margin-bottom: 6px;
}

.studio-preview-placeholder p {
    font-size: 12.5px;
    max-width: 320px;
    line-height: 1.5;
    color: var(--text-muted);
}

.btn-close-modal {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    font-size: 15px;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Studio Source Selector Tabs */
.studio-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 18px;
    width: 100%;
}

.studio-tab {
    flex: 1;
    white-space: nowrap;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.studio-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.studio-tab.active {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(34, 211, 238, 0.15));
    color: #fff;
    border: 1px solid rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.studio-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.studio-label i {
    margin-right: 4px;
    color: var(--accent-primary);
}

/* Studio URL Input Wrapper */
.studio-url-section {
    margin-bottom: 18px;
    animation: fadeIn 0.25s ease-out;
}

.studio-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.studio-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--accent-primary);
    opacity: 0.7;
    font-size: 14px;
}

.studio-text-input {
    width: 100%;
    padding: 12px 90px 12px 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: var(--transition);
}

.studio-text-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary-glow);
}

.studio-paste-btn {
    position: absolute;
    right: 6px;
    padding: 6px 12px;
    font-size: 11px;
}

/* Settings Grid */
.studio-settings-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 16px;
}

.studio-pills {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
}

.studio-pill {
    flex: 1;
    white-space: nowrap;
    padding: 8px 6px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.studio-pill:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.studio-pill.active {
    background: rgba(129, 140, 248, 0.15);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

.studio-pill.active i {
    color: var(--accent-primary);
}

/* Settings Row with Select dropdowns */
.studio-setting-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.studio-setting-col {
    flex: 1;
    min-width: 180px;
}

.studio-select {
    width: 100%;
    padding: 9px 12px;
    background: rgba(18, 18, 20, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.studio-select:focus {
    border-color: var(--accent-primary);
}

.studio-select option {
    background: #1e1e24;
    color: white;
}

/* Capture Action Button */
.btn-studio-capture {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    transition: var(--transition);
}

.btn-studio-capture:hover {
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-studio-capture:active {
    transform: translateY(0);
}

.btn-studio-capture:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Progress & Loading */
.studio-progress-container {
    margin-top: 18px;
    padding: 16px;
    background: rgba(129, 140, 248, 0.05);
    border: 1px dashed rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeIn 0.3s ease;
}

.studio-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(129, 140, 248, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: studioSpin 0.8s linear infinite;
}

@keyframes studioSpin {
    to { transform: rotate(360deg); }
}

.studio-progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Result Area */
.studio-result-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    animation: modalEnter 0.3s ease-out;
}

.studio-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.studio-result-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.studio-result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Preview View Controls Toolbar */
.studio-preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 12px;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--border-light);
    border-bottom: none;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-mode-buttons, .preview-zoom-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-preview-mode {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-preview-mode:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.btn-preview-mode.active {
    background: rgba(129, 140, 248, 0.18);
    border-color: var(--accent-primary);
    color: white;
}

.btn-zoom {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-zoom:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.zoom-level-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 38px;
    text-align: center;
}

/* Image Preview Box */
.studio-preview-box {
    width: 100%;
    flex: 1;
    min-height: 250px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background-color: #111;
    background-image: 
        linear-gradient(45deg, #181818 25%, transparent 25%), 
        linear-gradient(-45deg, #181818 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #181818 75%), 
        linear-gradient(-45deg, transparent 75%, #181818 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0px;
    transition: all 0.2s ease;
}

.studio-preview-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
    border-radius: 6px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    transform-origin: top center;
}

.studio-result-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    min-height: 0;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
    .screenshot-modal-content {
        padding: 16px !important;
        width: 96% !important;
        max-height: 94vh;
    }
    .screenshot-modal-body.studio-2col-layout {
        flex-direction: column;
        overflow-y: auto;
        gap: 16px;
    }
    .studio-col-left {
        width: 100%;
        flex: none;
        padding-right: 0;
    }
    .studio-col-right {
        min-height: 380px;
    }
    .studio-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .studio-result-actions {
        width: 100%;
    }
    .studio-result-actions button {
        flex: 1;
    }
}
