/* ==========================================================================
   Nexova Studio PRO | Nexova Media Edition — Crimson Dark Glass Design System
   Matched to nexovamedia.xyz (#0a0101, #ef4444, #f87171, #dc2626, #06b6d4)
   ========================================================================== */

:root {
    /* Nexova Media Core Color Token System */
    --bg-dark: #0a0101;
    --bg-surface: linear-gradient(135deg, rgba(40, 8, 8, 0.72), rgba(20, 4, 4, 0.65));
    --bg-surface-hover: rgba(50, 14, 14, 0.82);
    --bg-card: rgba(30, 8, 8, 0.65);
    --bg-input: rgba(18, 4, 4, 0.9);
    
    /* Nexova Crimson & Cyan Brand Accents */
    --primary: #ef4444;
    --primary-mid: #dc2626;
    --primary-light: #f87171;
    --primary-dark: #b91c1c;
    --primary-glow: rgba(239, 68, 68, 0.35);
    --brand-red: #ef4444;
    --brand-red-glow: rgba(239, 68, 68, 0.5);
    
    --secondary: #06b6d4;
    --secondary-light: #67e8f9;
    
    --accent: #dc2626;
    --accent-dark: #991b1b;
    --accent-light: #fca5a5;
    --accent-glow: rgba(239, 68, 68, 0.35);
    
    --neon-cyan: #ef4444;
    --neon-purple: #dc2626;
    --primary-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --accent-gradient: linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    --text-gradient: linear-gradient(135deg, #ffffff 0%, #f87171 45%, #ef4444 100%);
    
    --cyan: #f87171;
    --emerald: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.3);
    --rose: #f87171;
    --rose-glow: rgba(239, 68, 68, 0.25);
    
    /* Nexova Glass & Borders */
    --border: rgba(239, 68, 68, 0.15);
    --border-cyan: rgba(239, 68, 68, 0.25);
    --border-purple: rgba(220, 38, 38, 0.25);
    --border-hover: rgba(239, 68, 68, 0.45);
    --glass-highlight: inset 0 1px 0 rgba(255, 100, 100, 0.08);
    
    /* Nexova Typography */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Radii & Elevation */
    --radius-2xl: 24px;
    --radius-xl: 14px;
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-full: 9999px;
    
    --shadow-card: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
    --shadow-subtle: var(--shadow-card), var(--glass-highlight);
    --shadow-glow: 0 16px 40px -10px rgba(239, 68, 68, 0.3), var(--glass-highlight);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fluid: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset & Global Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
    background: var(--bg-dark);
}

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(220, 20, 20, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(180, 10, 10, 0.35) 0%, transparent 60%),
        linear-gradient(160deg, #1a0505, #2a0808 40%, #150202);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 24px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.025em;
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(135deg, #fff, #f87171 45%, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f87171, #06b6d4);
    z-index: 9999;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(239, 68, 68, 0.28); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(239, 68, 68, 0.55); }

/* Nexova Ambient Background Lighting, Particles & Grid */
.background-ambient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#nexova-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
}

@keyframes orbFloat {
    0% { transform: translate(0) scale(1) rotate(0); opacity: 0.5; }
    33% { transform: translate(30px, -20px) scale(1.1) rotate(5deg); opacity: 0.8; }
    66% { transform: translate(-20px, 15px) scale(0.9) rotate(-3deg); opacity: 0.6; }
    100% { transform: translate(0) scale(1) rotate(0); opacity: 0.5; }
}

@keyframes gridBreathe {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

.grid-pattern {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image: radial-gradient(rgba(239, 68, 68, 0.14) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
    pointer-events: none;
    animation: gridBreathe 12s var(--ease-fluid) infinite;
}

.ambient-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.glow-1 {
    top: -12%;
    left: 15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(220, 30, 30, 0.4) 0%, rgba(180, 10, 10, 0.2) 40%, transparent 70%);
    filter: blur(90px);
    animation: orbFloat 14s ease-in-out infinite alternate;
}

.glow-2 {
    top: 25%;
    right: -12%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.22) 0%, rgba(180, 30, 30, 0.1) 40%, transparent 70%);
    filter: blur(100px);
    animation: orbFloat 25s ease-in-out infinite alternate-reverse;
}

