/* ===== ScriptHooks Cinematic Design System ===== */
/* Dark, dramatic, film-industry aesthetic with quick generation focus */

/* ===== CSS Variables ===== */
:root {
    /* Core Dark Palette - Lifted Blacks */
    --void: #060608;
    --obsidian: #060608;
    --charcoal: #141418;
    --graphite: #1a1a20;
    --slate-dark: #222228;
    --steel: #52525b;
    --zinc: #a0a0a8;
    --silver: #b0b4be;
    --ash: #b0b4be;
    --cloud: #e0e0e4;
    --pearl: #ffffff;
    --snow: #ffffff;

    /* Accent - Monochrome (white/gray) */
    --accent-glow: #ffffff;
    --accent-bright: #e4e4e7;
    --accent-deep: #b0b0ba;
    --accent-dark: #8a8a94;

    /* Secondary - Same monochrome */
    --cyan-glow: #e0e0e4;
    --cyan-bright: #b0b0ba;
    --cyan-deep: #8a8a94;

    /* Legacy amber aliases - mapped to white */
    --amber-glow: var(--accent-glow);
    --amber-bright: var(--accent-bright);
    --amber-deep: var(--accent-deep);
    --amber-dark: var(--accent-dark);

    /* Feedback Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;

    /* Gradients - Minimal, no color */
    --gradient-surface: linear-gradient(180deg, #060608 0%, #060608 100%);
    --gradient-card: linear-gradient(145deg, #141418 0%, #141418 100%);
    --gradient-accent: linear-gradient(135deg, var(--snow) 0%, var(--pearl) 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    --gradient-spotlight: none;

    /* Shadows - Minimal */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: none;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04);

    /* Typography */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --sidebar-width: 200px;
    --sidebar-expanded: 200px;
    --header-height: 56px;
    --content-max: 1200px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.cinematic {
    font-family: var(--font-body);
    background: #000000;
    color: var(--cloud);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Selection */
::selection {
    background: var(--amber-glow);
    color: var(--void);
}

/* ===== App Container ===== */
.app-cinematic {
    display: flex;
    min-height: 100vh;
    background: var(--void);
    position: relative;
}

/* Ambient glow effect */
.app-cinematic::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 60vh;
    background: var(--gradient-spotlight);
    pointer-events: none;
    z-index: 0;
}

/* ===== Sidebar - Minimal Icon-Based ===== */
.sidebar-cinematic {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #000000;
    border-right: 1px solid #1a1a1e;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: width var(--transition-slow);
}

.sidebar-cinematic:hover {
    width: var(--sidebar-expanded);
}

/* Logo */
.sidebar-logo-cinematic {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    overflow: hidden;
}

.sidebar-logo-cinematic a {
    display: flex;
    align-items: center;
}

.sidebar-logo-cinematic svg {
    width: 140px;
    height: 24px;
    flex-shrink: 0;
}

/* Logo text always visible on desktop */
.sidebar-logo-cinematic svg text {
    opacity: 1;
    transition: opacity var(--transition-base);
}

/* Navigation */
.nav-cinematic {
    flex: 1;
    padding: 4px 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-group {
    margin-bottom: 2px;
}

.nav-group-title {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--zinc);
    padding: 0 10px;
    margin-top: 12px;
    margin-bottom: 4px;
    opacity: 1;
    white-space: nowrap;
    transition: opacity var(--transition-base);
}

/* Color-coded section titles */
.nav-group-title[data-section="create"] { color: #60a5fa; }
.nav-group-title[data-section="analyze"] { color: #c084fc; }
.nav-group-title[data-section="manage"] { color: #34d399; }
.nav-group-title[data-section="resources"] { color: #fbbf24; }

.nav-item-cinematic {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--silver);
    text-decoration: none;
    transition: all 150ms ease;
    position: relative;
}

.nav-item-cinematic:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--pearl);
}

.nav-item-cinematic.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--snow);
}

.nav-icon-cinematic {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-cinematic svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.nav-label {
    font-size: 0.8125rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: all var(--transition-base);
}

/* Persona Indicator (Global Switcher) */
.persona-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 0 2px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--zinc);
    font-size: 0.7rem;
    transition: background 0.15s;
    position: relative;
    white-space: nowrap;
}
.persona-indicator:hover {
    background: rgba(255,255,255,0.06);
}
.persona-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}
.persona-name {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.persona-switch-arrow {
    opacity: 0.5;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.persona-popover {
    display: none;
    position: fixed;
    min-width: 200px;
    max-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    background: #1a1a1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.persona-popover.open {
    display: block;
}
.persona-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--zinc);
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.persona-popover-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.persona-popover-item.active {
    color: #fff;
}
.persona-popover-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.persona-popover-dot.active {
    background: #10b981;
}

/* Collapsed sidebar: hide persona text */
.sidebar-cinematic.collapsed .persona-indicator .persona-name,
.sidebar-cinematic.collapsed .persona-indicator .persona-switch-arrow {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer-cinematic {
    padding: 0 10px;
    border-top: 1px solid #1a1a1e;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.credits-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 4px;
    color: var(--zinc);
    font-size: 0.75rem;
    font-weight: 400;
    overflow: hidden;
}

.credits-pill .credits-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.credits-pill span {
    opacity: 1;
    width: auto;
    overflow: hidden;
    transition: opacity var(--transition-base);
}

.credits-pill svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--silver);
}

