/* ============================================================================
   RAJPUTANA GURUKUL — "ARAVALLI HORIZON" DESIGN SYSTEM
   Dual-Tone Midnight Navy (#081426) + Warm Ivory (#FDFCF9) + Saffron-Marigold
   Full Day Mode & Midnight Dark Mode + Slim 64px Icon Rail + Devanagari Ready
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* DAY MODE — Aravalli Dawn (Warm Ivory + Midnight Navy + Saffron-Marigold) */
  --bg: #FDFCF9;
  --surface: #FFFFFF;
  --surface-2: #F4EFE6;
  --surface-3: #EAE2D3;
  --surface-glass: rgba(8, 20, 38, 0.96);

  --navy: #081426;
  --navy-2: #102444;
  --navy-3: #18345E;

  --gold: #D99B1C;
  --gold-bright: #F59E0B;
  --gold-deep: #B45309;
  --gold-soft: rgba(217, 155, 28, 0.14);
  --gold-grad: linear-gradient(135deg, #D99B1C 0%, #F59E0B 100%);

  --primary: #D99B1C;
  --primary-hover: #F59E0B;
  --primary-ink: #081426;
  --primary-soft: rgba(217, 155, 28, 0.13);
  --primary-ring: rgba(217, 155, 28, 0.34);

  --green: #15803D;
  --green-soft: rgba(21, 128, 61, 0.12);
  --red: #DC2626;
  --red-soft: rgba(220, 38, 38, 0.12);
  --indigo: #1E40AF;
  --indigo-soft: rgba(30, 64, 175, 0.11);

  --text: #0A192F;
  --text-2: #475569;
  --text-3: #78716C;
  --border: #E5DDD0;
  --border-strong: rgba(217, 155, 28, 0.44);

  --shadow-sm: 0 2px 10px rgba(8, 20, 38, 0.05);
  --shadow-md: 0 12px 30px rgba(8, 20, 38, 0.09);
  --shadow-gold: 0 10px 26px rgba(217, 155, 28, 0.28);

  --rail-w: 64px;
  --topbar-h: 64px;
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  --font-head: 'Outfit', 'Noto Sans Devanagari', system-ui, sans-serif;
}

html.dark-mode,
body.dark-mode {
  /* NIGHT MODE — Aravalli Dusk (Deep Midnight Navy + Elevated Slate + Luminous Gold) */
  --bg: #050D1A;
  --surface: #0C1A30;
  --surface-2: #122645;
  --surface-3: #19325A;
  --surface-glass: rgba(5, 13, 26, 0.96);

  --text: #F8FAFC;
  --text-2: #CBD5E1;
  --text-3: #94A3B8;
  --border: rgba(217, 155, 28, 0.20);
  --border-strong: rgba(245, 158, 11, 0.48);

  --primary: #F59E0B;
  --primary-hover: #FBBF24;
  --primary-soft: rgba(245, 158, 11, 0.16);
  --primary-ring: rgba(245, 158, 11, 0.36);

  --green: #22C55E;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, 0.15);
  --indigo: #60A5FA;
  --indigo-soft: rgba(96, 165, 250, 0.15);

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.56);
  --shadow-gold: 0 10px 30px rgba(245, 158, 11, 0.30);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color 0.22s ease, color 0.22s ease;
}

a { color: inherit; }

/* ============================================================================
   ARAVALLI HORIZON SHELL:
   Slim 64px Desktop Icon-Only Left Rail + Full-Width Midnight Top Command Bar
   ============================================================================ */
.rg-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rg-rail {
  display: none;
}

@media (min-width: 960px) {
  .rg-rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    background: var(--navy);
    border-right: 1px solid rgba(217, 155, 28, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    z-index: 950;
  }
  .rg-main-wrap {
    margin-left: var(--rail-w);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
}

.rg-rail-crest {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(217, 155, 28, 0.35);
  margin-bottom: 14px;
  flex-shrink: 0;
  text-decoration: none;
}
.rg-rail-crest img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.rg-rail-nav {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
}
.rg-rail-nav::-webkit-scrollbar { display: none; }

.rg-rail-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.rg-rail-icon:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(217, 155, 28, 0.25);
}
.rg-rail-icon.active {
  background: var(--gold-grad);
  color: #081426;
  box-shadow: 0 6px 18px rgba(217, 155, 28, 0.42);
  border-color: rgba(255, 255, 255, 0.25);
}
.rg-rail-icon.is-gold { color: #FBBF24; }
.rg-rail-icon.is-gold.active { color: #081426; }

/* Tooltip on hover for icon-only rail */
.rg-rail-icon::after {
  content: attr(data-tip);
  position: fixed;
  left: 74px;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--navy);
  color: #FFFFFF;
  border: 1px solid rgba(217, 155, 28, 0.45);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 1200;
}
.rg-rail-icon:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.rg-rail-footer {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
   MIDNIGHT TOP COMMAND HEADER (Ticker + Brand + Search + EN/HI + Theme + Pass)
   ============================================================================ */
.rg-topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  height: var(--topbar-h);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 155, 28, 0.24);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
}
@media (min-width: 960px) {
  .rg-topbar { padding: 0 26px; }
}

.rg-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rg-burger {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}
@media (min-width: 960px) {
  .rg-burger.mobile-only { display: none; }
}