.glow-3 {
    top: 65%;
    left: -8%;
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, rgba(180, 20, 20, 0.3) 0%, rgba(120, 10, 10, 0.15) 40%, transparent 70%);
    filter: blur(90px);
    animation: orbFloat 28s ease-in-out infinite;
}

/* App Container Layout */
.app-container {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 2;
}

/* Header Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(40, 8, 8, 0.78), rgba(20, 4, 4, 0.68));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 16px 28px;
    box-shadow: var(--shadow-subtle);
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0; left: 24px; right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.55) 35%, rgba(248, 113, 113, 0.45) 65%, transparent 100%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    background: #140303;
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.55);
    transition: all 0.3s var(--ease-out-expo);
}

.brand-logo:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
    transform: scale(1.1);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-pro {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    letter-spacing: 0.7px;
    box-shadow: 0 2px 14px rgba(239, 68, 68, 0.45);
}

.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Pulsing Status Dot */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--emerald);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--emerald);
}

.header-metrics {
    display: flex;
    gap: 16px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-lg);
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}
.metric-value.highlight { color: var(--cyan); }

/* Main Studio Layout Grid */
.studio-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
}

/* Panel Cards (Nexova .glass-card styling) */
.panel-card {
    background: linear-gradient(135deg, rgba(40, 8, 8, 0.72), rgba(20, 4, 4, 0.62));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-2xl);
    padding: 24px;
    box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 100, 100, 0.06);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--ease-fluid), box-shadow 0.4s var(--ease-fluid), border-color 0.4s var(--ease-fluid);
}

.panel-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.07), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-fluid);
    pointer-events: none;
}

.panel-card:hover {
    border-color: rgba(239, 68, 68, 0.38);
    box-shadow: var(--shadow-card), 0 0 30px rgba(220, 30, 30, 0.16);
}

.panel-card:hover::before {
    opacity: 1;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.015em;
}

.panel-title svg {
    color: var(--primary-light);
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Form Controls */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.custom-input, .custom-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.25s var(--ease-out-expo);
}

.custom-input:focus, .custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 0 25px rgba(239, 68, 68, 0.18);
    background: rgba(24, 5, 5, 0.98);
}

.text-center { text-align: center; }

.custom-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 16px;
    color: var(--primary-light);
    pointer-events: none;
}

.input-with-icon input {
    padding-left: 44px;
}

/* Watermark Canvas Preview */
.preview-canvas-wrapper {
    margin-bottom: 18px;
}

.preview-canvas {
    width: 100%;
    height: 110px;
    background: #090101;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-video-sim {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.25), transparent 70%),
                radial-gradient(circle at 70% 70%, rgba(220, 38, 38, 0.2), transparent 70%);
}

.watermark-overlay-text {
    position: relative;
    z-index: 2;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    opacity: 0.35;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.5px;
    text-align: center;
    word-break: break-all;
}

.watermark-overlay-img {
    position: relative;
    z-index: 2;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

/* Nexova Pill Buttons with Diagonal Light Sweep */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s var(--ease-out-expo);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 46px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.65s ease;
    pointer-events: none;
}

.btn:hover::after {
    transform: rotate(30deg) translateY(100%);
}

.btn-full { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 22px rgba(239, 68, 68, 0.45);
}
.btn-primary:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 10px 35px rgba(239, 68, 68, 0.65);
}
.btn-primary:active { transform: scale(0.96) translateY(0); }

.btn-accent {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 22px rgba(239, 68, 68, 0.4);
}
.btn-accent:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 10px 35px rgba(239, 68, 68, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(239, 68, 68, 0.45);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.08);
    color: var(--primary-light);
    border: 1px solid rgba(239, 68, 68, 0.22);
}
.btn-danger-ghost:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.btn-cluster {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Multi-Platform Pills & Live Detector Badge */
.platform-pills-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px 0;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    transition: all 0.25s var(--ease-out-expo);
    user-select: none;
}

