/**
 * ClipFarm Modern UI - Complete Redesign
 * Professional dark theme with clean aesthetics
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    /* Accent Colors */
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    
    /* Background Colors */
    --bg-0: #030712;
    --bg-1: #0f172a;
    --bg-2: #1e293b;
    --bg-3: #334155;
    --bg-elevated: #1e293b;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;
    
    /* Borders */
    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-default: rgba(148, 163, 184, 0.2);
    --border-focus: var(--primary);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px var(--primary-glow);
    
    /* 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;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 72px;
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR - Modern Dark
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-1);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    padding: var(--space-4) var(--space-3) var(--space-2);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.nav-item.active svg {
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-pink);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-3);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-2);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent-green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: status-pulse 2s infinite;
}

.status-dot.offline {
    background: var(--text-muted);
    box-shadow: none;
    animation: none;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.top-bar {
    height: var(--header-height);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.session-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.session-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.session-details {
    display: flex;
    flex-direction: column;
}

.session-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.session-time {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Top Bar Actions */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mode Selector */
.mode-selector {
    display: flex;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-subtle);
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
}

.mode-btn svg {
    width: 16px;
    height: 16px;
}

.mode-btn.compact {
    padding: var(--space-2);
}

/* Mode Toggle in Header */
.mode-toggle {
    display: flex;
    gap: 4px;
}

/* Live Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-red);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent-red);
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Auth Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-2);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-3);
    border-color: var(--border-focus);
}

.btn-kick {
    background: linear-gradient(135deg, #53fc18 0%, #3dd110 100%);
    color: #000;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-2);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================
   QUICK STATUS BAR
   ============================================ */

.quick-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-4);
}

.status-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.quick-stat:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-stat svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.quick-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mode-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.mode-indicator .mode-icon svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.mode-name {
    color: var(--text-primary);
    font-weight: 600;
}

.mode-cooldown {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.beginner-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.beginner-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.toggle-label {
    white-space: nowrap;
}

/* ============================================
   PAGE CONTENT
   ============================================ */

.page-content {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
}

.section {
    display: none;
    max-width: 1600px;
    margin: 0 auto;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

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

/* ============================================
   GRID LAYOUTS
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-6);
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-6);
}

.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}

/* ============================================
   PRESET INDICATOR
   ============================================ */

.preset-dashboard-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: 0.9375rem;
}

.preset-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.preset-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.preset-value {
    color: var(--text-primary);
    font-weight: 600;
}

.smart-mode-dashboard-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.smart-mode-dashboard-indicator svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.smart-mode-dashboard-indicator .smart-settings {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   WARMUP BANNER
   ============================================ */

.warmup-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    margin: 0 var(--space-6) var(--space-6);
}

.warmup-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    color: var(--accent-orange);
    font-weight: 500;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.badge-purple {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.platform-badge.twitch {
    background: rgba(145, 71, 255, 0.2);
    color: #9147ff;
}

.platform-badge.kick {
    background: rgba(83, 252, 24, 0.2);
    color: #53fc18;
}

/* ============================================
   ACTIVITY FEED
   ============================================ */

.activity-feed {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-2);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.clip {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.activity-icon.join {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.activity-icon.leave {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-tertiary);
}

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

.activity-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.activity-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ============================================
   CLIP CARDS
   ============================================ */

.clip-card {
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.clip-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.clip-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.clip-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.clip-card:hover .clip-thumbnail img {
    transform: scale(1.05);
}

.clip-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.clip-card:hover .clip-overlay {
    opacity: 1;
}

.clip-actions {
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    display: flex;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.clip-card:hover .clip-actions {
    opacity: 1;
    transform: translateY(0);
}

.clip-info {
    padding: var(--space-4);
}

.clip-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.clip-quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.clip-quality-badge.LEGENDARY {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.clip-quality-badge.VIRAL {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--primary) 100%);
    color: white;
}

.clip-quality-badge.GREAT {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.clip-quality-badge.GOOD {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* ============================================
   STATS BAR (ALTERNATE)
   ============================================ */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-default);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-card .stat-icon.success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
}

.stat-card .stat-icon.warning {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #d97706 100%);
}

.stat-card .stat-icon.danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
}

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ============================================
   TOOLBAR
   ============================================ */

.clips-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-4);
}

.clips-filters {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
}

.clips-filters select {
    min-width: 140px;
}

.clips-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================
   BULK BAR
   ============================================ */

.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin: var(--space-4) var(--space-6);
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-primary);
    font-weight: 500;
}

