/* ==========================================================================
   Cutback - Studio Dark Theme
   High-end Video Review & Collaboration Interface
   ========================================================================== */

[v-cloak] { display: none !important; }

:root {
    /* Color Palette - Studio Slate */
    --bg-app: #0b0e14;
    --bg-header: #10141d;
    --bg-surface: #141923;
    --bg-surface-raised: #1a202c;
    --bg-card: #161c28;
    --bg-card-hover: #1c2433;
    --bg-input: #0e1219;
    --bg-hover: #202838;
    
    /* Borders */
    --border-subtle: #1e2636;
    --border-default: #263145;
    --border-hover: #3b4963;
    --border-focus: #3b82f6;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accents */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-muted: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-muted: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.35);

    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.35);

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-muted: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.35);

    /* Shadows & Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
}

/* Base Elements */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

button, input, select, textarea {
    font-family: var(--font-sans);
}

/* Custom Clean Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Utility Helpers */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Common SVG Icon Styles */
.icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
    flex-shrink: 0;
    display: inline-block;
}

.icon-xs { width: 13px; height: 13px; stroke-width: 2; }
.icon-sm { width: 15px; height: 15px; stroke-width: 2; }
.icon-md { width: 18px; height: 18px; stroke-width: 2; }
.icon-lg { width: 22px; height: 22px; stroke-width: 2; }

/* Status Dot Component */
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.approved { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.status-dot.in_review { background: var(--primary); box-shadow: 0 0 6px rgba(59, 130, 246, 0.5); }
.status-dot.changes_requested { background: var(--warning); box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.status-dot.pending { background: var(--text-muted); opacity: 0.6; }

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */
.app-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: visible;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.brand-logo-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.breadcrumb-separator {
    color: var(--border-hover);
}

.breadcrumb-text {
    max-width: 220px;
    color: var(--text-secondary);
}

.project-dropdown {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    cursor: pointer;
    max-width: 220px;
    outline: none;
    transition: all 0.15s ease;
}
.project-dropdown:focus, .project-dropdown:hover {
    border-color: var(--border-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 4px 12px 4px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 34px;
    box-sizing: border-box;
}

.header-pill-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.header-pill-text {
    max-width: 150px;
}

.user-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 4px 10px 4px 4px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 34px;
    box-sizing: border-box;
}
.user-avatar-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.user-avatar-name {
    max-width: 120px;
}

.user-avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */
.btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
    outline: none;
    user-select: none;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: #ffffff;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-surface-raised);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-approve {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-approve:hover:not(:disabled) {
    background: var(--success-hover);
    border-color: var(--success-hover);
}

.btn-danger {
    background: var(--danger-muted);
    color: var(--danger);
    border-color: var(--danger-border);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.32rem 0.65rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.22rem 0.5rem;
    font-size: 0.74rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 0.35rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Form Controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    background: var(--bg-surface-raised);
    color: var(--text-secondary);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: 1px solid var(--border-subtle);
}

.stats-badge {
    font-size: 0.74rem;
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid var(--warning-border);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: var(--font-mono);
}
.stats-badge.all-resolved {
    background: var(--success-muted);
    color: var(--success);
    border-color: var(--success-border);
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.dashboard {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.create-project {
    display: flex;
    gap: 0.5rem;
}
.create-project input {
    width: 260px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.delete-icon-btn {
    opacity: 0;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.project-card:hover .delete-icon-btn,
.video-list-header:hover .delete-icon-btn {
    opacity: 1;
}
.delete-icon-btn:hover {
    color: var(--danger) !important;
}

.project-videos-preview {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-video-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dashboard-video-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dashboard-video-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.dashboard-video-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dashboard-version-tag {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

.dashboard-video-stages {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-subtle);
}

.dashboard-stage-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dashboard-stage-node {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.dashboard-stage-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0.6;
}

.dashboard-current-stage-pill {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--primary-muted);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
}
.dashboard-current-stage-pill.pill-approved {
    background: var(--success-muted);
    border-color: var(--success-border);
    color: var(--success);
}

/* ==========================================================================
   WORKSPACE (Project / Video Review View)
   ========================================================================== */
.workspace {
    display: flex;
    padding: 1rem;
    gap: 1rem;
    height: calc(100vh - 60px);
    box-sizing: border-box;
    max-width: 1920px;
    margin: 0 auto;
}

/* Sidebar - Left */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: visible;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-scroll {
    overflow-y: auto;
    padding: 0.5rem;
    flex: 1;
}

.video-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.video-list li {
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 1px solid transparent;
    background: transparent;
}

.video-list li:hover {
    background: var(--bg-hover);
}

.video-list li.active {
    background: var(--bg-card);
    border-color: var(--border-default);
    box-shadow: var(--shadow-sm);
}

.video-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-list-title {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.video-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-stage-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    background: var(--primary-muted);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--primary);
    white-space: nowrap;
}
.sidebar-stage-badge.stage-done {
    background: var(--success-muted);
    border-color: var(--success-border);
    color: var(--success);
}

.sidebar-stage-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.sidebar-stage-pill {
    font-size: 0.68rem;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.sidebar-stage-pill.stage-approved {
    color: var(--success);
    border-color: var(--success-border);
}
.sidebar-stage-pill.stage-in_review {
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.3);
}
.sidebar-stage-pill.stage-changes_requested {
    color: var(--warning);
    border-color: var(--warning-border);
}

/* ==========================================================================
   REVIEW STAGES BAR (Top of Video Player)
   ========================================================================== */
.stages-top-nav {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stages-tabs-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stage-nav-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    overflow-x: auto;
}

.stage-nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.84rem;
    position: relative;
    user-select: none;
}

.stage-nav-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.stage-nav-tab.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
    border-top: 2px solid var(--primary);
}

.tab-step-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-surface-raised);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.stage-nav-tab.active .tab-step-badge {
    background: var(--primary-muted);
    color: var(--primary);
}
.stage-nav-tab.status-approved .tab-step-badge {
    background: var(--success-muted);
    color: var(--success);
}

.tab-title-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tab-stage-name {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.2;
}

.tab-stage-status-badge {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.stage-nav-tab.status-approved .tab-stage-status-badge { color: var(--success); }
.stage-nav-tab.status-in_review .tab-stage-status-badge { color: var(--primary); }
.stage-nav-tab.status-changes_requested .tab-stage-status-badge { color: var(--warning); }

.tab-comments-count {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-subtle);
    padding: 1px 5px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.stages-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    margin-left: auto;
}

.stage-status-chip {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0.65rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.stage-status-chip.approved {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid var(--success-border);
}
.stage-status-chip.pending {
    background: var(--bg-surface-raised);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.toggle-stage-details-btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-default) !important;
    color: var(--text-secondary) !important;
}
.toggle-stage-details-btn:hover {
    color: var(--text-primary) !important;
    border-color: var(--border-hover) !important;
}
.toggle-stage-details-btn.active {
    background: var(--primary-muted) !important;
    color: var(--primary) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

/* Collapsible Stage Details Drawer */
.stage-details-drawer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
}

.stage-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.stage-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stage-detail-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
}

