* {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

/* Status badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

.status-uploading { background-color: #fef3c7; color: #92400e; }
.status-uploaded { background-color: #dbeafe; color: #1e40af; }
.status-extracting { background-color: #fce7f3; color: #9d174d; }
.status-extracted { background-color: #dcfce7; color: #166534; }
.status-failed { background-color: #fee2e2; color: #991b1b; }

.frame-status-extracted { background-color: #dbeafe; color: #1e40af; }
.frame-status-selected { background-color: #fef3c7; color: #92400e; }
.frame-status-training { background-color: #fce7f3; color: #9d174d; }
.frame-status-trained { background-color: #dcfce7; color: #166534; }
.frame-status-deleted { background-color: #f3f4f6; color: #6b7280; }

.job-status-pending { background-color: #f3f4f6; color: #6b7280; }
.job-status-processing { background-color: #fef3c7; color: #92400e; }
.job-status-completed { background-color: #dcfce7; color: #166534; }
.job-status-failed { background-color: #fee2e2; color: #991b1b; }
.job-status-paused { background-color: #fce7f3; color: #9d174d; }
.job-status-rolled_back { 
    background-color: #f3f4f6; 
    color: #6b7280; 
    border: 1px solid #d1d5db;
}

/* App container */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 16rem;
    background-color: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 40;
}

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

/* Main content */
.main-content {
    flex: 1;
    margin-left: 16rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-bar {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background-color: #f9fafb;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar */
.progress-bar {
    height: 6px;
    border-radius: 3px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

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

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 48rem;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
}

/* Form inputs */
input, select, textarea {
    transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.input-error {
    border-color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Table */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

td, th {
    border-bottom: 1px solid #e5e7eb;
}

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

/* Card */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Frame thumbnail */
.frame-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s;
    cursor: pointer;
}

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

.frame-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.frame-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.frame-card.selected {
    border: 2px solid #3b82f6;
}

.frame-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

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

.toast.success { background-color: #dcfce7; color: #166534; }
.toast.error { background-color: #fee2e2; color: #991b1b; }
.toast.warning { background-color: #fef3c7; color: #92400e; }
.toast.info { background-color: #dbeafe; color: #1e40af; }

/* Nav link */
.nav-link.active {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Button disabled */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

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

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Form label */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Scrollbar styling */
.content-area::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.content-area::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Pulse animation for real-time indicator */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Mobile */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (min-width: 1025px) {
    .mobile-menu-btn {
        display: none;
    }
}

