/* =========================================
   Enterprise WYSIWYG Production Studio CSS
   ========================================= */

:root {
    --bg-main: #0b0b0d;
    --bg-panel: #141417;
    --bg-input: #1d1d24;
    --accent: #00e676;
    --blue-brand: #00d2ff;
    --danger: #ff3d00;
    --border: #2a2a35;
    --text-main: #ffffff;
    --text-muted: #9a9aaf;
    --radius: 12px;
}

body {
    margin: 0; 
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main); 
    color: var(--text-main);
    overflow: hidden; 
    height: 100vh;
}

/* --- DESKTOP LAYOUT --- */
.app-layout {
    display: grid;
    grid-template-columns: 360px 1fr 340px;
    height: 100vh; 
    width: 100vw;
    gap: 1px;
    background-color: var(--border); 
    box-sizing: border-box;
}

.sidebar, .queue-panel {
    background-color: var(--bg-panel);
    padding: 24px;
    display: flex; 
    flex-direction: column;
    overflow-y: auto; 
    height: 100vh;
    box-sizing: border-box;
}

/* --- TYPOGRAPHY --- */
h2 {
    font-size: 13px; 
    margin-top: 0; 
    margin-bottom: 20px;
    padding-bottom: 12px; 
    border-bottom: 1px solid var(--border);
    color: var(--blue-brand); 
    font-weight: 600;
    text-transform: uppercase; 
    letter-spacing: 0.8px;
}

