/**
 * InnovTranslate API - Admin Dashboard Styles
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;

  /* Border colors */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  /* Text colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Brand colors */
  --accent-blue: #3b82f6;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  /* Table row hover */
  --table-hover: rgba(0, 0, 0, 0.02);

  /* Status badge backgrounds */
  --status-pending-bg: rgba(234, 179, 8, 0.1);
  --status-active-bg: rgba(59, 130, 246, 0.1);
  --status-completed-bg: rgba(34, 197, 94, 0.1);
  --status-failed-bg: rgba(239, 68, 68, 0.1);
  --status-cancelled-bg: rgba(107, 114, 128, 0.1);
}

/* ============================================
   Base Styles
   ============================================ */
/* Body styles now handled by Tailwind classes (bg-dark-bg, text-gray-100) */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ============================================
   Card Styles
   ============================================ */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

/* ============================================
   Navigation Styles
   ============================================ */
.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease, background-color 0.2s ease;
}

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

.nav-link.active {
  background-color: var(--accent-blue);
  color: white;
}

/* ============================================
   Status Colors
   ============================================ */
.status-pending { color: var(--accent-yellow); }
.status-active { color: var(--accent-blue); }
.status-completed { color: var(--accent-green); }
.status-failed { color: var(--accent-red); }
.status-cancelled { color: var(--text-muted); }

/* Status Backgrounds */
.bg-status-pending { background-color: var(--status-pending-bg); }
.bg-status-active { background-color: var(--status-active-bg); }
.bg-status-completed { background-color: var(--status-completed-bg); }
.bg-status-failed { background-color: var(--status-failed-bg); }
.bg-status-cancelled { background-color: var(--status-cancelled-bg); }

/* ============================================
   Pulse Animation
   ============================================ */
@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.pulse-active {
  animation: pulse-blue 2s infinite;
}

/* ============================================
   Table Styles
   ============================================ */
.table-row-hover:hover {
  background-color: var(--table-hover);
}

/* ============================================
   Form Elements
   ============================================ */
input[type="checkbox"] {
  accent-color: var(--accent-blue);
}

/* Form element styles now handled by Tailwind classes (bg-dark-bg, text-white, etc.) */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* ============================================
   Toast Animations
   ============================================ */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

.toast-enter {
  animation: slideIn 0.3s ease-out;
}

.toast-exit {
  animation: slideOut 0.3s ease-in;
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
  position: relative;
  height: 200px;
}

/* ============================================
   Utility Classes
   ============================================ */
.bg-theme-primary { background-color: var(--bg-primary); }
.bg-theme-secondary { background-color: var(--bg-secondary); }
.bg-theme-card { background-color: var(--bg-card); }
.bg-theme-hover { background-color: var(--bg-hover); }

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

.border-theme { border-color: var(--border-color); }

/* ============================================
   Provider Status Indicators
   ============================================ */
.provider-healthy {
  background-color: var(--accent-green);
}

.provider-degraded {
  background-color: var(--accent-yellow);
}

.provider-unhealthy {
  background-color: var(--accent-red);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.6s linear infinite;
}

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

/* ============================================
   Badge Styles
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-blue { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-green { background-color: rgba(34, 197, 94, 0.1); color: #22c55e; }
.badge-yellow { background-color: rgba(234, 179, 8, 0.1); color: #eab308; }
.badge-red { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-gray { background-color: rgba(107, 114, 128, 0.1); color: #6b7280; }
.badge-purple { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

/* ============================================
   Button Hover Effects
   ============================================ */
button {
  transition: all 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

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

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
  .nav-link {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .chart-container {
    height: 150px;
  }
}