/* User Avatar */
.user-avatar-cinematic {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--graphite);
    border: 2px solid var(--steel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cloud);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    text-decoration: none;
}

.user-avatar-cinematic:hover {
    border-color: var(--snow);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
}

.user-row-name {
    font-size: 0.75rem;
    color: var(--zinc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Sidebar Toggle Button ===== */
.sidebar-toggle-btn {
    padding: 6px;
    background: none;
    border: none;
    color: var(--silver);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.sidebar-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

/* ===== Collapsed Sidebar State ===== */
.sidebar-cinematic.collapsed {
    width: 52px;
}
.sidebar-cinematic.collapsed .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}
.sidebar-cinematic.collapsed .nav-group-title {
    opacity: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}
.sidebar-cinematic.collapsed .nav-group-divider {
    display: block;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 10px;
}
.sidebar-cinematic.collapsed .sidebar-logo-cinematic svg text {
    opacity: 0;
}
.sidebar-cinematic.collapsed .sidebar-logo-cinematic .logo-text {
    display: none;
}
.sidebar-cinematic.collapsed .credits-pill span {
    opacity: 0;
    width: 0;
}
.sidebar-cinematic.collapsed .user-row-name {
    display: none;
}
.sidebar-cinematic.collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}
.sidebar-cinematic.collapsed .nav-item-cinematic {
    justify-content: center;
    padding: 0;
}
.sidebar-cinematic.collapsed .sidebar-logo-cinematic a {
    display: none !important;
}
.sidebar-cinematic.collapsed .sidebar-logo-cinematic {
    justify-content: center;
}
.sidebar-cinematic.collapsed .mode-toggle {
    display: none;
}
.sidebar-cinematic.collapsed .sidebar-footer-cinematic {
    align-items: center;
    padding: 0 4px;
}

/* Main content adjusts when sidebar is collapsed */
.sidebar-collapsed .main-cinematic {
    margin-left: 52px;
}

/* Divider between nav groups (visible only when collapsed) */
.nav-group-divider {
    display: none;
}

/* ===== Main Content ===== */
.main-cinematic {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    transition: margin-left var(--transition-slow);
}

.content-cinematic {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

/* ===== Page Header ===== */
.page-header-cinematic {
    margin-bottom: var(--space-10);
    text-align: center;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ash);
    margin-bottom: var(--space-4);
}

.page-eyebrow::before,
.page-eyebrow::after {
    content: '';
    width: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ash));
}

.page-eyebrow::after {
    background: linear-gradient(90deg, var(--ash), transparent);
}

