/* Modern Premium Glassmorphism Design System */
:root {
    --bg-dark: #0a0a0c;
    --bg-dark-gradient: linear-gradient(135deg, #0c0c0f 0%, #15151e 100%);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-focus: rgba(157, 78, 221, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-purple: #9d4edd;
    --accent-purple-glow: rgba(157, 78, 221, 0.4);
    --accent-cyan: #00f5d4;
    --accent-cyan-glow: rgba(0, 245, 212, 0.4);
    
    --btn-primary-bg: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
    --btn-accent-bg: linear-gradient(135deg, #00b4d8 0%, #00f5d4 100%);
    
    /* Semantic Colors */
    --color-green: #00e676;
    --color-green-glow: rgba(0, 230, 118, 0.3);
    --color-orange: #ff7043;
    --color-orange-glow: rgba(255, 112, 67, 0.3);
    --color-grey: #64748b;
    --color-grey-glow: rgba(100, 116, 139, 0.2);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --blur-intensity: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-dark-gradient);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Glowing Orbs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
}
body::before {
    top: 10%;
    left: 20%;
    background: var(--accent-purple);
}
body::after {
    bottom: 10%;
    right: 20%;
    background: var(--accent-cyan);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Scrollbars styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(157, 78, 221, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 78, 221, 0.5);
}

/* Sidebar Styling */
.sidebar {
    width: 20vw;
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(var(--blur-intensity));
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-glass);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px var(--accent-purple-glow));
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--accent-cyan);
    font-weight: 400;
}

/* Section Containers inside Sidebar */
.section-container {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3 i {
    color: var(--accent-purple);
}

/* Inputs and Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.input-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"], textarea, .form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition-smooth);
}

input[type="text"]:focus, textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 12px var(--accent-purple-glow);
}

/* Auth Status Card */
.auth-status {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.connected .dot {
    background: var(--color-green);
    box-shadow: 0 0 8px var(--color-green-glow);
}

.status-indicator.connected {
    color: var(--color-green);
}

.status-indicator.disconnected .dot {
    background: var(--color-orange);
    box-shadow: 0 0 8px var(--color-orange-glow);
}

.status-indicator.disconnected {
    color: var(--color-orange);
}

/* Scene Add Row */
.scene-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    animation: slideDown 0.2s ease-out;
}

/* Scenes List */
.scenes-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
}

.scene-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.scene-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.scene-item.active {
    background: rgba(157, 78, 221, 0.08);
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.15);
}

.scene-item-info {
    display: flex;
    flex-direction: column;
}

.scene-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.scene-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.scene-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition-smooth);
}

.scene-item:hover .scene-item-actions {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 14px;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-purple-glow);
}
.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
    background: var(--btn-accent-bg);
    color: #0c0c0f;
    box-shadow: 0 4px 14px var(--accent-cyan-glow);
}
.btn-accent:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0, 245, 212, 0.6);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-green {
    background: var(--color-green);
    color: #0a0a0c;
    box-shadow: 0 4px 12px var(--color-green-glow);
}
.btn-green:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(0, 230, 118, 0.5);
}

.btn-orange {
    background: var(--color-orange);
    color: #fff;
    box-shadow: 0 4px 12px var(--color-orange-glow);
}
.btn-orange:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(255, 112, 67, 0.5);
}

.btn-grey {
    background: var(--color-grey);
    color: #fff;
    box-shadow: 0 4px 12px var(--color-grey-glow);
}
.btn-grey:hover {
    filter: brightness(1.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-accent {
    background: rgba(0, 245, 212, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 245, 212, 0.2);
}

/* Main Workspace */
.main-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.workspace-header {
    height: auto;
    min-height: 48px;
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 20px;
    background: var(--bg-main);
    flex-shrink: 0;
}

.header-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shot-notes-header {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-light);
    max-width: 800px;
    word-wrap: break-word;
}

.header-project-info h2 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-project-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Area — now handled by shot-strips-container */
.workspace-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Glass Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(var(--blur-intensity));
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-premium);
}

