/* Modern, Vibrant & High-Contrast Styles for SarkariAI Hub */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;600;700;800&family=Noto+Sans+Tamil:wght@400;600;700&family=Noto+Sans+Telugu:wght@400;600;700&family=Noto+Sans+Bengali:wght@400;600;700&family=Noto+Sans+Gurmukhi:wght@400;600;700&family=Noto+Sans+Gujarati:wght@400;600;700&family=Noto+Sans+Kannada:wght@400;600;700&family=Noto+Sans+Malayalam:wght@400;600;700&family=Noto+Sans+Oriya:wght@400;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&family=Noto+Sans+Meetei+Mayek:wght@400;600;700&family=Noto+Sans+Ol+Chiki:wght@400;600;700&display=swap');

:root {
  --saffron-400: #fb923c;
  --saffron-500: #f97316;
  --saffron-600: #ea580c;
  --navy-900: #0f172a;
  --navy-800: #1e3a8a;
  --navy-700: #1d4ed8;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --purple-600: #7c3aed;
  --rose-600: #e11d48;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-top-pad {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  scroll-behavior: smooth;
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', 'Noto Sans Tamil', 'Noto Sans Telugu', 'Noto Sans Bengali', 'Noto Sans Gurmukhi', 'Noto Sans Gujarati', 'Noto Sans Kannada', 'Noto Sans Malayalam', 'Noto Sans Oriya', 'Noto Naskh Arabic', 'Noto Sans Meetei Mayek', 'Noto Sans Ol Chiki', system-ui, -apple-system, sans-serif;
  background-color: #f1f5f9;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(30, 58, 138, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  min-height: 100vh;
}

/* Touch & tap optimization for mobile responsiveness */
button, select, input, a {
  touch-action: manipulation;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Breaking News Ticker Animation */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker 40s linear infinite;
}

.ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Vibrant Section Color Themes */
.theme-resizer {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fed7aa 100%);
  border: 2px solid #fdba74;
}

.theme-ai {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #ddd6fe 100%);
  border: 2px solid #c4b5fd;
}

.theme-age {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
  border: 2px solid #6ee7b7;
}

.theme-directory {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
  border: 2px solid #93c5fd;
}

.theme-notes {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 50%, #fef08a 100%);
  border: 2px solid #fde047;
}

/* Glass & Card Glows */
.glass-nav {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid #1e3a8a;
}

.glow-saffron {
  box-shadow: 0 10px 30px -5px rgba(249, 115, 22, 0.3);
}

.glow-blue {
  box-shadow: 0 10px 30px -5px rgba(30, 58, 138, 0.3);
}

.glow-purple {
  box-shadow: 0 10px 30px -5px rgba(124, 58, 237, 0.25);
}

.glow-emerald {
  box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.25);
}

/* Rich Vibrant Buttons */
.btn-saffron {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}
.btn-saffron:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
  transform: translateY(-1px);
}

.btn-navy {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e1b4b 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.4);
}
.btn-navy:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 0.5);
  transform: translateY(-1px);
}

.btn-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
}
.btn-purple:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
  transform: translateY(-1px);
}

/* Category Cards with Distinct Colorful Border Accents */
.card-board {
  border-top: 5px solid #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.card-central {
  border-top: 5px solid #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.card-police {
  border-top: 5px solid #dc2626;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.card-entrance {
  border-top: 5px solid #059669;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
}

.card-teaching {
  border-top: 5px solid #7c3aed;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
}

/* Touch targets */
button, a, input, select {
  min-height: 42px;
}

/* Custom AdSense placeholder */
.adsense-slot {
  background: linear-gradient(135deg, #e2e8f0 25%, #cbd5e1 25%, #cbd5e1 50%, #e2e8f0 50%, #e2e8f0 75%, #cbd5e1 75%, #cbd5e1 100%);
  background-size: 28px 28px;
  border: 2px dashed #94a3b8;
  position: relative;
  overflow: hidden;
}

.adsense-slot::before {
  content: '📢 Google AdSense / Sponsor Slot • High CTR Placement';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 12px;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Native Dialog backdrop */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
}

dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
}

/* Chatbot Floating Widget */
.chatbot-bubble {
  animation: pulse-ring 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(249, 115, 22, 0);
  }
}