.page-title-cinematic {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--snow);
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.page-subtitle-cinematic {
    font-size: 1.125rem;
    color: var(--ash);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.card-cinematic {
    background: #0e0e12;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card-cinematic::before {
    display: none;
}

.card-cinematic:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header-cinematic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.card-title-cinematic {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.card-subtitle-cinematic {
    font-size: 0.875rem;
    color: var(--ash);
    margin-top: var(--space-1);
}

/* ===== Quick Action Cards (Dashboard) ===== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.quick-action-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.quick-action-card:hover::before {
    opacity: 1;
}

.quick-action-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    position: relative;
    z-index: 1;
}

.quick-action-icon svg {
    width: 28px;
    height: 28px;
    color: var(--snow);
    stroke-width: 1.5;
}

.quick-action-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--snow);
    margin-bottom: var(--space-2);
    position: relative;
    z-index: 1;
}

.quick-action-desc {
    font-size: 0.9375rem;
    color: var(--ash);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.quick-action-arrow {
    position: absolute;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--silver);
    transition: all var(--transition-base);
}

.quick-action-card:hover .quick-action-arrow {
    background: var(--snow);
    color: var(--void);
    transform: translateX(4px);
}

/* ===== Primary Action Card (Generate) ===== */
.generate-card {
    background: var(--gradient-accent);
    border: none;
    position: relative;
    overflow: hidden;
}

.generate-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(25%, 25%); }
}

.generate-card .quick-action-icon {
    background: rgba(0, 0, 0, 0.2);
}

.generate-card .quick-action-icon svg {
    color: var(--void);
}

.generate-card .quick-action-title,
.generate-card .quick-action-desc {
    color: var(--void);
}

.generate-card .quick-action-arrow {
    background: rgba(0, 0, 0, 0.2);
    color: var(--void);
}

.generate-card:hover .quick-action-arrow {
    background: var(--void);
    color: var(--snow);
}

/* ===== Stats Grid ===== */
.stats-grid-cinematic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.stat-card-cinematic {
    background: var(--graphite);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
}

.stat-value-cinematic {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--snow);
    margin-bottom: var(--space-1);
}

.stat-value-cinematic.accent {
    color: var(--snow);
}

.stat-label-cinematic {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--zinc);
}

/* ===== Form Elements ===== */
.form-group-cinematic {
    margin-bottom: var(--space-5);
}

.form-label-cinematic {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ash);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input-cinematic {
    width: 100%;
    padding: var(--space-4);
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--snow);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input-cinematic::placeholder {
    color: var(--zinc);
}

.form-input-cinematic:focus {
    outline: none;
    border-color: var(--snow);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
    background: var(--graphite);
}

.form-select-cinematic {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    padding-right: var(--space-12);
    cursor: pointer;
}

.form-select-cinematic option {
    background: var(--charcoal);
    color: var(--snow);
}

/* Textarea */
.form-textarea-cinematic {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ===== Buttons ===== */
.btn-cinematic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary-cinematic {
    background: #ffffff;
    color: #000000;
    box-shadow: none;
    border: none;
}

.btn-primary-cinematic:hover {
    background: #e4e4e7;
    transform: none;
    box-shadow: none;
}

.btn-primary-cinematic:active {
    transform: translateY(0);
}

.btn-secondary-cinematic {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--cloud);
}

.btn-secondary-cinematic:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost-cinematic {
    background: transparent;
    color: var(--ash);
    padding: var(--space-2) var(--space-3);
}

.btn-ghost-cinematic:hover {
    color: var(--snow);
    background: rgba(255, 255, 255, 0.08);
}

.btn-lg {
    padding: var(--space-5) var(--space-8);
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* ===== Pill Tabs ===== */
.pill-tabs-cinematic {
    display: inline-flex;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--charcoal);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pill-tab {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--silver);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pill-tab:hover {
    color: var(--cloud);
}

.pill-tab.active {
    background: var(--snow);
    color: var(--void);
}

/* ===== Output Display ===== */
.output-cinematic {
    background: var(--charcoal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.output-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ash);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.output-actions {
    display: flex;
    gap: var(--space-2);
}

.output-content {
    padding: var(--space-6);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--pearl);
    white-space: pre-wrap;
}

/* Script specific */
.script-hook {
    color: var(--snow);
    font-weight: 500;
}

.script-broll {
    display: block;
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    background: rgba(34, 211, 238, 0.08);
    border-left: 3px solid var(--cyan-bright);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.875rem;
    color: var(--cyan-glow);
    font-style: italic;
}

.script-cta {
    color: var(--success);
    font-weight: 500;
}

/* ===== Trending Item ===== */
.trending-item-cinematic {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.trending-item-cinematic:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.trending-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--snow);
    width: 32px;
    text-align: center;
}

.trending-content {
    flex: 1;
    min-width: 0;
}

.trending-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-1);
}

.trending-meta {
    font-size: 0.75rem;
    color: var(--zinc);
}

