/* ==========================================================================
   Kumbh Mela & Pandharpur Pilgrim Surveillance UI Theme System
   Reference: Kumbh Mela Pilgrim Navigator & Holy City Surveillance System
   Palette: Sacred Saffron, Temple Gold, Obsidian Slate, Parchment & Glass
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&family=Rozha+One&display=swap');

:root {
  /* Spiritual Saffron & Gold Tokens */
  --color-saffron: #d97706;
  --color-saffron-light: #f59e0b;
  --color-saffron-dark: #b45309;
  --color-saffron-subtle: #fffbeb;
  --color-saffron-glow: rgba(217, 119, 6, 0.28);
  --color-gold: #d97706;
  --color-gold-hover: #b45309;
  --color-gold-light: #fef3c7;
  
  /* Semantic Accents */
  --color-temple-red: #b91c1c;
  --color-temple-red-light: #fee2e2;
  --color-ganga-blue: #0284c7;
  --color-ganga-blue-light: #e0f2fe;
  --color-emerald: #059669;
  --color-emerald-light: #d1fae5;
  
  /* Surfaces & Backgrounds */
  --color-base: #fbfaf8;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-warm: #fde68a;
  
  /* Text */
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  
  /* Obsidian Dark (Sidebar & Video Tiles) */
  --color-obsidian: #0b0f19;
  --color-obsidian-surface: #111827;
  --color-obsidian-card: #151d2f;
  --color-obsidian-border: #1e293b;
  --color-sidebar-text: #cbd5e1;

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Cinzel', 'Rozha One', Georgia, serif;
}

