/* Dashboard CSS with TEC theme matching the dashboard */
:root {
    --primary: #8b5cf6;              /* TEC purple primary */
    --primary-hover: #7c3aed;        /* TEC purple hover */
    --primary-color: #8b5cf6;        /* Alias for compatibility */
    --success-color: #059669;        /* Green for success states */
    --warning-color: #d97706;        /* Amber for warnings */
    --error-color: #dc2626;          /* Red for errors */
    --info-color: #0ea5e9;           /* Blue for info */
    --background-color: #f8fafc;     /* Light slate background */
    --card-background: #ffffff;      /* White cards */
    --nav-background: #ffffff;       /* White navigation */
    --text-primary: #1f2937;         /* Dark gray text */
    --text-secondary: #6b7280;       /* Muted gray text */
    --text-light: #374151;           /* Dark text for light backgrounds */
    --border-color: #e5e7eb;         /* Light border */
    --shadow-color: rgba(139, 92, 246, 0.1); /* TEC purple shadow */
}

/* Component-based styles with Flask Blueprint theme */
.dashboard-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: box-shadow 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-light);
}

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

.status-indicator--success {
    color: var(--success-color);
}

.status-indicator--error {
    color: var(--error-color);
}

.status-indicator--warning {
    color: var(--warning-color);
}

.status-indicator--info {
    color: var(--info-color);
}

/* TEC Dashboard compatible navigation */
.dashboard-nav {
    background-color: var(--nav-background);
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: #6b7280;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background-color: var(--primary);
}

.mobile-nav-link {
    display: block;
    color: #6b7280;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-nav-link:hover {
    color: var(--primary);
    background-color: rgba(139, 92, 246, 0.1);
    text-decoration: none;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-success {
    background-color: #d1fae5;
    color: #065f46;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-skipped {
    background-color: #f3f4f6;
    color: #374151;
}

/* Flash messages */
.flash-messages {
    position: relative;
    z-index: 50;
}

/* Loading animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Responsive utilities */
@media (max-width: 768px) {
    .dashboard-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .nav-link {
        padding: 0.75rem;
        margin: 0.25rem 0;
    }
}

/* Custom scrollbars */
.overflow-x-auto::-webkit-scrollbar {
    height: 6px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Recent activity scrollable container */
#recent-activity-container::-webkit-scrollbar {
    width: 6px;
}

#recent-activity-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#recent-activity-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#recent-activity-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Table enhancements */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-fixed {
    table-layout: fixed;
}

.table-fixed td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Prevent horizontal scroll for tables */
.table-container {
    width: 100%;
    overflow: hidden;
}

/* Sortable header styles */
.sortable-header {
    transition: background-color 0.2s ease;
    user-select: none;
}

.sortable-header:hover {
    background-color: #f3f4f6 !important;
}

.sortable-header:active {
    background-color: #e5e7eb !important;
}

.sortable-header.sort-active {
    background-color: #f0f9ff !important;
}

.sort-icon {
    min-width: 12px;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.sort-badge {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Multi-sort info panel styles */
#sort-info {
    animation: slideDown 0.3s ease-out;
}

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

/* Focus styles for accessibility */
.focus\:ring-2:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Print styles */
@media print {
    .nav-link, .mobile-menu-button, .dropdown {
        display: none !important;
    }
    
    .dashboard-card {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
}

/* Modal styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Tab styles */
.tab-button {
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.tab-button:not(.active) {
    color: #6b7280;
    border-bottom-color: transparent;
}

.tab-button:not(.active):hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

/* JSON viewer styles */
.json-viewer {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

/* File list grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Enhanced status badges for modal */
.modal .status-badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.875rem;
}

/* Pagination button styles */
#pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pagination-controls button:not(:disabled):hover {
    background-color: #f3f4f6;
}

/* Search input styles */
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --card-background: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: #334155;
    }
}