/* ================================================
   Professional Government Dashboard - Premium Design System
   Baghdad Municipality - Citizen Complaints Platform
   Version 2.0 - Enterprise Grade UI
   ================================================ */

/* ================================================
   CSS Custom Properties - Design Tokens
   ================================================ */

:root {
  /* Primary Government Colors */
  --gov-gold: #d4af37;
  --gov-gold-light: #e8c95c;
  --gov-gold-dark: #b8962e;
  --gov-gold-glow: rgba(212, 175, 55, 0.4);

  /* Navy & Dark Backgrounds */
  --bg-primary: #0a0f1c;
  --bg-secondary: #0f1629;
  --bg-card: rgba(17, 25, 45, 0.85);
  --bg-card-hover: rgba(25, 35, 60, 0.9);
  --bg-glass: rgba(15, 22, 41, 0.75);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(212, 175, 55, 0.3);
  --border-gold-strong: rgba(212, 175, 55, 0.6);

  /* Status Colors */
  --status-green: #10b981;
  --status-green-glow: rgba(16, 185, 129, 0.3);
  --status-red: #ef4444;
  --status-red-glow: rgba(239, 68, 68, 0.3);
  --status-blue: #3b82f6;
  --status-blue-glow: rgba(59, 130, 246, 0.3);
  --status-yellow: #f59e0b;
  --status-yellow-glow: rgba(245, 158, 11, 0.3);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ================================================
   Base Styles
   ================================================ */

* {
  box-sizing: border-box;
}

body {
  font-family: "Cairo", sans-serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(
      ellipse at top,
      rgba(212, 175, 55, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at bottom right,
      rgba(59, 130, 246, 0.02) 0%,
      transparent 40%
    );
  cursor: none;
  min-height: 100vh;
}

/* Selection styling */
::selection {
  background: var(--gov-gold);
  color: var(--bg-primary);
}

/* ================================================
   Mobile Blocking Overlay
   ================================================ */

#mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #0a0f1c 0%, #111827 50%, #0a0f1c 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

#mobile-overlay::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--gov-gold-glow) 0%, transparent 70%);
  opacity: 0.5;
}

#mobile-overlay .icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  filter: drop-shadow(0 0 20px var(--gov-gold-glow));
}

#mobile-overlay .message {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.8;
  max-width: 320px;
}

#mobile-overlay .sub-message {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 767px) {
  #mobile-overlay {
    display: flex !important;
  }
  body > *:not(#mobile-overlay) {
    display: none !important;
  }
}

/* ================================================
   Page Transitions
   ================================================ */

.page-container {
  opacity: 1;
  transition: opacity var(--transition-slow);
}

.page-container.fade-out {
  opacity: 0;
}

.page-container.fade-in {
  opacity: 1;
}

/* ================================================
   Premium Header Styles
   ================================================ */

.gov-header {
  position: relative;
  margin: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(17, 24, 39, 0.95) 0%,
    rgba(15, 23, 42, 0.98) 50%,
    rgba(10, 15, 28, 0.95) 100%
  );
  border: 1px solid var(--border-gold);
  box-shadow:
    var(--shadow-lg),
    var(--shadow-gold),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.gov-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gov-gold-dark) 20%,
    var(--gov-gold) 50%,
    var(--gov-gold-dark) 80%,
    transparent 100%
  );
}

.gov-header::after {
  content: "";
  position: absolute;
  top: 0;
  right: 10%;
  width: 200px;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    var(--gov-gold-glow) 0%,
    transparent 70%
  );
  opacity: 0.3;
  pointer-events: none;
}

/* Logo Container */
.logo-container {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  padding: 4px;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    0 0 30px var(--gov-gold-glow),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
  animation: logoGlow 4s ease-in-out infinite;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes logoGlow {
  0%,
  100% {
    box-shadow:
      0 4px 15px rgba(0, 0, 0, 0.3),
      0 0 20px var(--gov-gold-glow);
  }
  50% {
    box-shadow:
      0 4px 15px rgba(0, 0, 0, 0.3),
      0 0 40px var(--gov-gold-glow);
  }
}

/* Organization Title */
.org-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.org-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gov-gold);
  letter-spacing: 0.5px;
}