.rg-top-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  min-width: 0;
}
.rg-top-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #FFFFFF;
  padding: 1.5px;
  object-fit: cover;
  flex-shrink: 0;
}
@media (min-width: 960px) {
  .rg-top-brand img { display: none; } /* Crest already visible in 64px rail */
}
.rg-top-brand .t-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  white-space: nowrap;
}
.rg-top-brand .t-sub {
  display: none;
  font-size: 10.5px;
  font-weight: 600;
  color: #FCD34D;
  line-height: 1.1;
}
@media (min-width: 640px) {
  .rg-top-brand .t-sub { display: block; }
}

.rg-live-ticker {
  display: none;
}
@media (min-width: 1080px) {
  .rg-live-ticker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(217, 155, 28, 0.28);
    color: #E2E8F0;
    font-size: 12px;
    font-weight: 600;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 10px;
    text-decoration: none;
  }
  .rg-live-ticker:hover {
    border-color: var(--gold-bright);
    color: #FFFFFF;
  }
  .rg-ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #F59E0B;
    box-shadow: 0 0 8px #F59E0B;
    flex-shrink: 0;
    animation: rgPulse 1.8s infinite;
  }
}
@keyframes rgPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.rg-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.rg-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #F8FAFC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.16s ease;
}
.rg-icon-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(217, 155, 28, 0.18);
  color: #FDE68A;
}

.rg-lang-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.rg-lang-btn {
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 800;
  padding: 4.5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s;
}
.rg-lang-btn.active {
  background: var(--gold-grad);
  color: #081426;
  box-shadow: 0 2px 10px rgba(217, 155, 28, 0.35);
}

.rg-pass-pill {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #081426;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(217, 155, 28, 0.35);
  transition: transform 0.15s ease;
}
.rg-pass-pill:hover { transform: translateY(-1px); color: #081426; }
@media (min-width: 720px) {
  .rg-pass-pill { display: inline-flex; }
}

.rg-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.rg-avatar-circle {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #081426;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.rg-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 520px) {
  .rg-topbar { padding: 0 10px; gap: 6px; height: 58px; }
  .rg-top-brand .t-name { font-size: 13.5px; max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
  .rg-icon-btn { width: 32px; height: 32px; font-size: 13px; }
  .rg-lang-btn { padding: 4px 6.5px; font-size: 10px; }
  .rg-avatar-btn { padding: 2px; }
  #rgTopUserName { display: none; }
}

/* MAIN PAGE CONTAINER */
.rg-page {
  width: 100%;
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px 12px 96px;
}
@media (min-width: 640px) {
  .rg-page { padding: 20px 20px 96px; }
}
@media (min-width: 960px) {
  .rg-page { padding: 24px 28px 48px; }
}

/* MOBILE BOTTOM NAVIGATION BAR */
.rg-bottom-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 60px;
  background: var(--navy);
  border: 1px solid rgba(217, 155, 28, 0.34);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(5, 13, 26, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 850;
}
@media (min-width: 960px) {
  .rg-bottom-dock { display: none; }
}
.rg-dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 700;
  height: 100%;
  border-radius: 12px;
}
.rg-dock-item i { font-size: 16px; }
.rg-dock-item.active { color: #FBBF24; }

/* SLIDE-IN ACCOUNT / FULL MENU DRAWER */
.rg-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 26, 0.68);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: none;
}
.rg-drawer-overlay.open { display: block; }
.rg-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  color: var(--text);
  z-index: 1201;
  transform: translateX(-105%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  box-shadow: 20px 0 50px rgba(5, 13, 26, 0.35);
}
.rg-drawer.open { transform: translateX(0); }
.rg-drawer-head {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #FFFFFF;
  padding: 20px 18px 18px;
  position: relative;
  border-bottom: 1px solid rgba(217, 155, 28, 0.28);
}
.rg-drawer-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  cursor: pointer;
}
.rg-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rg-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.rg-drawer-item:hover { background: var(--surface-2); }
.rg-drawer-item i { width: 18px; text-align: center; color: var(--gold-deep); }
html.dark-mode .rg-drawer-item i { color: var(--gold-bright); }

/* CARDS, BUTTONS & BADGES */
.rg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.rg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.rg-btn:active { transform: scale(0.98); }
.rg-btn-gold {
  background: var(--gold-grad);
  color: #081426;
  box-shadow: var(--shadow-gold);
}
.rg-btn-gold:hover { filter: brightness(1.04); color: #081426; }
.rg-btn-navy {
  background: var(--navy);
  color: #FFFFFF;
  border: 1px solid rgba(217, 155, 28, 0.35);
}
.rg-btn-navy:hover { background: var(--navy-2); color: #FDE68A; }
.rg-btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.rg-btn-ghost:hover { border-color: var(--primary); }

/* MODALS, SWITCHES, TOAST */
.rg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 26, 0.78);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rg-modal-backdrop.open { display: flex; }
.rg-modal-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative;
}

.rg-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  max-width: calc(100vw - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #FFFFFF;
  border: 1px solid var(--gold-bright);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(5, 13, 26, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 4000;
}
@media (min-width: 960px) {
  .rg-toast { bottom: 26px; }
}
.rg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.rg-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.rg-switch.on { background: var(--gold); }
.rg-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform 0.2s;
}
.rg-switch.on::after { transform: translateX(20px); }

.lang-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.lang-pick-card {
  border: 2px solid var(--border);
  background: var(--surface-2);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
.lang-pick-card:hover,
.lang-pick-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.lang-pick-card .lp-glyph {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-deep);
  margin-bottom: 6px;
}
html.dark-mode .lang-pick-card .lp-glyph { color: var(--gold-bright); }
.lang-pick-card .lp-title { font-weight: 800; font-size: 15px; color: var(--text); }
.lang-pick-card .lp-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

.hidden { display: none !important; }