.glass-card {
    background: rgba(20, 20, 25, 0.4);
    border: 1px solid var(--border-glass);
}

/* Welcome Panel */
.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    height: calc(100vh - 48px);
}

.welcome-card {
    text-align: center;
    max-width: 500px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 16px var(--accent-purple-glow));
}

.welcome-card h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.setup-steps {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setup-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-secondary);
}

.setup-steps li span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Scene Builder Panel Layout */
.scene-panel {
    height: 100%;
}

.builder-grid {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 24px;
    height: 100%;
}

.generator-config-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generator-config-card h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-cyan);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Dropzone styling */
.dropzone {
    border: 2px dashed var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.dropzone:hover {
    border-color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.03);
}

.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dropzone-icon {
    font-size: 24px;
    color: var(--text-muted);
}

.dropzone p {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropzone p span {
    color: var(--accent-purple);
    font-weight: 600;
}

.file-info {
    font-size: 10px;
    color: var(--text-muted);
}

.dropzone-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.dropzone-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-clear-ref {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-clear-ref:hover {
    background: #ef4444;
}

/* Output Gallery */
.output-review-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-row h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.generation-status-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 112, 67, 0.1);
    border: 1px solid rgba(255, 112, 67, 0.2);
    color: var(--color-orange);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    flex-grow: 1;
    align-content: start;
}

.gallery-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    border: 1px dashed var(--border-glass);
    border-radius: 16px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.gallery-empty-state i {
    font-size: 40px;
}