.stage-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.access-info-text {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.stage-policy-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.detail-protocol-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.protocol-text { margin: 0; }
.protocol-note {
    margin: 4px 0 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-surface-raised);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--border-default);
}

/* ==========================================================================
   VIDEO PLAYER AREA
   ========================================================================== */
.video-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.video-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    position: relative;
}

.video-player-wrapper {
    width: 100%;
    flex: 1;
    background: #000000;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-js {
    width: 100% !important;
    height: 100% !important;
    background-color: #000000 !important;
}

.video-js .vjs-tech {
    object-fit: contain !important;
}

/* Custom VideoJS Big Play Button */
.video-js .vjs-big-play-button {
    background-color: rgba(16, 20, 29, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 64px !important;
    height: 64px !important;
    line-height: 62px !important;
    margin-top: -32px !important;
    margin-left: -32px !important;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease !important;
}
.video-js:hover .vjs-big-play-button {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: scale(1.08);
}

/* Timeline Markers */
.vjs-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--warning);
    top: -14px;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 50% 50% 0 50%;
    z-index: 30;
    cursor: pointer;
    box-shadow: -1px 1px 3px rgba(0,0,0,0.5);
    transition: transform 0.15s, background 0.15s;
    pointer-events: auto;
}
.vjs-marker:hover {
    transform: translateX(-50%) rotate(45deg) scale(1.3);
    z-index: 40;
}
.vjs-marker::after {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
}
.vjs-marker.resolved {
    background: var(--success);
}

/* Video Toolbar Under Player */
.video-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Comment Input Bar */
.comment-input {
    background: var(--bg-surface);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.comment-input input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
}

.timecode-chip-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.timecode-chip-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--primary);
}

.draw-toggle-btn {
    white-space: nowrap;
}
.draw-toggle-btn.active {
    background: var(--danger-muted) !important;
    color: var(--danger) !important;
    border-color: var(--danger-border) !important;
}

.shape-count-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   ANNOTATIONS & DRAWING TOOLBAR
   ========================================================================== */
.annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    pointer-events: none;
    touch-action: none;
}
.annotation-canvas.interactive {
    pointer-events: auto;
    cursor: crosshair;
}

.annotation-toolbar {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(16, 20, 29, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border-default);
}

