:root {
    /* ShadCN-inspired color palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --bg-muted: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-muted-foreground: #94a3b8;
    
    --accent-primary: #0f172a;
    --accent-secondary: #475569;
    --accent-danger: #dc2626;
    --accent-warning: #f59e0b;
    --accent-success: #16a34a;
    
    --border-default: #e2e8f0;
    --border-light: #cbd5e1;
    --border-input: #e2e8f0;
    
    /* ShadCN-style radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Spacing system */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Inter", sans-serif;
    --font-mono: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
    
    /* ShadCN-style shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

/* Main layout structure */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar navigation - ShadCN style */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    padding: var(--space-xl) var(--space-lg);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    margin-bottom: var(--space-2xl);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

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

.logo-text {
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-left: 52px;
    font-weight: 400;
}

/* Navigation sections */
.nav-section {
    margin-bottom: var(--space-xl);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    padding: 0 var(--space-sm);
}

/* Navigation menu */
.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    margin: 0;
}

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

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

.nav-link.active {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background-color: var(--accent-primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-link span {
    flex: 1;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 6px;
    background-color: var(--accent-danger);
    color: white;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--space-2xl);
    background-color: var(--bg-primary);
    min-height: 100vh;
}

/* Page header */
.page-header {
    margin-bottom: var(--space-2xl);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.02em;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

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

/* Cards and panels - ShadCN style */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

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

.card-content {
    padding: var(--space-lg);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-default);
}

.card-header:last-child {
    border-bottom: none;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
    display: flex;
    align-items: center;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
    line-height: 1.5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-muted);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-xs) 0 0 0;
    letter-spacing: -0.02em;
}

/* Upload zone - ShadCN style */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-3xl) var(--space-xl);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    background-color: var(--bg-secondary);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-tertiary);
}

.upload-zone.active {
    border-color: var(--accent-primary);
    background-color: rgba(59, 130, 246, 0.05);
    border-style: solid;
}

.upload-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-lg);
    color: var(--text-muted);
    opacity: 0.6;
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

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

/* Buttons - ShadCN style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    gap: var(--space-md);
}

.btn-icon {
    padding: 0.5rem;
}

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

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

.btn:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

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

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

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-input);
}

.btn-secondary:hover {
    background-color: var(--bg-muted);
}

.btn-danger {
    background-color: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Form elements - ShadCN style */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

.form-input:required {
    border-color: var(--border-input);
}

.form-input:required:invalid {
    border-color: var(--accent-danger);
}

.form-input:required:valid {
    border-color: var(--accent-success);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-sans);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-group:has(input:required) .form-label::after {
    content: " *";
    color: var(--accent-danger);
}

/* Progress bar */
.progress-container {
    margin-bottom: var(--space-xl);
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.progress-label {
    color: var(--text-secondary);
}

.progress-value {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Search interface - ShadCN style */
.search-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.search-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.search-card:hover {
    box-shadow: var(--shadow-md);
}

.search-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background-color: var(--bg-hover);
    border-radius: 12px;
    color: var(--accent-primary);
}

.search-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.search-card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

/* Results section */
.results-container {
    margin-top: var(--space-2xl);
}

.result-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}

.result-item:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-md);
}

.result-title {
    font-weight: 600;
    color: var(--text-primary);
}

.result-badges {
    display: flex;
    gap: var(--space-sm);
}

.badge {
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.badge-danger {
    background-color: #fef2f2;
    color: var(--accent-danger);
    border-color: #fecaca;
}

.badge-warning {
    background-color: #fffbeb;
    color: var(--accent-warning);
    border-color: #fed7aa;
}

.badge-success {
    background-color: #f0fdf4;
    color: var(--accent-success);
    border-color: #bbf7d0;
}

.result-video {
    width: 100%;
    border-radius: 8px;
    margin-top: var(--space-md);
    background-color: #f3f4f6;
}

/* Status messages - ShadCN style */
.status-message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
}

.status-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--accent-success);
}

.status-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--accent-danger);
}

.status-info {
    background-color: #f0f9ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-hover) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: var(--space-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease-out;
}

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

.modal-header {
    margin-bottom: var(--space-xl);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

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

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-default);
}