.org-department {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Platform Title */
.platform-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.platform-period {
  font-size: 0.85rem;
  color: var(--gov-gold);
  font-weight: 600;
}

/* Time Display */
.time-container {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(
    145deg,
    rgba(17, 24, 39, 0.9),
    rgba(15, 23, 42, 0.95)
  );
  border: 1px solid var(--border-gold);
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.time-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.date-value {
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* ================================================
   Glassmorphic Card System
   ================================================ */

.glass-card {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
}

.glass-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

/* ================================================
   Premium KPI Cards
   ================================================ */

.kpi-section-compact {
  max-height: clamp(95px, 15vh, 140px);
  min-height: 85px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  justify-content: center;
}

.kpi-card {
  position: relative;
  background: linear-gradient(
    145deg,
    rgba(17, 25, 45, 0.9) 0%,
    rgba(15, 22, 41, 0.95) 100%
  );
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem !important;
  min-height: clamp(75px, 12vh, 110px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transition: all var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* KPI Color Variants */
.kpi-card--yellow::before {
  background: linear-gradient(90deg, var(--status-yellow) 0%, transparent 100%);
}
.kpi-card--yellow .kpi-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-yellow);
  box-shadow: 0 0 20px var(--status-yellow-glow);
}
.kpi-card--yellow .kpi-value {
  color: var(--status-yellow);
  text-shadow: 0 0 20px var(--status-yellow-glow);
}

.kpi-card--green::before {
  background: linear-gradient(90deg, var(--status-green) 0%, transparent 100%);
}
.kpi-card--green .kpi-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-green);
  box-shadow: 0 0 20px var(--status-green-glow);
}
.kpi-card--green .kpi-value {
  color: var(--status-green);
  text-shadow: 0 0 20px var(--status-green-glow);
}

.kpi-card--red::before {
  background: linear-gradient(90deg, var(--status-red) 0%, transparent 100%);
}
.kpi-card--red .kpi-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-red);
  box-shadow: 0 0 20px var(--status-red-glow);
}
.kpi-card--red .kpi-value {
  color: var(--status-red);
  text-shadow: 0 0 20px var(--status-red-glow);
}

.kpi-card--blue::before {
  background: linear-gradient(90deg, var(--status-blue) 0%, transparent 100%);
}
.kpi-card--blue .kpi-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-blue);
  box-shadow: 0 0 20px var(--status-blue-glow);
}
.kpi-card--blue .kpi-value {
  color: var(--text-primary);
}
.kpi-card--blue .kpi-percent {
  color: var(--status-blue);
  text-shadow: 0 0 10px var(--status-blue-glow);
}

/* KPI Icon */
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

/* KPI Text */
.kpi-title {
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.1rem;
}

.kpi-value {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: all var(--transition-normal);
}

.kpi-percent {
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 700;
}

/* Progress Bar */
.progress-bar-thin {
  height: 6px;
  margin-top: 0.3rem;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-thin > div {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--status-blue), #60a5fa);
  box-shadow: 0 0 10px var(--status-blue-glow);
  transition: width 1s ease-out;
}

/* ================================================
   Premium Table Styles
   ================================================ */

.table-section-expanded {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 230px);
}

.table-container {
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.table-header {
  padding: 0.75rem 1rem;
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.08) 0%,
    transparent 50%,
    rgba(212, 175, 55, 0.08) 100%
  );
  border-bottom: 1px solid var(--border-gold);
}

.table-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-page-indicator {
  font-size: 0.75rem;
  color: var(--gov-gold);
  font-weight: 600;
  background: rgba(212, 175, 55, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}

/* Table Head */
.table-zebra thead {
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.table-zebra thead th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-medium);
  background: #1e293b;
}

