/* 
 * css/styles.css
 * កម្មវិធីពិនិត្យ និងវិភាគលើ KPI បុគ្គលិក និងគ្រូបង្រៀន
 * រចនាប័ទ្មពិសេសសម្រិតសម្រាំងសម្រាប់វិទ្យាល័យ និងមជ្ឈមណ្ឌលអប់រំបច្ចេកទេស
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Kantumruy+Pro:ital,wght@0,300..700;1,300..700&family=Moul&display=swap');

/* ==================== THEME VARIABLES (HIGH CONTRAST & READABLE) ==================== */

/* ☀️ LIGHT THEME (Soft Slate, Navy Blue & Pure White Cards) */
[data-theme="light"], :root {
  font-family: 'Kantumruy Pro', 'Inter', system-ui, -apple-system, sans-serif;
  --header-moul: 'Moul', cursive;
  
  /* Primary: Ocean Blue */
  --p: 221 83% 53%; /* #2563eb */
  --pf: 224 76% 48%; /* #1d4ed8 */
  --pc: 0 0% 100%;
  
  /* Secondary: Emerald */
  --s: 158 64% 45%; /* #10b981 */
  --sf: 158 64% 38%;
  --sc: 0 0% 100%;

  /* Backgrounds & Text */
  --b1: 0 0% 100%;       /* Pure White Card */
  --b2: 210 40% 96%;     /* Soft Slate-100 Page BG */
  --b3: 214 32% 91%;     /* Subtle Border */
  --bc: 215 28% 17%;     /* Crisp Dark Slate-900 Text */

  color-scheme: light;
}

/* 🌙 DARK THEME (Midnight Slate, Electric Sky Blue & Crisp White Text - NO PURPLE / NO EYE STRAIN) */
[data-theme="dark"] {
  /* Primary: Electric Sky Blue (High Contrast on Dark) */
  --p: 199 89% 48%; /* #0ea5e9 */
  --pf: 199 89% 42%;
  --pc: 0 0% 100%;

  /* Secondary: Bright Mint Emerald */
  --s: 158 64% 52%; /* #34d399 */
  --sf: 158 64% 45%;
  --sc: 215 28% 17%;

  /* Accent: Cyan */
  --a: 187 92% 55%;
  --af: 187 92% 45%;
  --ac: 215 28% 17%;

  /* Backgrounds & Text */
  --b1: 222 47% 15%;     /* Rich Slate-800 Card #1e293b */
  --b2: 222 47% 10%;     /* Deep Midnight Slate-900 Page BG #0f172a */
  --b3: 217 33% 25%;     /* Crisp Slate-700 Border #334155 */
  --bc: 210 40% 98%;     /* High-Contrast Snow White Text #f8fafc */

  color-scheme: dark;
}

.font-moul {
  font-family: 'Moul', cursive;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--b2));
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--bc) / 0.25);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--bc) / 0.4);
}

/* Card Transitions & Hover Effects */
.card-hover {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Range Slider Styling (High Contrast in both Light & Dark) */
.rating-slider {
  accent-color: #0ea5e9 !important;
}

[data-theme="dark"] .range {
  --range-shdw: #0ea5e9;
  background-color: #334155 !important;
}

[data-theme="dark"] .range::-webkit-slider-thumb {
  background-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5) !important;
}

/* SWOT Card Highlights */
.swot-strengths {
  border-left: 4px solid #10b981;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.08), transparent);
}

.swot-weaknesses {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.08), transparent);
}

.swot-opportunities {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.08), transparent);
}

.swot-recommendations {
  border-left: 4px solid #8b5cf6;
  background: linear-gradient(to right, rgba(139, 92, 246, 0.08), transparent);
}

/* High-Contrast Notification / Feature Boxes for Light & Dark Themes */
.notice-box-emerald {
  background-color: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  color: #14532d !important;
}

.notice-box-emerald .notice-title {
  color: #15803d !important;
  font-weight: 700;
}

.notice-box-emerald .notice-desc {
  color: #166534 !important;
}

[data-theme="dark"] .notice-box-emerald {
  background-color: rgba(6, 78, 59, 0.45) !important;
  border: 1px solid #10b981 !important;
  color: #f0fdf4 !important;
}

[data-theme="dark"] .notice-box-emerald .notice-title {
  color: #6ee7b7 !important;
  font-weight: 700;
}

[data-theme="dark"] .notice-box-emerald .notice-desc {
  color: #d1fae5 !important;
}

/* Dark Mode General Improvements for Readability & High Contrast */
[data-theme="dark"] .card {
  border-color: #334155 !important;
  background-color: #1e293b !important;
}

[data-theme="dark"] .input, 
[data-theme="dark"] .select, 
[data-theme="dark"] .textarea {
  background-color: #0f172a !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .input:focus, 
[data-theme="dark"] .select:focus, 
[data-theme="dark"] .textarea:focus {
  border-color: #38bdf8 !important;
  outline-color: #38bdf8 !important;
}

[data-theme="dark"] .table-zebra tbody tr:nth-child(even) {
  background-color: rgba(15, 23, 42, 0.6) !important;
}

[data-theme="dark"] .swot-strengths {
  background: linear-gradient(to right, rgba(16, 185, 129, 0.2), transparent);
  border-left-color: #34d399;
}

[data-theme="dark"] .swot-weaknesses {
  background: linear-gradient(to right, rgba(245, 158, 11, 0.2), transparent);
  border-left-color: #fbbf24;
}

[data-theme="dark"] .swot-opportunities {
  background: linear-gradient(to right, rgba(59, 130, 246, 0.2), transparent);
  border-left-color: #60a5fa;
}

[data-theme="dark"] .swot-recommendations {
  background: linear-gradient(to right, rgba(139, 92, 246, 0.2), transparent);
  border-left-color: #a78bfa;
}

/* Printing Optimization */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt;
  }

  .print-only {
    display: block !important;
  }

  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}

.print-only {
  display: none;
}

/* Badges & Pulsing indicators */
.badge {
  height: auto !important;
  min-height: 1.5rem !important;
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
  padding-left: 0.65rem !important;
  padding-right: 0.65rem !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.badge-xs {
  min-height: 1.15rem !important;
  padding-top: 0.05rem !important;
  padding-bottom: 0.05rem !important;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
  font-size: 0.68rem !important;
}

.badge-sm {
  min-height: 1.45rem !important;
  padding-top: 0.15rem !important;
  padding-bottom: 0.15rem !important;
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
  font-size: 0.75rem !important;
}

.pulse-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