/* Responsive design */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 101;
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    padding: var(--space-sm);
    border-radius: 8px;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-lg);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .search-container {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        padding: 0;
    }
    
    .step-label {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    .step-actions {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .step-actions .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .card-content {
        padding: var(--space-md);
    }
    
    .upload-zone {
        padding: var(--space-xl);
    }
    
    .modal-content {
        padding: var(--space-lg);
        width: 95%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .collections-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--space-2xl) 0;
    padding: 0 var(--space-xl);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-hover);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.step.active .step-number {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.step.completed .step-number {
    background-color: var(--accent-success);
    border-color: var(--accent-success);
    color: white;
}

.step-label {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    max-width: 120px;
}

.step.active .step-label {
    color: var(--text-primary);
}

.step.completed .step-label {
    color: var(--accent-success);
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-light);
    margin: 0 var(--space-md);
    position: relative;
    top: -24px;
}

.step-line.completed {
    background-color: var(--accent-success);
}

/* Step Content */
.step-content {
    animation: fadeIn 0.3s ease-out;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-default);
}

.step-actions .btn {
    min-width: 160px;
}

.step-actions .btn:only-child {
    margin-left: auto;
}

/* Info Box */
.info-box {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.info-box h4 {
    margin: 0 0 var(--space-md) 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.info-box ul {
    margin: 0;
    padding-left: var(--space-xl);
    list-style-type: disc;
}

.info-box li {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    padding: var(--space-sm) var(--space-md);
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    margin-bottom: var(--space-sm);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
}

/* Collection selector */
.collection-selector {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.collection-select {
    flex: 1;
}

/* Collections Container */
.collections-container {
    margin-top: var(--space-lg);
    width: 100%;
}

.collection-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.collection-card:hover {
    box-shadow: var(--shadow-md);
}

.collection-card.new-collection {
    border-style: dashed;
    border-width: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    text-align: center;
    background-color: transparent;
    box-shadow: none;
}

.collection-card.new-collection:hover {
    background-color: var(--bg-muted);
    border-color: var(--text-muted);
}

.collection-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-md);
}

.collection-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    word-break: break-word;
}

.collection-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.collection-card-stats {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

.collection-stat {
    display: flex;
    flex-direction: column;
}

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

.collection-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.collection-card-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.collection-card-actions .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
}

/* Data Table - ShadCN Inspired */
.table-wrapper {
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.data-table thead {
    background-color: var(--bg-muted);
}

.data-table th {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-default);
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-default);
}

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

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Utility classes */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.flex {
    display: flex;
}

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

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.w-4 {
    width: 1rem;
}

.h-4 {
    height: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

.font-medium {
    font-weight: 500;
}

/* Icon Button */
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-button:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.icon-button svg {
    width: 1rem;
    height: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .data-table th,
    .data-table td {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .icon-button {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Collection Info Box */
.collection-info-box {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: var(--space-lg);
    margin-top: var(--space-md);
}

.collection-info-box .status-message {
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-muted);
    opacity: 0.5;
}

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

.empty-state-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-xl);
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.file-item:hover {
    background-color: var(--bg-hover);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.file-icon {
    width: 32px;
    height: 32px;
    color: var(--text-muted);
}

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

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.file-remove {
    padding: var(--space-sm);
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.file-remove:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.radio-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-light);
}

.radio-item input[type="radio"] {
    margin-top: 2px;
}

.radio-item input[type="radio"]:checked + .radio-content .radio-title {
    color: var(--accent-primary);
    font-weight: 600;
}

.radio-content {
    flex: 1;
}

.radio-title {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.radio-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Process Actions */
.process-actions {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-default);
}

/* Progress Card */
.progress-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow);
}

/* Alerts */
.alert {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background-color: var(--bg-muted);
    border: 1px solid var(--border-default);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #3b82f6;
}

.alert-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.alert-list {
    margin: var(--space-xs) 0 0 0;
    padding-left: var(--space-lg);
}

.alert-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Search Components */
.search-input-wrapper {
    position: relative;
}

.search-input-icon {
    position: absolute;
    left: var(--space-md);
    top: var(--space-md);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.form-textarea.with-icon {
    padding-left: calc(var(--space-md) * 3);
}

.search-examples {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.search-example-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.search-example {
    padding: var(--space-xs) var(--space-sm);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-example:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* Additional styles for legacy features */
.badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--accent-primary);
}

.video-snippet-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    margin-top: 1rem;
}