/* Base resets & typography */
body {
  margin: 0;
  background-color: var(--color-base);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background grain effect inspired by Kumbh Mela */
.bg-grain {
  background-color: #fbfaf8;
  background-image: radial-gradient(rgba(217, 119, 6, 0.06) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Typography Headings */
h1, h2, h3, .font-serif-title {
  font-family: var(--font-serif);
  color: var(--color-text-main);
  letter-spacing: 0.02em;
}

/* Glassmorphism Containers */
.glass-panel {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
  border-radius: 14px;
}

.glass-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.05), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(217, 119, 6, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px rgba(217, 119, 6, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.06);
}

/* Spiritual Gold Shimmer */
@keyframes saffronShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.kumbh-gold-shimmer {
  background: linear-gradient(90deg, #d97706 0%, #b45309 50%, #d97706 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: saffronShimmer 4s linear infinite;
}

/* Live Pulse Ring */
@keyframes livePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  animation: livePulse 2s infinite;
}

/* Kumbh Badges */
.kumbh-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.kumbh-badge-saffron {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.kumbh-badge-emerald {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.kumbh-badge-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.kumbh-badge-blue {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Modernized Sidebar */
.kumbh-sidebar {
  width: 260px;
  height: 100vh;
  background: var(--color-obsidian);
  color: var(--color-sidebar-text);
  border-right: 1px solid var(--color-obsidian-border);
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: all 0.3s ease;
}

.kumbh-sidebar-brand {
  padding: 20px 18px 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.kumbh-brand-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24);
  padding: 2px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kumbh-brand-logo-inner {
  width: 100%;
  height: 100%;
  background: #fffbeb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kumbh-brand-text h1 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.kumbh-brand-text p {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kumbh-nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 16px 20px 6px 20px;
  margin: 0;
}

.kumbh-sidebar-menu {
  padding: 10px 12px;
  overflow-y: auto;
  flex-grow: 1;
}

.kumbh-sidebar-menu a, .kumbh-nav-item {
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.kumbh-sidebar-menu a:hover {
  background: rgba(217, 119, 6, 0.12);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.25);
  transform: translateX(2px);
}

.kumbh-sidebar-menu a.active, .kumbh-sidebar-menu a:focus {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  border-color: #f59e0b;
}

.kumbh-sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.08);
  background: rgba(11, 15, 25, 0.95);
}

.kumbh-logout-btn {
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 10px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.kumbh-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.kumbh-logout-btn:active {
  transform: translateY(0);
}

/* Main Content Area */
.kumbh-main-content {
  margin-left: 260px;
  flex-grow: 1;
  min-height: 100vh;
  background: var(--color-base);
  padding: 24px 30px;
  transition: all 0.3s ease;
}

/* Top Live Ticker & Announcement Bar */
.kumbh-top-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 10px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Segmented Language Switcher */
.kumbh-lang-switcher {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2px;
  gap: 2px;
}

.kumbh-lang-btn {
  border: none;
  background: transparent;
  padding: 4px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kumbh-lang-btn:hover {
  color: #0f172a;
}

.kumbh-lang-btn.active {
  background: #d97706;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

/* Primary and Saffron Action Buttons */
.btn-primary, .primary-button {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  border: 1px solid #d97706 !important;
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover, .primary-button:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important;
  border-color: #b45309 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}

.btn-outline-primary {
  color: #d97706 !important;
  border-color: #d97706 !important;
  border-radius: 10px;
  font-weight: 600;
}

.btn-outline-primary:hover {
  background: #d97706 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* Odometer & Visitor Counters */
.footfall-dashboard .visitor-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 16px 24px;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 220px;
}

.footfall-dashboard .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.footfall-dashboard .odometer {
  display: flex;
  font-size: 2.2rem;
  font-weight: 800;
  background: #070a13;
  border: 1px solid #1e293b;
  padding: 6px 14px;
  border-radius: 10px;
  letter-spacing: 3px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.footfall-dashboard .digit {
  margin: 0 2px;
  min-width: 1ch;
  text-align: center;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* Tables in Kumbh Mela Style */
.table-design, .table-container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  padding: 20px;
}

.table-design table, table.crowd_status, table.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table thead.table-dark, .crowd_status thead {
  background: #0f172a !important;
  color: #ffffff;
}

.table thead th {
  background: #0f172a !important;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  border-bottom: 2px solid #d97706;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background-color: #fffbeb !important;
}

.table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

/* Crowd status meter bars */
.crowd_status .bar-green { background-color: #059669; }
.crowd_status .bar-yellow { background-color: #eab308; }
.crowd_status .bar-orange { background-color: #f97316; }
.crowd_status .bar-red { background-color: #ef4444; }
.crowd_status .bar-danger { background-color: #b91c1c; }

/* Custom Widths */
.table-design .col-small { width: 80px; }
.table-design .col-medium { width: 160px; }
.table-design .col-wide { width: 320px; }

/* Video Feeds Grid & Boxes */
.video-feeds .feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.video-feeds .camera-box {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-feeds .camera-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.4);
}

.video-feeds .camera-header {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.video-feeds .camera-video, .camera-placeholder {
  width: 100%;
  height: 320px;
  background: #000000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.video-feeds .pagination {
  margin-top: 24px;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.video-feeds .pagination button {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-feeds .pagination button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

.video-feeds .pagination button:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Toast Container & Alerts */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  max-height: 100vh;
  width: 420px;
  max-width: 90vw;
  overflow-y: auto;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toastify-custom {
  background: #ffffff;
  color: #0f172a;
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 5px solid #b91c1c;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
  position: relative;
  transition: all 0.2s ease;
}

.toastify-custom:hover {
  transform: translateX(-2px);
}

.toastify-close {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.toastify-close:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Custom Scrollbar matching Kumbh Mela */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #d97706;
}

/* Responsive tweaks */
@media (max-width: 992px) {
  .kumbh-sidebar {
    width: 72px;
  }
  .kumbh-sidebar .kumbh-brand-text,
  .kumbh-sidebar .kumbh-nav-section-title,
  .kumbh-sidebar .kumbh-sidebar-menu a span:not(.nav-icon) {
    display: none;
  }
  .kumbh-sidebar-footer {
    padding: 10px 8px;
  }
  .kumbh-logout-btn {
    padding: 10px 0;
    justify-content: center;
  }
  .kumbh-logout-btn span:not(:first-child) {
    display: none;
  }
  .kumbh-sidebar-menu a {
    justify-content: center;
    padding: 12px;
  }
  .kumbh-main-content {
    margin-left: 72px;
    padding: 16px;
  }
}
