/* OpenVidReview - Global Design Tokens (Frame.io-inspired dark theme) */

@font-face {
    font-family: 'Zalando Sans';
    src: url('/fonts/ZalandoSans-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nova Square';
    src: url('/fonts/NovaSquare-Bold.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Background */
    --bg-base: #0d0d0f;
    --bg-surface: #16161a;
    --bg-elevated: #1e1e24;
    --bg-overlay: #26262e;
    --bg-input: #1a1a20;

    /* Text */
    --text-primary: #ffffffed;
    --text-secondary: #ffffffa3;
    --text-tertiary: #ffffff5c;
    --text-inverse: #0d0d0f;

    /* Accent (purple - Frame.io inspired) */
    --accent: #fc4d08;
    --accent-hover: #e64507;
    --accent-active: #c73c06;
    --accent-subtle: rgba(252, 77, 8, 0.12);

    /* Status */
    --success: #34d399;
    --success-subtle: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-subtle: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-subtle: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;

    /* Borders */
    --border: #ffffff12;
    --border-hover: #ffffff1f;
    --border-focus: var(--accent);

    /* Shadows */
    --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 8px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(252, 77, 8,0.15);
    --shadow-glow-strong: 0 0 40px rgba(252, 77, 8,0.25);
    --shadow-3d: 0 10px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    --shadow-elevated: 0 20px 60px rgba(0,0,0,0.6), 0 4px 16px rgba(0,0,0,0.4);

    /* Glass */
    --glass-bg: rgba(22, 22, 26, 0.7);
    --glass-border: rgba(255,255,255,0.08);
    --glass-blur: 20px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography */
    --font-body: 'Zalando Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 28px;

    /* Transitions */
    --ease: cubic-bezier(0.2, 0.4, 0.1, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.15s;
    --duration-md: 0.25s;
    --duration-lg: 0.4s;

    /* Comment colors */
    --flag-blue: #4cb7e3;
    --flag-cyan: #67e8f9;
    --flag-green: #6AA84F;
    --flag-pink: #f472b6;
    --flag-red: #f87171;
    --flag-yellow: #fbbf24;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Suppress all transitions/animations until page is ready */
body.preload, body.preload *, body.preload *::before, body.preload *::after {
    transition: none !important;
    animation: none !important;
}

html {
    height: 100%;
    width: 100%;
    color-scheme: dark;
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    height: 36px;
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--duration) var(--ease);
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--border-focus);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #ff8d5d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(252, 77, 8, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #ff7a3f 100%);
    box-shadow: 0 6px 25px rgba(252, 77, 8, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--accent-active);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(252, 77, 8, 0.25);
}

.btn-secondary {
    background: var(--bg-overlay);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-hover);
}

.btn-danger {
    background: var(--danger-subtle);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-success {
    background: var(--success-subtle);
    color: var(--success);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.2);
}

.btn-sm {
    height: 28px;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    height: 44px;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-md);
}

.btn-icon {
    width: 36px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 28px;
}

/* Inputs */
.input, .select {
    width: 100%;
    height: 40px;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    outline: none;
}

.input::placeholder {
    color: var(--text-tertiary);
}

.input:hover {
    border-color: var(--border-hover);
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle), 0 0 20px rgba(252, 77, 8, 0.1);
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff5c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* Labels */
.label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

/* Cards */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: border-color var(--duration-md) var(--ease), transform var(--duration-md) var(--ease), box-shadow var(--duration-md) var(--ease);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-3d);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1.6;
}

.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger { background: var(--danger-subtle); color: var(--danger); }
.badge-info { background: rgba(96, 165, 250, 0.12); color: var(--info); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Utilities */
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Nav Rail (Left Sidebar) ─── */
.nav-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 80px;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) 0;
    z-index: 200;
}

.nav-rail-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-4);
    flex-shrink: 0;
    transition: transform var(--duration) var(--ease);
}

.nav-rail-brand:hover {
    transform: scale(1.1);
}

.nav-rail-brand img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.nav-rail-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    flex: 1;
}

.nav-rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.nav-rail-link {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-rail-link:hover {
    background: var(--bg-overlay);
    color: var(--text-primary);
}

.nav-rail-link.active {
    background: var(--accent-subtle);
    color: var(--accent);
}

.nav-rail-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-rail-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-admin-badge {
    position: absolute;
    top: 0;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 2px var(--bg-base);
    z-index: 1;
}

/* Tooltip on hover */
.nav-rail-link::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    z-index: 300;
}

.nav-rail-link:hover::after {
    opacity: 1;
}

/* Nav-rail offset for page content */
body.has-nav-rail {
    padding-left: 80px;
}