label {
    font-size: 11px; 
    color: var(--text-muted); 
    font-weight: bold;
    display: block; 
    margin-bottom: 8px;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

/* --- FORM CONTROLS --- */
.group-box {
    background-color: var(--bg-input);
    padding: 16px; 
    border-radius: var(--radius);
    margin-bottom: 16px; 
    border: 1px solid rgba(255,255,255,0.05);
    box-sizing: border-box;
}

input[type="file"], select, input[type="number"], input[type="range"], textarea {
    width: 100%; 
    padding: 12px; 
    background-color: var(--bg-main);
    border: 1px solid var(--border); 
    color: var(--text-main);
    border-radius: 8px; 
    box-sizing: border-box;
    margin-bottom: 12px; 
    font-size: 13px; 
    outline: none;
    transition: border-color 0.2s;
}

input[type="file"]:focus, select:focus, input[type="number"]:focus, textarea:focus {
    border-color: var(--blue-brand);
}

input[type="color"] {
    -webkit-appearance: none; 
    border: 1px solid var(--border);
    width: 100%; 
    height: 42px; 
    border-radius: 8px;
    cursor: pointer; 
    background: var(--bg-main); 
    padding: 4px;
    margin-bottom: 12px; 
    box-sizing: border-box;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }

textarea { 
    height: 120px; 
    font-family: monospace; 
    color: var(--accent); 
    resize: none; 
}

.btn-submit {
    width: 100%; 
    padding: 14px;
    background: linear-gradient(135deg, var(--blue-brand), #0083b0);
    color: #fff; 
    font-weight: bold; 
    border: none; 
    border-radius: 8px;
    cursor: pointer; 
    font-size: 13px; 
    text-transform: uppercase;
    letter-spacing: 0.5px; 
    margin-top: 10px; 
    box-sizing: border-box;
    transition: transform 0.1s, opacity 0.2s;
}
.btn-submit:active { transform: scale(0.98); }
.btn-submit:hover { opacity: 0.9; }

/* --- WORKSPACE (PREVIEW AREA) --- */
.workspace {
    flex: 1; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    background-color: #050505; 
    position: relative;
    height: 100vh; 
    box-sizing: border-box;
}

.canvas-container {
    position: relative; 
    width: 320px; 
    height: 568px; 
    background: #000;
    border-radius: 20px; 
    overflow: hidden;
    box-shadow: 0 0 0 8px #1a1a1a, 0 20px 50px rgba(0,0,0,0.6); 
    border: 4px solid #333;
}
canvas { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

.toolbar-media {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    width: 320px; 
    margin-top: 30px; 
    background-color: var(--bg-panel);
    padding: 12px 16px; 
    border-radius: var(--radius); 
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.btn-media {
    padding: 8px 16px; 
    background-color: #ff9800; 
    border: none;
    color: white; 
    font-weight: bold; 
    border-radius: 6px;
    cursor: pointer; 
    font-size: 12px; 
    white-space: nowrap;
}
.btn-media:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- QUEUE & TABS --- */
.tab-strip { 
    display: flex; 
    background-color: var(--bg-input); 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    padding: 4px; 
    margin-bottom: 16px; 
}
.tab-btn { 
    flex: 1; 
    background: transparent; 
    border: none; 
    color: var(--text-muted); 
    padding: 10px 0; 
    font-size: 11px; 
    font-weight: bold; 
    text-transform: uppercase; 
    cursor: pointer; 
    border-radius: 6px; 
    transition: all 0.2s; 
}
.tab-btn.active { 
    background-color: var(--blue-brand); 
    color: #000; 
}
.tab-content { display: none; flex-direction: column; gap: 12px; }
.tab-content.active { display: flex; }

.q-card {
    background-color: var(--bg-input); 
    padding: 16px;
    border-radius: var(--radius); 
    border: 1px solid var(--border); 
    box-sizing: border-box;
    width: 100%;
    transition: background 0.3s;
}
.q-card:hover { background-color: #24242d; }

.q-header { display: flex; justify-content: space-between; font-size: 12px; font-weight: bold; margin-bottom: 8px; }
.q-bar-bg { width: 100%; height: 6px; background-color: #0b0b0d; margin: 12px 0; border-radius: 3px; overflow: hidden; border: 1px solid #222;}
.q-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-brand), var(--accent)); width: 0%; transition: width 0.3s ease; }
.btn-cancel-task { 
    background: transparent; 
    border: 1px solid var(--danger); 
    color: var(--danger); 
    padding: 6px 12px; 
    font-size: 11px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    margin-top: 4px; 
    transition: all 0.2s; 
}
.btn-cancel-task:hover { background-color: var(--danger); color: white; }

/* --- CUSTOM SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: #3a3a4a; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a5a; }

/* =========================================
   MOBILE RESPONSIVE (APP BOTTOM SHEET STYLE)
   ========================================= */

.mobile-bottom-bar { display: none; }

@media (max-width: 1100px) {
    .app-layout { 
        display: block; 
        height: 100vh; 
        overflow: hidden; 
    }

    /* 1. Video (Preview) Fixed Behind Panels */
    .workspace {
        position: fixed; 
        top: 0; left: 0; 
        width: 100vw; 
        height: calc(100vh - 70px); 
        z-index: 10;
        background: #000;
    }

    .canvas-container {
        width: 100%;
        max-width: 380px;
        height: 70vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .toolbar-media {
        width: 90%;
        margin-top: 15px;
    }

    /* 2. Bottom Navigation Bar */
    .mobile-bottom-bar {
        display: flex; 
        justify-content: space-around; 
        align-items: center;
        position: fixed; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        height: 70px;
        background-color: #0b0b0d; 
        border-top: 1px solid #2a2a35;
        z-index: 9999;
    }

    .nav-btn {
        background: none; 
        border: none; 
        color: #9a9aaf;
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        gap: 4px;
        font-size: 10px; 
        font-weight: bold; 
        text-transform: uppercase;
        width: 30%; 
        cursor: pointer; 
        transition: 0.2s;
    }
    .nav-btn .icon { font-size: 22px; filter: grayscale(100%); transition: 0.2s;}
    .nav-btn.active { color: #00d2ff; }
    .nav-btn.active .icon { filter: grayscale(0%); transform: translateY(-4px); }

    /* 3. Sliding Menu Panels */
    .sidebar, .queue-panel {
        position: fixed; 
        bottom: 70px; 
        left: 0; 
        width: 100vw; 
        height: 65vh; 
        background-color: #141417; 
        border-top-left-radius: 24px; 
        border-top-right-radius: 24px;
        box-shadow: 0 -15px 40px rgba(0,0,0,0.8); 
        border-top: 1px solid #2a2a35;
        z-index: 100;
        transform: translateY(120%); 
        transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        padding-bottom: 30px;
    }

    /* Trigger Class */
    .sidebar.mobile-active, .queue-panel.mobile-active {
        transform: translateY(0);
    }
}