.platform-chip.active {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.65);
    color: #fff;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.platform-detect-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.18);
    transition: all 0.25s ease;
}

.platform-detect-badge.detected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(220, 38, 38, 0.22));
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}

/* Custom Trim vs Full Reel Mode Switch */
.clip-mode-switch {
    display: inline-flex;
    background: rgba(14, 3, 3, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 3px;
}

.mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* Info Box */
.info-box {
    padding: 18px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-lg);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.info-text strong {
    font-size: 13px;
    color: #fff;
}
.info-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Studio Navigation Tab Bar */
.tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(25, 5, 5, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-pill {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.25s var(--ease-out-expo);
    white-space: nowrap;
    min-height: 44px;
}

.tab-pill:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.08);
}

.tab-pill.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(220, 38, 38, 0.14));
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 4px 22px rgba(239, 68, 68, 0.22);
}

.pill-badge {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
}
.pill-badge.accent { background: linear-gradient(135deg, #ef4444, #dc2626); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Creator Form Layout */
.creator-card h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.creator-form {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1.2fr auto;
    gap: 12px;
    align-items: flex-end;
    margin-top: 18px;
}

.form-row-time {
    display: contents;
}

.creator-buttons-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.panel-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.no-margin { margin: 0 !important; }

/* Queue Items Container */
.queue-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.queue-item {
    background: rgba(24, 5, 5, 0.65);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 16px;
    display: grid;
    grid-template-columns: 2.2fr 1.2fr 1fr 1fr auto;
    gap: 14px;
    align-items: center;
    transition: all 0.25s var(--ease-fluid);
}

.queue-item:hover {
    border-color: var(--border-hover);
    background: rgba(38, 8, 8, 0.8);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 20px rgba(239, 68, 68, 0.12);
}

.queue-item-info h4 {
    font-size: 14px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Exported Library Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.clip-card {
    background: linear-gradient(135deg, rgba(35, 7, 7, 0.72), rgba(18, 3, 3, 0.65));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 20px;
    transition: all 0.3s var(--ease-fluid);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.clip-card-video {
    width: 100%;
    height: 190px;
    border-radius: var(--radius-lg);
    background: #000;
    object-fit: contain;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.clip-card:hover {
    border-color: rgba(239, 68, 68, 0.48);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.65), 0 0 28px rgba(239, 68, 68, 0.2);
}

/* Render Progress Banner */
.render-banner {
    border-color: rgba(239, 68, 68, 0.55);
    background: linear-gradient(135deg, rgba(45, 9, 9, 0.92), rgba(22, 4, 4, 0.92));
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.22);
    margin-bottom: 20px;
}

.render-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.render-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.spinner-ring {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(239, 68, 68, 0.22);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

.status-tag {
    background: rgba(239, 68, 68, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.progress-track {
    margin-top: 14px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #ef4444, #f87171, #06b6d4);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    transition: width 0.4s ease;
}

/* Empty State Box */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.empty-state h4 {
    font-size: 15px;
    color: #fff;
    font-weight: 700;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 360px;
}

/* Toast Notifications */
.toast-banner {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: linear-gradient(135deg, rgba(40, 8, 8, 0.96), rgba(20, 4, 4, 0.96));
    backdrop-filter: blur(24px);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 480px;
}
.toast-banner.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

/* ==========================================================================
   Mobile-First & Ultra-Responsive Adaptations
   Optimized for iPhone, Android, Foldables & Tablets
   ========================================================================== */

/* Tablet & Mobile Screens (<= 960px) */
@media (max-width: 960px) {
    body {
        padding: 14px;
        padding-top: max(14px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .app-container {
        gap: 16px;
    }

    /* Flip layout: Main clipper comes FIRST on mobile so user never scrolls past settings! */
    .studio-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .studio-main {
        order: 1;
        width: 100%;
    }

    .studio-sidebar {
        order: 2;
        width: 100%;
    }

    /* Navbar Tablet/Mobile Layout */
    .navbar {
        padding: 14px 18px;
        gap: 14px;
        border-radius: var(--radius-xl);
    }

    .header-right {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .header-metrics {
        gap: 8px;
    }

    .metric-item {
        padding: 5px 10px;
        font-size: 11px;
    }

    .metric-value {
        font-size: 13px;
    }

    /* Creator Form on Mobile */
    .creator-form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 14px;
    }

    .creator-form > .field-url,
    .creator-form > .field-title {
        width: 100%;
    }

    /* Side-by-side start/end timestamps on mobile */
    .form-row-time {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .form-row-time .form-field {
        margin-bottom: 0;
    }

    /* Action Buttons Container */
    .creator-buttons-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 6px;
    }

    .creator-buttons-row .btn {
        width: 100%;
        min-height: 48px;
    }
}

/* Smartphone Screens (<= 640px) */
@media (max-width: 640px) {
    body {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    .app-container {
        gap: 12px;
    }

    /* Navbar Mobile Header */
    .navbar {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .brand {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .brand-title {
        font-size: 16px;
        gap: 6px;
    }

    .badge-pro {
        font-size: 8.5px;
        padding: 2px 6px;
    }

    .brand-sub {
        font-size: 10.5px;
    }

    .header-right {
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 10px;
        margin-top: 2px;
    }

    .status-indicator {
        padding: 4px 10px;
    }

    .status-text {
        font-size: 11px;
    }

    .header-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .metric-item {
        justify-content: center;
        padding: 6px 4px;
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }

    .metric-label {
        font-size: 8.5px;
    }

    .metric-value {
        font-size: 12px;
    }

    /* Cards & Panels */
    .panel-card {
        padding: 16px;
        border-radius: 16px;
        margin-bottom: 14px;
    }

    .creator-header h2 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 12px;
    }

    /* CRITICAL iOS SAFARI FIX: 16px font-size prevents auto-zoom on input focus */
    .custom-input, 
    .custom-select, 
    textarea.custom-input {
        font-size: 16px !important;
        padding: 12px 14px;
        min-height: 48px;
        border-radius: 12px;
    }

    .input-with-icon svg {
        left: 14px;
    }

    .input-with-icon input {
        padding-left: 40px;
    }

    /* Tab Bar Mobile Polish */
    .tab-bar {
        padding: 4px;
        border-radius: 14px;
        gap: 4px;
        margin-bottom: 14px;
    }

    .tab-pill {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
        min-height: 42px;
        gap: 6px;
        border-radius: 10px;
    }

    .tab-pill svg {
        width: 14px;
        height: 14px;
    }

    .pill-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    /* Queue Items on Mobile */
    .queue-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border-radius: 14px;
    }

    .queue-item-info {
        width: 100%;
    }

    /* Library Cards on Mobile */
    .library-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .clip-card {
        padding: 14px;
        border-radius: 14px;
    }

    .clip-card-video {
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 220px;
        border-radius: 10px;
    }

    .panel-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .btn-cluster {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .btn-cluster .btn,
    .btn-cluster input {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Buttons */
    .btn {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 12px;
    }

    /* Toast Notification Floating on Mobile */
    .toast-banner {
        left: 12px;
        right: 12px;
        bottom: 16px;
        max-width: none;
        padding: 12px 18px;
        border-radius: 14px;
        text-align: center;
        font-size: 12px;
    }
}

/* ==========================================================================
   Professional Signature Footer — Designed & Engineered by Nitesh
   ========================================================================== */

.studio-footer {
    margin-top: 36px;
    background: linear-gradient(135deg, rgba(40, 8, 8, 0.78), rgba(20, 4, 4, 0.68));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 24px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}

.footer-ambient-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #ef4444 35%, #f87171 65%, transparent 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: #140303;
    border: 2px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-brand-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-edition {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    letter-spacing: 0.6px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

.footer-brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.footer-signature-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.signature-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.28);
    padding: 6px 16px;
    border-radius: 30px;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.14);
    transition: all 0.3s var(--ease-out-expo);
}

.signature-pill:hover {
    border-color: var(--primary);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.sig-status-light {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.sig-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.sig-author {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f87171 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.4px;
}

.footer-copyright {
    font-size: 11px;
    color: var(--text-subtle);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-signature-container {
        align-items: flex-start;
        width: 100%;
    }
}
