/* Custom Styles for Dashboard TPP 2027 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light Mode Body & Global Defaults */
html:not(.dark) body {
  background-color: #f8fafc;
  color: #0f172a;
}
html.dark body {
  background-color: #020617;
  color: #f8fafc;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
html:not(.dark) ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

/* Glassmorphism Cards */
html.dark .glass-card,
.glass-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
}

html:not(.dark) .glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

/* Light Mode Overrides for Headers, Cards, Tables & Popovers */
html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) .bg-slate-950\/60 {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

html:not(.dark) .bg-slate-800 {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200,
html:not(.dark) .text-slate-300 {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-400,
html:not(.dark) .text-slate-500 {
  color: #475569 !important;
}

html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-800\/60 {
  border-color: #e2e8f0 !important;
}

html:not(.dark) input[type="text"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) .filter-dropdown-group button {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html:not(.dark) .filter-dropdown-group div[id^="menuFilter"] {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1) !important;
}

html:not(.dark) .filter-item-row:hover {
  background-color: #f1f5f9 !important;
}

html:not(.dark) #detailModal > div {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) th[data-sort] {
  color: #475569 !important;
}
html:not(.dark) th[data-sort]:hover {
  color: #4f46e5 !important;
}

html:not(.dark) tr.table-row-hover:hover {
  background-color: #f1f5f9 !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-zoom-in {
  animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pulse Glow */
.glow-indigo {
  box-shadow: 0 0 20px -5px rgba(99, 102, 241, 0.4);
}

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

.glow-sky {
  box-shadow: 0 0 20px -5px rgba(14, 165, 233, 0.4);
}

.glow-purple {
  box-shadow: 0 0 20px -5px rgba(168, 85, 247, 0.4);
}

/* Custom Badges */
.badge-eselon-ii {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}
.badge-eselon-iii {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
}
.badge-eselon-iv {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}
.badge-fungsional {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}
.badge-pelaksana {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Print Styling */
@media print {
  body * {
    visibility: hidden;
  }
  #printableModal, #printableModal * {
    visibility: visible;
  }
  #printableModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}
