/* ============================================================================
   NS DOC — Obsidian Glassmorphism & Bilingual Khmer/English Typography Styles
   ============================================================================ */

:root {
  --bg-primary: #090D16;
  --bg-card: #111827;
  --bg-elevated: #1E293B;
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --accent-indigo: #6366F1;
  --accent-violet: #8B5CF6;
}

* {
  box-sizing: border-box;
}

html, body {
  font-family: 'Plus Jakarta Sans', 'Inter', 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.62;
  letter-spacing: -0.005em;
  background-color: #090D16;
  color: #F8FAFC;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Ensure Khmer script subscript & superscript vowels never clip */
.khmer-text,
[lang="km"] body,
button,
input,
select,
td,
th,
h1, h2, h3, h4, p, span {
  line-height: 1.65;
}

.font-mono-code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Custom sleek scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.65);
}

/* Glassmorphism surfaces */
.glass-nav {
  background: rgba(9, 13, 22, 0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-sidebar {
  background: rgba(13, 19, 33, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.32);
}

/* Active Sidebar Tab Indicator */
.nav-tab-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: #FFFFFF !important;
  border-left: 3px solid #6366F1;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.18);
}

/* Electric Gradient Button */
.btn-electric {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  background-size: 200% 200%;
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: all 0.22s ease;
}

.btn-electric:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.55);
}

.btn-electric:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(40%);
}

/* Pulsing Emerald Dot */
@keyframes pulse-emerald {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

.pulse-dot {
  animation: pulse-emerald 2s infinite;
}

/* File Format Badges */
.badge-excel {
  background: rgba(16, 185, 129, 0.14);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-word {
  background: rgba(14, 165, 233, 0.14);
  color: #38BDF8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.badge-pdf {
  background: rgba(244, 63, 94, 0.14);
  color: #FB7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Slide-over Drawer Animation */
.drawer-backdrop {
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
}

/* Light Mode Support */
html.light-mode,
html.light-mode body {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
}

html.light-mode .glass-nav {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

html.light-mode .glass-sidebar {
  background: rgba(255, 255, 255, 0.95) !important;
  border-right: 1px solid #E2E8F0 !important;
}

html.light-mode .glass-card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

html.light-mode .text-white,
html.light-mode .text-slate-100,
html.light-mode .text-slate-200 {
  color: #0F172A !important;
}

html.light-mode .text-slate-300,
html.light-mode .text-slate-400 {
  color: #475569 !important;
}

html.light-mode .bg-\[\#090D16\],
html.light-mode .bg-\[\#111827\],
html.light-mode .bg-slate-900\/80,
html.light-mode .bg-slate-900\/60,
html.light-mode .bg-slate-900,
html.light-mode .bg-slate-950 {
  background-color: #F8FAFC !important;
}

html.light-mode .bg-slate-800\/70,
html.light-mode .bg-slate-800\/50,
html.light-mode .bg-slate-800 {
  background-color: #E2E8F0 !important;
  color: #0F172A !important;
}

html.light-mode .border-white\/10,
html.light-mode .border-white\/5,
html.light-mode .border-slate-800,
html.light-mode .border-slate-700 {
  border-color: #CBD5E1 !important;
}

html.light-mode .nav-tab-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%) !important;
  color: #4F46E5 !important;
}

html.light-mode .btn-electric,
html.light-mode .btn-electric * {
  color: #FFFFFF !important;
}

/* Print / Save PDF Report Formatting */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .glass-card {
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