/* Table Body */
.table-zebra tbody tr {
  transition: all var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.table-zebra tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.3);
}

.table-zebra tbody tr:nth-child(odd) {
  background: transparent;
}

.table-zebra tbody tr:hover {
  background: rgba(212, 175, 55, 0.05) !important;
}

.table-row-fixed {
  height: 44px;
  line-height: 44px;
}

.table-row-fixed td {
  padding: 0 0.75rem !important;
  vertical-align: middle;
  font-size: 0.85rem;
}

/* Rank Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-badge--gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.rank-badge--silver {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #1f2937;
  box-shadow: 0 2px 8px rgba(148, 163, 184, 0.4);
}

.rank-badge--bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.rank-badge--default {
  background: rgba(71, 85, 105, 0.4);
  color: var(--text-secondary);
}

/* Rate Badge */
.rate-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.rate-badge--excellent {
  background: rgba(16, 185, 129, 0.2);
  color: var(--status-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rate-badge--good {
  background: rgba(59, 130, 246, 0.2);
  color: var(--status-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.rate-badge--warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--status-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.rate-badge--danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--status-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Entity name column */
.table-zebra tbody td:nth-child(2) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 500;
}

/* ================================================
   Performance Panel (Sidebar)
   ================================================ */

.performance-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Tabs */
.performance-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-medium);
}

.performance-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  cursor: default;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-normal);
}

.performance-tab.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.performance-tab--excellent.active {
  border-bottom-color: var(--gov-gold);
  color: var(--gov-gold-light);
}

.performance-tab--improvement.active {
  border-bottom-color: var(--status-red);
  color: #fca5a5;
}

/* Status Indicator Dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
}

.status-dot--gold {
  background: var(--gov-gold);
  box-shadow: 0 0 8px var(--gov-gold-glow);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot--red {
  background: var(--status-red);
  box-shadow: 0 0 8px var(--status-red-glow);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Tab Content */
.performance-tab-content {
  display: none;
  padding: 0.75rem;
  overflow: hidden;
}

.performance-tab-content.active {
  display: block;
}

/* Performance Items */
.performance-item {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.performance-item--excellent {
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.1) 0%,
    transparent 100%
  );
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.performance-item--excellent:hover {
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0.15) 0%,
    transparent 100%
  );
  border-color: rgba(212, 175, 55, 0.4);
}

.performance-item--improvement {
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0.1) 0%,
    transparent 100%
  );
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.performance-item--improvement:hover {
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0.15) 0%,
    transparent 100%
  );
  border-color: rgba(239, 68, 68, 0.4);
}

/* ================================================
   Chart Styles (Page B)
   ================================================ */

.chart-card {
  position: relative;
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--gov-gold-dark) 0%,
    var(--gov-gold) 50%,
    var(--gov-gold-dark) 100%
  );
  opacity: 0.5;
}

.chart-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.chart-card .chart-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-card .chart-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* Details Ticker */
.details-ticker {
  font-size: 0.65rem;
  color: var(--text-secondary);
  background: rgba(30, 41, 59, 0.6);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 18px;
  line-height: 1.3;
  flex-shrink: 0;
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border-subtle);
}

/* Last Update Badge */
.last-update-badge {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ================================================
   Error & Offline Banners
   ================================================ */

.error-banner {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.95),
    rgba(220, 38, 38, 0.95)
  );
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.error-banner.visible {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.offline-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.95),
    rgba(217, 119, 6, 0.95)
  );
  color: #1f2937;
  padding: 10px 28px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  z-index: 9999;
  box-shadow: 0 4px 25px rgba(245, 158, 11, 0.4);
  transition: transform 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.offline-banner.visible {
  transform: translateX(-50%) translateY(0);
}

/* ================================================
   Loading & Skeleton States
   ================================================ */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.3) 25%,
    rgba(51, 65, 85, 0.5) 50%,
    rgba(30, 41, 59, 0.3) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
  width: 60%;
  display: inline-block;
}