.snippet-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.snippet-play-overlay:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.seek-button {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    background-color: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.seek-button:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
}

.video-time-display {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: var(--space-md);
}

.temporal-insights {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    padding: var(--space-md);
    margin-top: var(--space-md);
    font-size: 0.875rem;
}

.temporal-item {
    margin-bottom: var(--space-sm);
    line-height: 1.5;
    color: var(--text-secondary);
}

.temporal-item:last-child {
    margin-bottom: 0;
}

.temporal-item strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: var(--space-xs);
}

.behavior-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin: var(--space-md) 0;
}

.behavior-badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.behavior-badge.suspicious-behavior {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.score-badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.suspicious-score {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.relevance-score {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.alert-badge {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    font-weight: 600;
}

.confidence-indicator {
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    font-size: 0.875rem;
}

.high-confidence {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.medium-confidence {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.low-confidence {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.search-suggestion {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: var(--space-md);
    margin-top: var(--space-md);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--accent-warning);
}

.search-explanation {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    padding: var(--space-md);
    margin-top: var(--space-sm);
    border-radius: 8px;
    font-size: 0.875rem;
}

.result-video-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.result-scores {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.75rem;
}

.result-timestamp {
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    font-size: 0.75rem;
}

.result-description {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.video-snippet {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.processing-details {
    margin-top: var(--space-md);
}

.video-error {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.875rem;
}

/* Security Event Cards - Modern shadcn style */
.security-event-card {
    display: flex;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.security-event-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.security-event-preview {
    position: relative;
    width: 200px;
    height: 112px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-muted);
    cursor: pointer;
}

.security-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.security-event-preview:hover .security-video-thumbnail {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.7));
    pointer-events: none;
}

.video-time-indicator {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    padding: 2px 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.security-event-preview:hover .play-overlay {
    opacity: 1;
}

.security-event-info {
    flex: 1;
    min-width: 0;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

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

.confidence-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.confidence-badge.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
}

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

.confidence-badge.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.event-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: var(--space-sm) 0;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin: var(--space-md) 0;
}

.behavior-tag {
    padding: 4px 10px;
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.event-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.event-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Export function placeholder */
.btn-ghost:hover {
    background: var(--bg-hover);
}

/* Search Result Cards - Clean shadcn style */
.search-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.search-result-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.search-result-content {
    display: flex;
    gap: var(--space-lg);
}

.search-video-preview {
    position: relative;
    width: 240px;
    height: 135px;
    background: var(--bg-muted);
    overflow: hidden;
    cursor: pointer;
}

.search-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.search-video-preview:hover .search-video-thumbnail {
    transform: scale(1.05);
}

.match-score-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.match-score-badge.badge-success {
    background: rgba(22, 163, 74, 0.9);
}

.match-score-badge.badge-warning {
    background: rgba(245, 158, 11, 0.9);
}

.match-score-badge.badge-info {
    background: rgba(59, 130, 246, 0.9);
}

.no-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.search-result-info {
    flex: 1;
    padding: var(--space-lg);
    min-width: 0;
}

.result-video-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
}

.result-time-info {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.frame-count-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.result-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

/* Answer Card - Clean AI response display */
.answer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.answer-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.answer-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.answer-content {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* Search Summary Stats */
.search-summary-stats {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-md);
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.summary-stat svg {
    color: var(--text-muted);
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    min-width: 300px;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md) var(--space-lg);
    z-index: 1100;
    animation: slideInRight 0.3s ease-out;
}

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

.notification-toast.fade-out {
    animation: slideOutRight 0.3s ease-out;
}

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

.notification-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.notification-success {
    border-color: var(--accent-success);
}

.notification-success svg {
    color: var(--accent-success);
    flex-shrink: 0;
}

.notification-error {
    border-color: var(--accent-danger);
}

.notification-error svg {
    color: var(--accent-danger);
    flex-shrink: 0;
}

.notification-info {
    border-color: #3b82f6;
}

.notification-info svg {
    color: #3b82f6;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .security-event-card,
    .search-result-content {
        flex-direction: column;
    }
    
    .security-event-preview,
    .search-video-preview {
        width: 100%;
        height: 180px;
    }
    
    .search-summary-stats {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .notification-toast {
        top: var(--space-md);
        right: var(--space-md);
        left: var(--space-md);
        min-width: auto;
    }
}