.bulk-info svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-10);
}

.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--bg-2);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state .empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-tertiary);
}

.empty-state .empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state .empty-hint {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-3);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-2);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        padding: 0 var(--space-4);
    }
    
    .page-content {
        padding: var(--space-4);
    }
    
    .clips-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .clips-filters {
        flex-wrap: wrap;
    }
    
    .clips-filters select {
        flex: 1;
        min-width: 120px;
    }
    
    .viral-scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow {
    box-shadow: var(--shadow-glow);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* ============================================
   BATCH OPERATIONS
   ============================================ */

/* Clip Card Selection Checkbox */
.clip-checkbox-wrapper {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

.clip-checkbox-custom {
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.clip-checkbox-custom::after {
    content: '';
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.clip-checkbox-wrapper:hover .clip-checkbox-custom {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.clip-checkbox-wrapper input[type="checkbox"]:checked + .clip-checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.clip-checkbox-wrapper input[type="checkbox"]:checked + .clip-checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

/* Show checkbox on card hover */
.clip-card-enhanced .clip-checkbox-wrapper {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
}

.clip-card-enhanced:hover .clip-checkbox-wrapper,
.clip-card-enhanced.selected .clip-checkbox-wrapper {
    opacity: 1;
    transform: scale(1);
}

/* Selected clip card styling */
.clip-card-enhanced.selected {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
    transform: translateY(-2px);
}

.clip-card-enhanced.selected .clip-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-glow);
    pointer-events: none;
}

/* Deleted/Trash cards */
.clip-card-enhanced.deleted .clip-checkbox-custom {
    background: rgba(100, 100, 100, 0.6);
}

.clip-card-enhanced.deleted.selected {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

/* Bulk Actions Bar */
.bulk-bar {
    position: sticky;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

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

.bulk-bar.hidden {
    display: none !important;
}

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

.bulk-checkbox-wrapper {
    display: flex;
    align-items: center;
}

.bulk-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    accent-color: var(--primary);
}

.bulk-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-1);
    font-size: 15px;
}

.bulk-count svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bulk-actions .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bulk-actions .btn svg {
    width: 16px;
    height: 16px;
}

.bulk-actions .btn:hover {
    transform: translateY(-1px);
}

.bulk-actions .btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Responsive batch bar */
@media (max-width: 768px) {
    .bulk-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .bulk-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .bulk-info {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   KEYBOARD SHORTCUTS
   ============================================ */

/* Keyboard Shortcuts Modal */
.keyboard-shortcuts-modal .modal-content {
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.keyboard-shortcuts-modal .modal-body {
    overflow-y: auto;
    padding: 0;
}

.shortcuts-toggle {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-1);
}

.shortcuts-list {
    padding: var(--space-5);
}

.shortcuts-category {
    margin-bottom: var(--space-6);
}

.shortcuts-category:last-child {
    margin-bottom: 0;
}

.shortcuts-category-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
}

.shortcuts-category-title svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-3);
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.shortcut-item:hover {
    background: var(--bg-2);
    border-color: var(--border-default);
}

.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 0 var(--bg-0);
    white-space: nowrap;
}

.shortcut-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shortcuts-tip {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Keyboard Selected Clip */
.clip-card-enhanced.keyboard-selected {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: translateY(-2px);
    position: relative;
    z-index: 10;
}

.clip-card-enhanced.keyboard-selected::before {
    content: 'Selected';
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 11;
}

/* Toast notification enhancement for shortcuts */
.toast.shortcut-toast {
    background: var(--bg-2);
    border: 1px solid var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.toast.shortcut-toast .toast-message::before {
    content: '⌨️ ';
    margin-right: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .keyboard-shortcuts-modal .modal-content {
        max-width: 95vw;
        max-height: 90vh;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow {
    box-shadow: var(--shadow-glow);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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


/* ============================================
   CLIP PREVIEW MODAL
   ============================================ */

.clip-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.clip-preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.clip-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.clip-preview-container {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.clip-preview-modal.active .clip-preview-container {
    transform: scale(1);
}

/* Close Button */
.clip-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clip-preview-close:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.clip-preview-close svg {
    width: 20px;
    height: 20px;
}

/* Navigation Arrows */
.clip-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clip-preview-nav:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.clip-preview-nav:disabled,
.clip-preview-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.clip-preview-nav.prev {
    left: 16px;
}

.clip-preview-nav.next {
    right: 320px;
}

.clip-preview-nav svg {
    width: 24px;
    height: 24px;
}

/* Main Content */
.clip-preview-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Video Section */
.clip-preview-video-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
}

.clip-preview-video-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.clip-preview-video-wrapper.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    border-radius: 0;
}

.clip-preview-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.clip-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading Spinner */
.clip-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-1);
    color: var(--text-secondary);
}

.clip-preview-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.clip-preview-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--bg-1);
    color: var(--text-secondary);
    padding: 24px;
    text-align: center;
}

.clip-preview-error svg {
    width: 48px;
    height: 48px;
    color: var(--accent-red);
}

/* Play Overlay */
.clip-preview-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clip-preview-play-overlay:hover {
    background: rgba(0, 0, 0, 0.3);
}

.clip-preview-play-overlay.hidden {
    display: none;
}

.play-overlay-btn {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.play-overlay-btn:hover {
    transform: scale(1.1);
    background: var(--primary);
}

.play-overlay-btn svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
}

/* Video Controls */
.clip-preview-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clip-preview-video-wrapper:hover .clip-preview-controls,
.clip-preview-controls.show {
    opacity: 1;
}

.clip-preview-progress {
    margin-bottom: 12px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.clip-preview-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    color: white;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

/* Sidebar */
.clip-preview-sidebar {
    width: 320px;
    background: var(--bg-1);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.clip-preview-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Quality Badge */
.preview-quality-badge {
    margin-bottom: 20px;
}

.quality-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quality-badge.LEGENDARY {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.quality-badge.VIRAL {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--primary) 100%);
    color: white;
}

.quality-badge.GREAT {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.quality-badge.GOOD {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.quality-badge.manual {
    background: var(--bg-3);
    color: var(--text-secondary);
}

/* Metadata List */
.preview-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.meta-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.score-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.score-value.viral {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--primary) 100%);
    color: white;
}

.score-value.high {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.score-value.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.score-value.normal {
    background: var(--bg-2);
    color: var(--text-secondary);
}

/* Action Buttons */
.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-action-btn:hover {
    background: var(--bg-3);
    border-color: var(--border-focus);
}

.preview-action-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
}

.preview-action-btn.primary:hover {
    box-shadow: 0 4px 20px var(--primary-glow);
}

.preview-action-btn.danger {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

.preview-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
}

.preview-action-btn.starred {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.preview-action-btn.starred svg {
    fill: currentColor;
}

.preview-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Related Clips Section */
.preview-related-section {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-0);
}

.related-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.related-clips-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-empty {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 16px;
}

.related-clip-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-clip-item:hover {
    border-color: var(--border-default);
    background: var(--bg-2);
}

.related-thumbnail {
    position: relative;
    width: 80px;
    height: 45px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    color: var(--text-tertiary);
}

.related-placeholder svg {
    width: 20px;
    height: 20px;
}

.related-duration {
    position: absolute;
    bottom: 2px;
    right: 2px;
    padding: 1px 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: 3px;
}

.related-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-channel {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.related-score {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--bg-2);
}

.related-score.viral {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--primary) 100%);
    color: white;
}