/* Gallery Visual Cards */
.card-variant {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.card-variant:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.card-variant.selected {
    border-color: var(--color-green);
    box-shadow: 0 0 15px var(--color-green-glow);
}

.card-variant.skipped {
    opacity: 0.4;
}

.card-media-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.card-media-wrapper img, .card-media-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges on Variant Cards */
.card-variant-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.card-badge {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-badge.scene-num-badge {
    color: var(--accent-cyan);
}

.card-badge.selection-indicator {
    background: var(--color-green);
    color: #000;
    font-weight: 800;
}

/* Card Body Content */
.card-variant-body {
    padding: 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-prompt-snippet {
    font-size: 11px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
}

/* Card Actions Panel */
.card-variant-actions {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 6px;
    margin-top: auto;
}

.card-variant-actions .btn {
    padding: 8px;
    font-size: 11px;
    border-radius: 6px;
}

/* Storyboard Bottom Section */
.storyboard-section {
    margin-top: 32px;
    background: rgba(10, 10, 12, 0.4);
    border-top: 1px solid var(--border-glass);
    padding: 32px;
}

.storyboard-section h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.section-helper {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 12px;
}

.storyboard-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Storyboard Card */
.story-card {
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.story-card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.story-card-index {
    color: var(--accent-cyan);
    font-weight: 800;
    font-size: 11px;
}

.story-card-media {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.story-card-media img, .story-card-media video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-card-empty-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
}

.story-card-empty-media i {
    font-size: 20px;
}

.story-card-footer {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.story-video-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-video-ref-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.story-video-ref-group label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.story-video-ref-group input[type="file"] {
    font-size: 9px;
    color: var(--text-secondary);
}

/* Video status overlays */
.video-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    font-weight: 600;
}

.video-status-indicator.queued {
    color: var(--text-secondary);
}

.video-status-indicator.in_progress {
    color: var(--color-orange);
}

.video-status-indicator.completed {
    color: var(--color-green);
    background: rgba(0, 230, 118, 0.08);
}

.video-status-indicator.failed {
    color: #ef4444;
}

/* Modal overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    width: 480px;
    max-width: 90vw;
    animation: zoomIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-orange);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* Keyframes */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Custom selectors layout */
.form-row.select-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.select-col {
    flex: 1;
}
.select-compact {
    padding: 6px 10px !important;
    font-size: 0.85rem !important;
    height: 38px !important;
    background-color: rgba(10, 10, 12, 0.65) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    cursor: pointer;
}
.select-compact option {
    background-color: #121214;
    color: var(--text-primary);
}
.story-video-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.control-row.inline-row {
    flex-direction: row;
    gap: 8px;
}
.control-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.control-col label, .control-row label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.mt-1 {
    margin-top: 4px;
}
.mt-2 {
    margin-top: 8px;
}

/* Tree List (Videos -> Scenes -> Shots) */
.tree-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 400px;
}
.tree-node-video {
    margin-bottom: 8px;
}
.tree-video-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent-cyan);
}
.tree-scenes {
    padding-left: 12px;
    margin-top: 4px;
}
.tree-scene-header {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-weight: 600;
}
.tree-shots {
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tree-shot-item {
    padding: 6px 8px;
    font-size: 12px;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tree-shot-item:hover {
    background: rgba(255,255,255,0.08);
}
.tree-shot-item.active {
    background: rgba(157, 78, 221, 0.2);
    color: #fff;
}
.shot-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: inline-block;
}

@keyframes pulse-generating {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.shot-status-dot.draft { background: gray; }
/* In-progress dots use blue/orange so they are never confused with the
   solid yellow/green of the final approved states below. */
.shot-status-dot.photo_generating { background: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.7); animation: pulse-generating 1.5s infinite; }
.shot-status-dot.photo_ready { background: #ffd700; box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
.shot-status-dot.video_generating { background: #f97316; box-shadow: 0 0 6px rgba(249, 115, 22, 0.7); animation: pulse-generating 1.5s infinite; }
.shot-status-dot.video_ready { background: #22c55e; box-shadow: 0 0 5px var(--color-green-glow); }
.shot-status-dot.approved { background: #22c55e; box-shadow: 0 0 8px var(--color-green-glow); }
.shot-status-dot.failed { background: #ef4444; }

/* Queue Panel */
/* .queue-panel removed — queue is now in sidebar */
.queue-panel {
    display: none;
}
.queue-header {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-glass);
    font-size: 13px;
    font-weight: 700;
}
.queue-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.queue-item {
    font-size: 11px;
    background: rgba(255,255,255,0.03);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Elements Library */
.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.element-card {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
}
.element-thumb {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 8px;
    background-color: rgba(255,255,255,0.02);
}
.element-name {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.element-cat {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.elements-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.element-tag {
    background: rgba(157, 78, 221, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: #fff;
}
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.selected-media-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.selected-media-grid {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}
.selected-media-item {
    flex: 1;
    min-height: 100px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.selected-media-item img, .selected-media-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.shot-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
#lightbox-media-container img, #lightbox-media-container video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    background: rgba(255,255,255,0.1);
    border: none; color: white;
    font-size: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.lightbox-close:hover {
    background: #ef4444;
}
.lightbox-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none; color: white;
    font-size: 24px;
    width: 50px; height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Flash Animation */
@keyframes flashNewItem {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
    50% { transform: scale(1.02); box-shadow: 0 0 25px 5px rgba(0, 245, 212, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 245, 212, 0); }
}
.flash-highlight {
    animation: flashNewItem 1.5s ease-out;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 230, 118, 0.2);
    border: 1px solid var(--color-green);
    color: var(--color-green);
    padding: 12px 24px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    z-index: 10000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    transform: translateX(120%);
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Card Info Header */
.card-info-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    text-align: center;
    z-index: 2;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#modal-settings .form-control {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
#modal-settings .form-control option {
    background: #121214;
    color: var(--text-primary);
}

/* =====================================================
   WAVE 2: No-Scroll Layout — Shot Strips
   ===================================================== */

/* Main workspace is already flex-col in .main-workspace */
.main-workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Two-strip container fills the rest after the header */
.shot-strips-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Each strip takes exactly 50% of the remaining height */
.shot-strip {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
}

.shot-strip.strip-divider {
    border-top: 1px solid var(--border-glass);
}

/* Left controls panel: widened to ~58% to host the two-column layout,
   leaving the gallery (flex:1) at ~42%. */
.strip-controls {
    flex: 0 0 58%;
    width: 58%;
    border-right: 1px solid var(--border-glass);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    background: rgba(10, 10, 14, 0.4);
}

/* Two-column body: prompt/elements on the left, all settings + buttons
   stacked on the right. Fills the panel height so nothing needs to scroll. */
.strip-controls-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 14px;
    overflow: hidden;
}

.strip-col-left {
    flex: 1 1 66%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strip-col-right {
    flex: 0 0 34%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;  /* safety valve if a model exposes many extra selects */
    padding-right: 2px;
}

/* Tighten the stacked settings so the common cases fit with no scroll. */
.strip-col-right .form-group {
    gap: 3px;
}

.strip-col-right .select-compact {
    height: 34px !important;
}

/* Prompt group grows to fill the left column; textarea fills the group. */
.strip-prompt-group {
    flex: 1 1 auto;
    min-height: 0;
}

.strip-prompt-group .strip-textarea {
    flex: 1 1 auto;
    min-height: 90px;
}

/* Elements chips sit below the prompt, capped so they never push it out. */
.strip-elements-group {
    flex: 0 0 auto;
    max-height: 34%;
    overflow-y: auto;
}

/* "+ Add" button pushed to the bottom of the right column, just above Generate. */
.strip-add-btn {
    margin-top: auto;
    padding: 5px 10px;
    font-size: 11px;
    border-color: rgba(255, 255, 255, 0.2);
}

.strip-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.strip-label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.shot-notes-inline {
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: right;
}

.strip-textarea {
    resize: none;
    font-size: 12px;
    line-height: 1.4;
}

.strip-action-btn {
    margin-top: 6px;
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 10px;
}

.strip-video-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

/* Gallery area: wraps the horizontal scroll strip + arrow buttons */
.strip-gallery-wrapper {
    flex: 1 1 0;
    min-width: 0;
    background: rgba(0, 0, 0, 0.15);
    border-left: 1px solid var(--border-glass);
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

/* The scrollable horizontal lane */
.strip-gallery {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 10px 44px;  /* side padding for arrow buttons */
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.strip-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 80px;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.5;
}
.strip-empty-state i { font-size: 28px; }

/* Gallery navigation arrows */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    font-size: 13px;
}
.gallery-arrow:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 12px var(--accent-purple-glow);
}
.gallery-arrow-left  { left: 4px; }
.gallery-arrow-right { right: 4px; }

/* Individual strip gallery card */
.gen-strip-card {
    flex: 0 0 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.gen-strip-card:hover {
    border-color: rgba(157, 78, 221, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.gen-strip-card.selected {
    border-color: var(--color-green);
    box-shadow: 0 0 12px var(--color-green-glow);
}

.gen-strip-card.failed {
    border-color: rgba(239, 68, 68, 0.3);
    opacity: 0.7;
}

.gen-strip-card.orphaned {
    border-color: rgba(245, 158, 11, 0.4);
    opacity: 0.85;
}

/* Orphaned/incomplete state thumbnail — amber */
.gen-strip-orphaned-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    font-size: 20px;
}
.gen-strip-orphaned-label {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 0.3px;
}
.gen-strip-orphaned-sub {
    font-size: 9px;
    color: rgba(245, 158, 11, 0.6);
}

.gen-strip-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
    background: rgba(0,0,0,0.3);
}

.gen-strip-thumb-video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

/* Failed state thumbnail */
.gen-strip-failed-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 22px;
}
.gen-strip-failed-label {
    font-size: 11px;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 0.5px;
}
.gen-strip-failed-error {
    font-size: 14px;
    color: rgba(239, 68, 68, 0.7);
    cursor: help;
}

/* Pending/in-progress state thumbnail */
.gen-strip-pending-thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 212, 255, 0.05);
    color: var(--accent-cyan);
    font-size: 22px;
}
.gen-strip-pending-thumb span {
    font-size: 10px;
    color: var(--text-muted);
}

/* Media wrapper: contains thumb + overlays */
.gen-strip-media-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Hover overlay: magnifying glass */
.gen-strip-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255,255,255,0);
    transition: background 0.2s, color 0.2s;
    pointer-events: none;
}
.gen-strip-media-wrap.gen-strip-clickable {
    cursor: pointer;
}
.gen-strip-media-wrap.gen-strip-clickable:hover .gen-strip-hover-overlay {
    background: rgba(0,0,0,0.45);
    color: rgba(255,255,255,0.9);
}

/* Play icon for video cards (always visible at low opacity) */
.gen-strip-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.gen-strip-play-icon i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    padding-left: 3px; /* optical center for play triangle */
    transition: background 0.2s, border-color 0.2s;
}
.gen-strip-media-wrap:hover .gen-strip-play-icon i {
    background: rgba(157, 78, 221, 0.7);
    border-color: var(--accent-purple);
}


.gen-strip-footer {
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    background: rgba(10,10,12,0.6);
    flex-shrink: 0;
}

.gen-strip-meta {
    font-size: 9px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.gen-strip-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.gen-strip-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    transition: var(--transition-smooth);
}
.gen-strip-btn:hover { background: var(--accent-purple); border-color: var(--accent-purple); color: #fff; }
.gen-strip-btn.selected-btn { background: var(--color-green); border-color: var(--color-green); color: #000; }

/* Overlay "selected" checkmark badge on card */
.gen-strip-card .selected-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--color-green);
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* In-progress card in gallery strip */
.gen-strip-card.in-progress .gen-strip-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 24px;
}

/* Sidebar queue section */
.queue-sidebar-section {
    flex-shrink: 0;
}

.queue-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.queue-sidebar-header h3 {
    font-size: 12px;
}
.queue-sidebar-header:hover h3 {
    color: var(--accent-cyan);
}

.queue-list {
    max-height: 160px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Sidebar tree scrolls internally */
.tree-section {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tree-section .tree-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

/* Lightbox sizing — full viewport for detail inspection */
.lightbox-content {
    max-width: 94vw;
    max-height: 96vh;
}


/* Lightbox zoom state — cursor hint */
#lightbox-media-container {
    transition: cursor 0.1s;
    position: relative;
}
#lightbox-img {
    user-select: none;
    -webkit-user-drag: none;
}
#lightbox-img:not(.zoomed) {
    cursor: zoom-in;
}
/* Zoom hint badge that appears on hover while not zoomed */
#lightbox-media-container:hover::after {
    content: "Click to zoom";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    pointer-events: none;
    white-space: nowrap;
}

/* ── Tree CRUD + collapse styles ─────────────────────────────── */
.tree-video-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}
.tree-video-header:hover { background: rgba(255,255,255,0.05); }

.tree-collapse-btn {
    width: 14px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tree-video-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node-actions {
    display: none;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}
.tree-video-header:hover .tree-node-actions,
.tree-scene-header:hover .tree-node-actions,
.tree-shot-item:hover .tree-node-actions {
    display: flex;
}

.tree-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.tree-btn-add { color: var(--accent-cyan); }
.tree-btn-add:hover { background: rgba(0, 212, 255, 0.15); }
.tree-btn-del { color: var(--text-muted); }
.tree-btn-del:hover { color: #ef4444; background: rgba(239,68,68,0.12); }

.tree-scene-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 18px;
    font-size: 11px;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: default;
}
.tree-scene-header:hover { background: rgba(255,255,255,0.03); }
.tree-scene-header > span:first-child { flex: 1; }

.tree-shot-item {
    display: flex;
    align-items: center;
    padding: 4px 6px 4px 28px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    gap: 4px;
}
.tree-shot-item:hover { background: rgba(255,255,255,0.05); }
.tree-shot-item.active { background: rgba(157, 78, 221, 0.15); color: var(--accent-purple); }

.tree-shot-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.tree-btn-shot-del { margin-left: auto; flex-shrink: 0; }

.tree-add-shot-row,
.tree-add-video-row {
    padding: 2px 6px 2px 28px;
}
.tree-add-video-row {
    padding: 4px 8px;
    border-top: 1px solid var(--border-glass);
    margin-top: 4px;
}
.tree-btn-add-inline {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: color 0.15s, background 0.15s;
}
.tree-btn-add-inline:hover {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.08);
}

/* Item 1 Tree Fixes */

.tree-video-header {
    background: rgba(255,255,255,0.08) !important;
    padding: 8px 10px !important;
    margin-bottom: 4px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-cyan);
}
.tree-scene-header {
    background: rgba(255,255,255,0.03) !important;
    margin: 4px 0 2px 8px !important;
    padding: 6px 8px 6px 12px !important;
    border-left: 2px solid var(--accent-purple);
}
.tree-shots {
    padding-left: 20px !important;
}
.tree-shot-item {
    padding: 4px 8px 4px 12px !important;
    margin-bottom: 2px;
}
.tree-node-actions {
    gap: 8px !important;
}
.tree-btn {
    font-size: 11px !important;
    padding: 4px 6px !important;
}
.tree-list {
    max-height: none !important;
}
.tree-collapse-btn {
    width: 20px !important;
    font-size: 12px !important;
}


