
/* Import Framer Design System */
@import url('modern_saas.css');

/* Queue Card Styles - Framer Inspired */
.queues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.queue-card {
    background: var(--surface-50);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color-light);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.queue-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-200);
}

.queue-card.active {
    border-left: 4px solid var(--primary-500);
    background: linear-gradient(135deg, var(--surface-50) 0%, var(--primary-50) 100%);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color-light);
}

.queue-name {
    font-size: 1.125rem;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.queue-status {
    font-size: 0.75rem;
    font-weight: var(--font-medium);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.queue-status.status-active {
    background: var(--primary-100);
    color: var(--primary-700);
}

.queue-status.status-idle {
    background: var(--gray-100);
    color: var(--gray-600);
}

.queue-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.stat-item {
    text-align: center;
}

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

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.queue-thread-info {
    background: var(--surface-100);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
    border: 1px solid var(--border-color-light);
}

/* Admin Dashboard Main Styles */
body {
    font-family: var(--font-sans);
    background: var(--surface-50);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--surface-50);
    border-bottom: 1px solid var(--border-color-light);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dashboard-title {
    font-size: 2rem;
    font-weight: var(--font-bold);
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 24px 0;
    background: var(--surface-100);
    border-radius: var(--radius-lg);
    padding: 4px;
    border: 1px solid var(--border-color-light);
}

.tab-button {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--surface-50);
}

.tab-button.active {
    background: var(--surface-50);
    color: var(--primary-600);
    font-weight: var(--font-semibold);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface-50);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
    font-size: 1.25rem;
}

/* Charts Container */
.chart-container {
    background: var(--surface-50);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

/* Progress Bars */
.progress-container {
    margin: 16px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.progress-bar {
    height: 8px;
    background: var(--surface-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

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

/* Buttons */
.btn-framer-dashboard {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: var(--font-medium);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-dashboard {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px 0 rgba(139, 92, 246, 0.3);
}

.btn-primary-dashboard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(139, 92, 246, 0.4);
}

.btn-secondary-dashboard {
    background: var(--surface-50);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary-dashboard:hover {
    background: var(--surface-100);
    border-color: var(--primary-300);
}

/* Responsive Design */
@media (max-width: 768px) {
    .queues-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
    }
    
    .tab-button {
        min-width: 120px;
    }
}

.thread-usage-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.thread-usage-label strong {
    color: #fff;
}

.thread-usage-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.thread-usage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s ease;
}

.thread-utilization {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

.queue-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.no-queues {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px 20px;
    grid-column: 1 / -1;
    font-size: 15px;
}

/* Enhanced job details styles */
.job-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.job-detail {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    color: #ffffff; /* Ensure text is white */
}

.job-detail h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #ffffff; /* Ensure heading is white */
    opacity: 0.8;
}

.job-detail p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff; /* Ensure text is white */
}

/* Ensure job counts are visible */
#totalJobs,
#completedJobs,
#failedJobs,
#pendingJobs,
#processingJobs {
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 600;
}

.error-details {
    background: rgba(255, 59, 48, 0.1);
    border-left: 3px solid rgba(255, 59, 48, 0.7);
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.text-preview {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 12px;
    max-height: 120px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: #2a2a3a;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: white;
}

.modal-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Enhanced System Stats Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stats-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stats-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* GPU and Ollama Status Styles */
#gpuStatusContainer,
#ollamaStatusContainer {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid rgba(76, 175, 80, 0.7);
}

#gpuStatusContainer {
    border-left-color: #4c8bf5;
}

#ollamaStatusContainer {
    border-left-color: #9c27b0;
}

.metric-item {
    margin-bottom: 12px;
}

.metric-label {
    font-size: 13px;
    color: #a0a0a0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    transition: color 0.3s ease;
}

/* Status indicators */
.status-healthy {
    color: #4caf50 !important;
}

.status-warning {
    color: #ff9800 !important;
    animation: pulse 2s infinite;
}

.status-critical {
    color: #f44336 !important;
    animation: pulse 1s infinite;
}

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

/* Responsive adjustments */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    #gpuStatusContainer,
    #ollamaStatusContainer {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 15px;
    }
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.section-subtitle {
    margin: 32px 0 16px 0;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.chart {
    height: 300px;
    width: 100%;
    position: relative;
}

.chart-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: italic;
}
