/* ══════════════════════════════════════════════════════════════════════════════
   GENERATION STUDIO — VFX Page Styles
   Pure Black theme. Grid layout: styles | preview | prompt.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Page Layout ──────────────────────────────────────────────────────────── */
.vfx-layout {
    display: grid;
    grid-template-columns: 180px 1fr 380px;
    grid-template-rows: 1fr auto;
    gap: var(--gs-gap, 16px);
    height: calc(100vh - 56px);
    padding: var(--gs-padding, 16px);
    box-sizing: border-box;
}

/* ── Left Panel: Styles ───────────────────────────────────────────────────── */
.vfx-styles-panel {
    grid-row: 1;
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.vfx-styles-title {
    font-size: var(--label-size, 0.72rem);
    font-weight: var(--label-weight, 600);
    letter-spacing: var(--label-spacing, 0.06em);
    text-transform: uppercase;
    color: var(--text-secondary, rgba(255,255,255,0.55));
    margin-bottom: 4px;
    padding: 0 4px;
}

.vfx-style-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, rgba(255,255,255,0.55));
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
}
.vfx-style-item:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.04);
}
.vfx-style-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-subtle, rgba(255,255,255,0.06));
}

.vfx-style-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vfx-style-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-muted, rgba(255,255,255,0.25));
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: inherit;
    margin-top: 4px;
}
.vfx-style-add:hover {
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

/* ── Center Panel: Preview ────────────────────────────────────────────────── */
.vfx-preview-panel {
    grid-row: 1;
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.vfx-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px 0;
    flex-shrink: 0;
}
.vfx-preview-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, rgba(255,255,255,0.9));
    margin: 0;
}
.vfx-preview-actions {
    display: flex;
    gap: 8px;
}

.vfx-preview-container {
    flex-shrink: 0;
    align-self: center;
    border-radius: 10px;
    overflow: hidden;
    background: repeating-conic-gradient(#1a1a1a 0% 25%, #111 0% 50%) 0 0 / 24px 24px;
    position: relative;
}

.vfx-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: block;
}

.vfx-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted, rgba(255,255,255,0.25));
    font-size: 0.85rem;
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.vfx-preview-empty svg {
    opacity: 0.15;
}

/* ── Right Panel: Prompt + Controls ───────────────────────────────────────── */
.vfx-prompt-panel {
    grid-row: 1;
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.vfx-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vfx-prompt-area {
    background: var(--input-bg-dark, rgba(0,0,0,0.2));
    border: var(--input-border, 1px solid rgba(255,255,255,0.06));
    border-radius: var(--input-radius, 8px);
    color: var(--input-color, rgba(255,255,255,0.9));
    padding: 12px 14px;
    font-size: var(--body-size, 0.85rem);
    font-family: inherit;
    line-height: var(--body-line, 1.55);
    resize: none;
    outline: none;
    min-height: 160px;
    flex: 1;
    transition: border-color 0.2s;
}
.vfx-prompt-area:focus {
    border-color: rgba(255, 255, 255, 0.15);
}
.vfx-prompt-area::placeholder {
    color: rgba(142, 155, 176, 0.5);
}

.vfx-templates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.vfx-template-chip {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted, rgba(255,255,255,0.35));
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.vfx-template-chip:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

/* ── Image Upload Zone ────────────────────────────────────────────────────── */
.vfx-upload-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.vfx-upload-zone:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
}
.vfx-upload-zone.dragover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
}
.vfx-upload-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.vfx-upload-preview img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.vfx-upload-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.vfx-upload-remove:hover {
    color: #fff;
    background: rgba(255, 80, 80, 0.5);
}
.vfx-upload-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.vfx-upload-rmbg {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.vfx-upload-rmbg:hover {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}
.vfx-upload-rmbg:disabled {
    opacity: 0.4;
    cursor: wait;
}
.vfx-upload-rmbg.done {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.25);
}
/* Checkerboard bg for transparent preview — bright like Photoshop */
.vfx-upload-preview img.has-alpha {
    background: repeating-conic-gradient(#3a3a3a 0% 25%, #2a2a2a 0% 50%) 0 0 / 16px 16px;
}

.vfx-select-row {
    display: flex;
    gap: 8px;
}

.vfx-select {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    color: var(--text-primary, rgba(255,255,255,0.9));
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.vfx-btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.vfx-btn-generate:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}
.vfx-btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Token Bar (Footer) ───────────────────────────────────────────────────── */
.vfx-token-bar {
    grid-row: 2;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255,255,255,0.25));
}

.vfx-token-group {
    display: flex;
    gap: 24px;
}

.vfx-token-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vfx-token-value {
    color: var(--text-secondary, rgba(255,255,255,0.55));
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.vfx-token-cost {
    color: rgba(255, 255, 255, 0.35);
}

/* ── Add Style Modal ──────────────────────────────────────────────────────── */
.vfx-add-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 2000);
    align-items: center;
    justify-content: center;
}
.vfx-add-modal.open {
    display: flex;
}
.vfx-add-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.vfx-add-modal-content {
    position: relative;
    background: var(--bg-surface, rgba(255,255,255,0.04));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: var(--modal-radius, 16px);
    padding: var(--modal-padding, 28px);
    max-width: 420px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .vfx-layout {
        grid-template-columns: 160px 1fr 320px;
    }
}
@media (max-width: 860px) {
    .vfx-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
    }
    .vfx-styles-panel {
        grid-row: 1;
        grid-column: 1;
        flex-direction: row;
        overflow-x: auto;
    }
    .vfx-preview-panel {
        grid-row: 2;
        grid-column: 1;
        min-height: 300px;
    }
    .vfx-prompt-panel {
        grid-row: 3;
        grid-column: 1;
    }
    .vfx-token-bar {
        grid-row: 4;
        grid-column: 1;
    }
}
