/**
 * Application Theme System
 * 
 * This file contains additional styles that extend the base theme.
 * The base theme (app.light.css) is loaded directly in HTML for performance.
 */

/* Main Tabs */
.main-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  background: var(--background-white, #fff);
  padding: 0 24px;
  gap: 4px;
}

.main-tab {
  background: none;
  border: none;
  padding: 14px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light, #94a3b8);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
  margin-bottom: -1px;
}

.main-tab:hover {
  color: var(--text-secondary, #475569);
  background: var(--background-subtle, #f8fafc);
}

.main-tab.active {
  color: var(--primary-color, #0f766e);
  border-bottom-color: var(--primary-color, #0f766e);
  background: transparent;
}

/* Tab Content */
.main-tab-content {
  flex: 1;
  overflow: hidden;
}

.main-tab-pane {
  display: none;
  min-height: 600px;
  padding-top: 20px;
}

.main-tab-pane.active {
  display: block;
}

/* Analytics Placeholder */
.analytics-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
  color: #64748b;
}

.analytics-placeholder h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #334155;
}

.analytics-placeholder p {
  font-size: 16px;
  color: #64748b;
}

/* Archived Cases Button */
.view-archived-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-archived-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

/* Archived Cases Modal */
.archived-cases-modal {
  max-width: 2200px;
  width: 99%;
  max-height: 92vh;
}

.archived-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.archived-search {
  flex: 0 0 320px;
  order: -1;
  margin-right: 20px;
}

.archived-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
}

.archived-filter-controls {
  display: flex;
  gap: 12px;
}

.archived-filter-controls select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 140px;
}

.archived-summary {
  margin-bottom: 16px;
  font-size: 14px;
  color: #64748b;
}

.archived-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 20px;
}

.archived-cases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.archived-cases-table th {
  background: #f8fafc;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}

.archived-cases-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.archived-cases-table tbody tr:hover {
  background: #f8fafc;
}

.loading-row {
  text-align: center;
  color: #64748b;
  font-style: italic;
}

.archived-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.archived-pagination button {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.archived-pagination button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.archived-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#archivedPageInfo {
  font-size: 14px;
  color: #64748b;
}

.btn-restore {
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-restore:hover {
  background: #059669;
}

/* Compact Analytics Styles */
.analytics-section .analytics-charts {
  display: flex !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
}

.analytics-section .analytics-charts .chart-card {
  flex: 1 !important;
  min-width: 180px !important;
  max-width: none !important;
  width: auto !important;
}

.chart-card.compact {
  padding: 14px;
  margin-bottom: 16px;
}

.chart-container.compact {
  height: 110px;
  margin-bottom: 6px;
}

.prediction-breakdown.compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workload-breakdown.compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.chart-legend.compact {
  margin-top: 8px;
  font-size: 0.7rem;
}

.workload-metric {
  text-align: center;
  margin-bottom: 8px;
}

.workload-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 3px;
}

.workload-label {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.1;
}

.prediction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 4px solid #e2e8f0;
}

.prediction-item.warning {
  border-left-color: #f59e0b;
}

.prediction-item.danger {
  border-left-color: #ef4444;
}

.prediction-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
}

.prediction-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}

.workload-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}

.workload-item:last-child {
  border-bottom: none;
}

.workload-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #1f2937;
}

.workload-stat {
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.info-icon {
  font-size: 0.65rem;
  color: #9ca3af;
  cursor: help;
}

/* Analytics Dropdowns */
.analytics-section select {
  padding: 4px 24px 4px 8px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  font-size: 0.75rem !important;
  background: white !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 6px center !important;
  background-repeat: no-repeat !important;
  background-size: 16px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.analytics-section select:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 1px #3b82f6 !important;
}

/* Real-time update visual feedback */
.kanban-card.card-updated {
  animation: cardUpdated 2s ease-out;
}

.kanban-card.card-moved {
  animation: cardMoved 2s ease-out;
}

.kanban-card.card-removing {
  animation: cardRemoving 0.3s ease-out forwards;
}

@keyframes cardUpdated {
  0% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.1);
  }
  100% {
    box-shadow: none;
    background-color: transparent;
  }
}

@keyframes cardMoved {
  0% {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
    background-color: rgba(16, 185, 129, 0.1);
  }
  100% {
    box-shadow: none;
    background-color: transparent;
  }
}

@keyframes cardRemoving {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}