/* Item 4 Char Counter */
.char-counter {
    text-align: right;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.char-counter.over-limit {
    color: #ef4444 !important; /* accent-red */
    font-weight: 600;
}


/* Project Tree UI Polish (Added for Sidebar 1) */
.tree-node {
    display: flex;
    flex-direction: column;
}

.tree-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
    margin-bottom: 2px;
}
.tree-header:hover {
    background: rgba(255, 255, 255, 0.05);
}
.tree-header.active {
    background: rgba(157, 78, 221, 0.15);
    color: var(--accent-purple);
}
.tree-header.active .tree-title {
    font-weight: 600;
}

.tree-title {
    flex: 1; /* Pushes actions to the right */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px; /* Spacing between title and actions */
}

.tree-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.2; /* Dim until hover */
    transition: opacity 0.2s;
}
.tree-header:hover .tree-actions,
.tree-header.active .tree-actions {
    opacity: 1;
}

.tree-actions button, .btn-icon-tiny {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
}
.tree-actions button:hover, .btn-icon-tiny:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.tree-actions button.text-danger, .btn-icon-tiny.text-danger {
    color: var(--text-muted);
}
.tree-actions button.text-danger:hover, .btn-icon-tiny.text-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.tree-toggle {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 4px;
    opacity: 0.6;
    font-size: 10px;
    transition: opacity 0.2s;
}
.tree-toggle:hover {
    opacity: 1;
}