.tool-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.tool-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.tool-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.tool-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.color-dot:hover {
    transform: scale(1.2);
}
.color-dot.active {
    border-color: #ffffff;
    box-shadow: 0 0 6px currentColor;
    transform: scale(1.2);
}

/* ==========================================================================
   COMMENTS SIDEBAR - Right
   ========================================================================== */
.comments-sidebar {
    width: 360px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.comments-header h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.active-stage-tag {
    background: var(--primary-muted);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.comments-sidebar > ul {
    list-style: none;
    margin: 0;
    padding: 0.75rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-item {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: all 0.15s ease;
    background: var(--bg-card);
}
.comment-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.comment-item.is-resolved {
    opacity: 0.55;
    background: var(--bg-surface);
}
.comment-item.highlight {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.comment-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timecode {
    background: var(--bg-surface-raised);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--primary);
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}
.timecode:hover {
    background: var(--primary-muted);
    border-color: rgba(59, 130, 246, 0.4);
}

.comment-text {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-primary);
    cursor: pointer;
}

.comment-author-name {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

.drawing-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--primary-muted);
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    transition: all 0.15s ease;
}
.drawing-indicator:hover {
    transform: scale(1.1);
}

.reply-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}
.reply-link:hover {
    color: var(--primary);
}

.resolve-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--text-muted);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.resolve-btn:hover {
    color: var(--success);
}
.resolve-btn.is-active {
    color: var(--success);
}

.replies-list {
    margin-top: 0.35rem;
    padding-left: 0.65rem;
    border-left: 2px solid var(--border-default);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.reply-item {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.reply-input-box {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
}
.reply-input-box input {
    flex: 1;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
}

/* ==========================================================================
   DROPDOWNS
   ========================================================================== */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-surface-raised);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-default);
    min-width: 210px;
    z-index: 120;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.dropdown-header-label {
    padding: 6px 12px 4px 12px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dropdown-scroll-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dropdown-menu.left-aligned {
    right: auto;
    left: 0;
}

.dropdown-menu.bottom-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}

.dropdown-item {
    padding: 8px 12px;
    text-align: left;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.12s ease;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: #ffffff !important;
}

.dropdown-item.active-item {
    background: var(--primary-subtle);
    color: var(--primary-hover) !important;
    font-weight: 600;
}

.dropdown-item.danger {
    color: var(--danger) !important;
}
.dropdown-item.danger:hover {
    background: var(--danger-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 90;
    display: none; /* replaced by outside click listener */
}

/* ==========================================================================
   MODALS & AUTH
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    padding: 1rem;
    box-sizing: border-box;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    padding: 1.75rem 2rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.modal.modal-lg {
    max-width: 640px;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.86rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.85rem;
    background: var(--danger-muted);
    border: 1px solid var(--danger-border);
    padding: 0.65rem;
    border-radius: var(--radius-md);
}

/* Auth Cards */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-app);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2.25rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
}

.auth-card h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
    text-align: center;
}

.auth-description {
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.auth-error {
    background: var(--danger-muted);
    color: var(--danger);
    padding: 0.65rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid var(--danger-border);
}

.auth-success {
    background: var(--success-muted);
    color: var(--success);
    padding: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--success-border);
    font-size: 0.88rem;
}

/* Settings Panels */
.team-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Stage Manager in Settings Modal */
.stages-manager {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.stages-manager h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.stages-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.stage-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 0.45rem;
    box-sizing: border-box;
    width: 100%;
}

.stage-item-order {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
    min-width: 18px;
    flex-shrink: 0;
}

.stage-name-input {
    flex: 1 1 120px;
    min-width: 0;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.stage-admin-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.stage-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.stage-move-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px 5px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.stage-move-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}
.stage-move-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.add-stage-box {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.add-stage-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.preset-chip {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}
.preset-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Share Modal List */
.share-stage-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 1rem 0;
}

.share-stage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.share-stage-info h4 {
    margin: 0 0 2px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.share-stage-info p {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* ==========================================================================
   SEMANTIC UTILITY & CLEANUP CLASSES
   ========================================================================== */
.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.auth-brand-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.auth-brand-icon {
    color: var(--primary);
    width: 36px;
    height: 36px;
}

.auth-switch-row {
    text-align: center;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.auth-switch-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
.auth-switch-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

.auth-divider {
    text-align: center;
    margin: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-logout-row {
    text-align: center;
    margin-top: 1rem;
}

.auth-logout-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.15s ease;
}
.auth-logout-link:hover {
    color: var(--text-primary);
}

.section-heading {
    margin-top: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.team-add-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.team-table th {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-table td {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.smtp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.85);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    font-size: 1.1rem;
    font-weight: 500;
    backdrop-filter: blur(6px);
}

.share-general-link-row {
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

