:root {
    /* Dark Theme Colors */
    --bg-primary: #0F1117;
    --bg-surface: #1A1D29;
    --bg-surface-hover: #22252F;
    --bg-elevated: #1A1D29;
    
    /* Brand Colors */
    --purple-primary: #8B5CF6;
    --purple-dark: #3D1B7E;
    --purple-light: #A78BFA;
    --blue-primary: #0D6EFD;
    --blue-dark: #0B5ED7;
    
    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-accent: #8B5CF6;
    
    /* Border & Divider */
    --border-color: #2D3343;
    --border-hover: #3D4458;
    
    /* Status Colors */
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    
    /* Gradients */
    --gradient-purple: linear-gradient(135deg, #3D1B7E 0%, #8B5CF6 100%);
    --gradient-blue: linear-gradient(135deg, #0B5ED7 0%, #0D6EFD 100%);
    --gradient-surface: linear-gradient(135deg, #1A1D29 0%, #22252F 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 240px;
    --header-height: 64px;
    --content-max-width: 1120px;
}

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 100vw;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Utility Classes */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    transition: all var(--transition-base);
}

.card:hover {
    background: var(--bg-surface-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gradient-blue);
    color: white;
}

.btn-secondary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-surface-hover);
    border-color: var(--purple-primary);
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.input:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--bg-primary);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-purple);
    transition: width var(--transition-base);
}

.progress-bar-animated {
    animation: progress-indeterminate 1.5s infinite;
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple-light);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--purple-primary);
    background: rgba(139, 92, 246, 0.05);
}

.video-preview {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.video-preview:hover .overlay {
    opacity: 1;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.empty-state {
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--text-secondary);
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--purple-primary);
    outline-offset: 2px;
}

/* History Page Specific Styles */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-video img {
    object-fit: cover;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Aspect-ratio utilities (for proper video/image display) */
.ratio-16x9 { 
    position: relative; 
    width: 100%; 
    padding-top: 56.25%; /* 9/16 = 0.5625 */
}

.ratio-9x16 { 
    position: relative; 
    width: 100%; 
    padding-top: 177.78%; /* 16/9 = 1.7778 */
}

.ratio-16x9 > *, 
.ratio-9x16 > * { 
    position: absolute; 
    inset: 0; 
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}