/* Specific item spacing fixes */
.tree-children {
    margin-bottom: 4px;
}

/* --- Project Dashboard Styles --- */
.dashboard-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-glass);
}
.dashboard-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.dashboard-client-group {
    margin-bottom: 40px;
}
.dashboard-client-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.dashboard-card {
    background-color: var(--bg-darker);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dashboard-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.dashboard-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
}
.dashboard-card-stats {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Library File Browser ─── */
.fb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}
.fb-crumb {
    color: var(--accent-cyan);
    cursor: pointer;
    text-decoration: none;
}
.fb-crumb:hover { text-decoration: underline; }
.fb-crumb-sep { color: var(--text-muted); }
.fb-list {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
}
.fb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}
.fb-row:last-child { border-bottom: none; }
.fb-row:hover { background: rgba(255, 255, 255, 0.03); }
.fb-icon { width: 16px; text-align: center; color: var(--text-muted); }
.fb-row.is-folder .fb-icon { color: var(--accent-cyan); }
.fb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row.is-folder .fb-name { cursor: pointer; }
.fb-row.is-folder .fb-name:hover { text-decoration: underline; }
.fb-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fb-size { font-size: 11px; color: var(--text-muted); white-space: nowrap; min-width: 64px; text-align: right; }
.fb-del { background: none; border: none; color: #ef4444; cursor: pointer; padding: 2px 6px; font-size: 13px; }
.fb-del:hover { color: #f87171; }
.fb-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