.skeleton-value {
  height: 2rem;
  width: 80%;
  display: inline-block;
}

.skeleton-row {
  height: 44px;
  width: 100%;
  margin-bottom: 2px;
}

.skeleton-chart {
  width: 100%;
  height: 100%;
  min-height: 150px;
}

.data-loaded .skeleton {
  display: none;
}

.data-loaded .data-content {
  display: block;
}

.data-content {
  display: none;
}

.data-loaded .data-content {
  display: initial;
}

/* ================================================
   Number Animation
   ================================================ */

@keyframes countUp {
  from {
    opacity: 0.5;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-value[data-animated="true"] {
  animation: countUp 0.5s ease-out;
}

/* ================================================
   Footer
   ================================================ */

.gov-footer {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.05) 50%,
    transparent 100%
  );
  border-top: 1px solid var(--border-subtle);
}

.gov-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================================================
   RTL Text Support
   ================================================ */

[dir="rtl"] .chart-card .chart-wrapper {
  direction: ltr;
}

[dir="rtl"] .chart-card .chart-title,
[dir="rtl"] .details-ticker {
  direction: rtl;
}

/* ================================================
   Responsive: Tablet (768-1023px)
   ================================================ */

@media (min-width: 768px) and (max-width: 1023px) {
  .gov-header {
    padding: 0.5rem 1rem;
  }

  .logo-container {
    width: 55px;
    height: 55px;
  }

  .org-title {
    font-size: 0.95rem;
  }

  .platform-title {
    font-size: 1.2rem;
  }

  .kpi-section-compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .kpi-value {
    font-size: clamp(24px, 4vw, 38px);
  }

  .table-row-fixed {
    height: 38px;
    line-height: 38px;
  }

  .table-section-expanded {
    flex-direction: column !important;
  }

  .table-section-expanded > main {
    width: 100% !important;
    min-height: 58vh;
    max-height: 62vh;
  }

  .table-section-expanded > aside {
    width: 100% !important;
    min-height: 23vh;
    max-height: 28vh;
  }

  .chart-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .chart-card {
    padding: 0.4rem 0.5rem;
  }

  .chart-card .chart-title {
    font-size: 0.7rem;
  }

  .details-ticker {
    font-size: 0.58rem;
    padding: 2px 6px;
  }
}

/* ================================================
   Responsive: HD Screen (1024-1919px)
   ================================================ */

@media (min-width: 1024px) and (max-width: 1919px) {
  .chart-card .chart-title {
    font-size: 0.75rem;
  }

  .details-ticker {
    font-size: 0.62rem;
  }
}

/* ================================================
   Responsive: Large Desktop (1920px+)
   ================================================ */

@media (min-width: 1920px) {
  .logo-container {
    width: 80px;
    height: 80px;
  }

  .org-title {
    font-size: 1.25rem;
  }

  .platform-title {
    font-size: 1.75rem;
  }

  .kpi-card {
    min-height: 115px;
  }

  .kpi-value {
    font-size: 52px;
  }

  .table-row-fixed {
    height: 50px;
    line-height: 50px;
  }

  .chart-card .chart-wrapper {
    min-height: 260px;
  }

  .chart-card .chart-title {
    font-size: 0.9rem;
  }

  .details-ticker {
    font-size: 0.72rem;
    padding: 4px 12px;
  }
}

/* ================================================
   Scrollbar Styling
   ================================================ */

.auto-scroll-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
  overflow-y: scroll;
}

.auto-scroll-container::-webkit-scrollbar {
  display: none;
}

/* Custom Scrollbar for non-auto-scroll elements */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--gov-gold-dark);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gov-gold);
}

/* Performance Tab Content - Scrollable Lists */
#content-excellent,
#content-improve {
  max-height: 280px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Hide scrollbar while still allowing scroll for performance lists */
#content-excellent::-webkit-scrollbar,
#content-improve::-webkit-scrollbar {
  width: 3px;
}

#content-excellent::-webkit-scrollbar-thumb,
#content-improve::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}