/* Exam & Modal Safety: Prevent floating chatbot from covering CBT controls, options, or palette */
body.in-quiz #floatingChatbotWidget,
body:has(#quizActiveArena:not(.hidden)) #floatingChatbotWidget,
body:has(#notesReaderModal) #floatingChatbotWidget,
body:has(#upiPaymentDialog[open]) #floatingChatbotWidget,
body:has(#omrGeneratorModal:not(.hidden)) #floatingChatbotWidget {
  display: none !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  #floatingChatbotWidget {
    bottom: 5.5rem;
    right: 1rem;
    z-index: 40;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: #e2e8f0;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
  border: 2px solid #e2e8f0;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* =========================================================
   NIGHT STUDY / DARK MODE STYLES
   ========================================================= */
html.dark, body.dark {
  background-color: #0b0f19;
  color: #f1f5f9;
  background-image: 
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
}

html.dark .bg-white {
  background-color: #161f30 !important;
  color: #f1f5f9;
}

html.dark .bg-slate-50 {
  background-color: #0f172a !important;
}

html.dark .bg-slate-100 {
  background-color: #1e293b !important;
}

html.dark .bg-slate-200 {
  background-color: #334155 !important;
}

html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-300 {
  border-color: #334155 !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark .card-board,
html.dark .card-central,
html.dark .card-police,
html.dark .card-entrance,
html.dark .card-teaching {
  background: #161f30 !important;
  border-color: #334155 !important;
}

html.dark .theme-resizer {
  background: linear-gradient(135deg, #1f1d18 0%, #291e13 100%) !important;
  border-color: #78350f !important;
}

html.dark .theme-ai {
  background: linear-gradient(135deg, #1b162c 0%, #1e1b4b 100%) !important;
  border-color: #4c1d95 !important;
}

html.dark .theme-age {
  background: linear-gradient(135deg, #0f231c 0%, #064e3b 100%) !important;
  border-color: #047857 !important;
}

html.dark .theme-directory {
  background: linear-gradient(135deg, #0e1e38 0%, #172554 100%) !important;
  border-color: #1e40af !important;
}

html.dark .theme-notes {
  background: linear-gradient(135deg, #24210e 0%, #292510 100%) !important;
  border-color: #713f12 !important;
}

html.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #475569;
  border-color: #0f172a;
}

/* Speaking pulse animation for Voice Question Reader */
.speech-pulse {
  animation: speechPulse 1.2s ease-in-out infinite alternate;
  background-color: #dc2626 !important;
  color: #ffffff !important;
}

@keyframes speechPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  100% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}


/* Mobile Touch & Instant Tap Optimization */
.home-exam-card-item,
.directory-card,
.star-btn,
.exam-filter-pill,
button,
a[href^="#"] {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.home-exam-card-item {
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.home-exam-card-item:active {
  transform: scale(0.98);
  opacity: 0.92;
}

button:active, .btn-saffron:active, a.cursor-pointer:active {
  transform: scale(0.96);
}

@media print {
  header, footer, nav, .chatbot-container, .chatbot-bubble, #pwaInstallBanner,
  #dpdpConsentBanner, #networkStatusBanner, .adsense-slot, .no-print,
  button:not(.allow-print), #dailyPollContainer {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  .tab-section {
    display: block !important;
  }
  .print-clean {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ========================================================
   RTL Layout Support (Urdu, Sindhi, Kashmiri UI)
   ======================================================== */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .space-x-1 > :not([hidden]) ~ :not([hidden]),
[dir="rtl"] .space-x-1\.5 > :not([hidden]) ~ :not([hidden]),
[dir="rtl"] .space-x-2 > :not([hidden]) ~ :not([hidden]),
[dir="rtl"] .space-x-3 > :not([hidden]) ~ :not([hidden]),
[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

/* CRITICAL EXAM ISOLATION: Official exam content remains strictly LTR */
[dir="rtl"] #quizQuestionContainer,
[dir="rtl"] .exam-paper-container,
[dir="rtl"] .question-stem,
[dir="rtl"] .question-options-list,
[dir="rtl"] #quizExplanationArea,
[dir="rtl"] pre,
[dir="rtl"] code,
[dir="rtl"] .math-tex,
[dir="rtl"] .cbt-palette-grid {
  direction: ltr !important;
  text-align: left !important;
}

/* Language Selector Select Custom Styling */
.lang-selector-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent;
}

/* Horizontal Smooth Scroll Bar Hidden */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