.related-score.high {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.related-score.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* Clip Counter */
.clip-preview-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .clip-preview-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .clip-preview-content {
        flex-direction: column;
    }
    
    .clip-preview-sidebar {
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
    }
    
    .clip-preview-nav.next {
        right: 16px;
    }
    
    .preview-related-section {
        display: none;
    }
}

@media (max-width: 640px) {
    .clip-preview-nav {
        width: 36px;
        height: 36px;
    }
    
    .clip-preview-nav.prev {
        left: 8px;
    }
    
    .clip-preview-nav.next {
        right: 8px;
    }
    
    .clip-preview-controls {
        padding: 12px;
    }
    
    .time-display {
        display: none;
    }
}

/* ============================================
   PERFORMANCE DASHBOARD
   ============================================ */

/* Toolbar */
.perf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.perf-health-status {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.health-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s infinite;
}

.health-indicator.healthy {
    background: var(--accent-green);
}

.health-indicator.degraded {
    background: var(--accent-orange);
}

.health-indicator.critical {
    background: var(--accent-red);
    animation: pulse 1s infinite;
}

.health-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

.perf-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Cards Grid */
.perf-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.perf-card {
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
}

.perf-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md);
}

.perf-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.perf-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-2);
}

.perf-card-icon svg {
    width: 20px;
    height: 20px;
}