.trending-growth {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ===== Empty State ===== */
.empty-state-cinematic {
    text-align: center;
    padding: var(--space-12) var(--space-8);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-5);
    color: var(--zinc);
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--pearl);
    margin-bottom: var(--space-2);
}

.empty-desc {
    font-size: 0.9375rem;
    color: var(--ash);
    margin-bottom: var(--space-6);
}

/* ===== Loading States ===== */
.skeleton {
    background: linear-gradient(90deg, var(--charcoal) 25%, var(--graphite) 50%, var(--charcoal) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner-cinematic {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--snow);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* ===== Tooltips ===== */
.tooltip-cinematic {
    position: relative;
}

.tooltip-cinematic::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--space-2) var(--space-3);
    background: var(--graphite);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--pearl);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.tooltip-cinematic:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* ===== Badges ===== */
.badge-cinematic {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.badge-new {
    background: rgba(255, 255, 255, 0.1);
    color: var(--snow);
}

.badge-pro {
    background: var(--snow);
    color: var(--void);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid-cinematic {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    .sidebar-cinematic {
        transform: translateX(-100%);
        width: var(--sidebar-expanded);
    }

    .sidebar-cinematic.open {
        transform: translateX(0);
    }

    .sidebar-cinematic.open .nav-label {
        opacity: 1;
        transform: translateX(0);
    }

    .sidebar-cinematic.open .sidebar-logo-cinematic svg text {
        opacity: 1;
    }

    .sidebar-cinematic.open .nav-group-title {
        opacity: 1;
    }

    .sidebar-cinematic.open .credits-pill {
        width: auto;
        padding: var(--space-2) var(--space-3);
    }

    .sidebar-cinematic.open .credits-pill span {
        opacity: 1;
        width: auto;
    }

    .main-cinematic {
        margin-left: 0;
    }

    .content-cinematic {
        padding: var(--space-5) var(--space-4);
    }

    .page-title-cinematic {
        font-size: 2rem;
    }

    .stats-grid-cinematic {
        grid-template-columns: 1fr;
    }

    .quick-action-card {
        padding: var(--space-6);
    }
}

/* ===== Mobile Menu Toggle ===== */
.mobile-toggle-cinematic {
    display: none;
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 101;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--graphite);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-toggle-cinematic {
        display: flex;
    }
}

.mobile-toggle-cinematic span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--cloud);
    position: relative;
    transition: all var(--transition-fast);
}

.mobile-toggle-cinematic span::before,
.mobile-toggle-cinematic span::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--cloud);
    left: 0;
    transition: all var(--transition-fast);
}

.mobile-toggle-cinematic span::before {
    top: -6px;
}

.mobile-toggle-cinematic span::after {
    bottom: -6px;
}

/* Mobile overlay */
.sidebar-overlay-cinematic {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

@media (max-width: 768px) {
    .sidebar-overlay-cinematic.active {
        display: block;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft var(--transition-slow) ease-out;
}

/* Stagger delays */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }

/* ===== Utility Classes ===== */
.text-amber { color: var(--snow); }
.text-cyan { color: var(--cyan-glow); }
.text-success { color: var(--success); }
.text-muted { color: var(--zinc); }

.bg-card { background: var(--gradient-card); }
.bg-surface { background: var(--charcoal); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.font-serif { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.pointer-events-none { pointer-events: none; }

.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

/* ===== Mode Toggle (AI Chat / Studio) ===== */
.mode-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin: 8px 6px 4px;
    padding: 2px;
}
.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-body);
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #9a9aa4;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.mode-tab:hover {
    color: #c8cad0;
}
.mode-tab.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: default;
}
.mode-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
/* Collapsed sidebar: icon-only */
.sidebar-cinematic.collapsed .mode-toggle {
    margin: 4px 4px 2px;
}
.sidebar-cinematic.collapsed .mode-tab {
    height: 28px;
    font-size: 0;
    gap: 0;
}
.sidebar-cinematic.collapsed .mode-tab svg {
    width: 16px;
    height: 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ===== Mobile Bottom Nav ===== */
#teamSettingsNav { display: none; }

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    .main-cinematic {
        padding-bottom: 68px;
    }
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--zinc, #71717a);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav a svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.mobile-bottom-nav a.active {
    color: var(--snow, #fafafa);
}

.mobile-bottom-nav a:active {
    color: var(--snow, #fafafa);
}