.perf-card-icon.memory {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
}

.perf-card-icon.cpu {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.perf-card-icon.lag {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.perf-card-icon.uptime {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.perf-card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.perf-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.perf-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.perf-value.warning {
    color: var(--accent-orange);
}

.perf-value.danger {
    color: var(--accent-red);
}

.perf-bar-container {
    height: 6px;
    background: var(--bg-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.perf-bar {
    height: 100%;
    background: var(--accent-green);
    border-radius: var(--radius-full);
    transition: width var(--transition-base), background var(--transition-base);
}

.perf-bar.warning {
    background: var(--accent-orange);
}

.perf-bar.danger {
    background: var(--accent-red);
}

/* Charts Grid */
.perf-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.perf-chart-card {
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.perf-chart-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.perf-chart-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.perf-chart-body {
    padding: var(--space-4);
    height: 200px;
}

.perf-chart-body canvas {
    width: 100%;
    height: 100%;
}

/* Sections */
.perf-section {
    background: var(--bg-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.perf-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.perf-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Stats Row */
.perf-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
}

.perf-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-2);
    border-radius: var(--radius-md);
}

.perf-stat-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.perf-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Connections */
.perf-connections {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.perf-connection {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.perf-connection.connected {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.perf-connection.disconnected {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.conn-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.perf-connection.connected .conn-indicator {
    background: var(--accent-green);
}

.perf-connection.disconnected .conn-indicator {
    background: var(--accent-red);
}

.conn-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.conn-status {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-transform: capitalize;
}

/* Table */
.perf-table-container {
    overflow-x: auto;
}

.perf-table {
    width: 100%;
    border-collapse: collapse;
}

.perf-table th,
.perf-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: 0.9375rem;
}

.perf-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-default);
}

.perf-table td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.perf-table tr:last-child td {
    border-bottom: none;
}

.perf-table .no-data {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-8);
}

.activity-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.activity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent-purple) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

/* Issues List */
.perf-issues-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.perf-issue {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.perf-issue::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.perf-issue.healthy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.perf-issue.healthy::before {
    background: var(--accent-green);
}

.perf-issue.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
}

.perf-issue.warning::before {
    background: var(--accent-orange);
}

.perf-issue.critical {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.perf-issue.critical::before {
    background: var(--accent-red);
}

/* Alerts */
.perf-alerts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.perf-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.perf-alert.info {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.perf-alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-orange);
}

.perf-alert.critical {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.alert-message {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.alert-time {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.alert-dismiss {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.alert-dismiss:hover {
    background: var(--bg-2);
    color: var(--text-primary);
}

.alert-dismiss svg {
    width: 16px;
    height: 16px;
}

.perf-no-alerts {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 768px) {
    .perf-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .perf-actions {
        justify-content: flex-end;
    }
    
    .perf-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .perf-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .perf-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .perf-connections {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .perf-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .perf-stats-row {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   CLIP PREVIEW OVERLAY ICON
   ============================================ */

.clip-preview-overlay-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clip-preview:hover .clip-preview-overlay-icon {
    opacity: 1;
}

.clip-preview-overlay-icon svg {
    width: 48px;
    height: 48px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Activity Thumbnail Play Button */
.activity-thumbnail {
    position: relative;
    width: 80px;
    height: 45px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.activity-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.activity-thumbnail:hover img {
    transform: scale(1.05);
}

.activity-thumbnail-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.activity-thumbnail:hover .activity-thumbnail-play {
    opacity: 1;
}

.activity-thumbnail-play svg {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Enhanced clip preview in activity items */
.activity-item .clip-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    color: var(--text-tertiary);
}

.activity-item .clip-preview-placeholder svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   CLIP CARDS ENHANCED - CLICKABLE STATE
   ============================================ */

.clip-card-enhanced .clip-preview {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.clip-card-enhanced .clip-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.clip-card-enhanced:hover .clip-preview img {
    transform: scale(1.05);
}
