/* Custom Styling for SCB PVD Dashboard - Ultra-Compact & Dark/Light Mode */

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

:root {
  --font-display: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font-body);
  background-color: #F7F2E8;
  color: #262320;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dark body {
  background-color: #0b1120;
  color: #f1f5f9;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-display);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #ede7dc;
}
.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}
::-webkit-scrollbar-thumb {
  background: #d5ccbd;
  border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}
::-webkit-scrollbar-thumb:hover {
  background: #b8ac97;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Hide scrollbar for clean horizontal swiping */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tab transitions */
.tab-pane {
  display: none;
  animation: fadeIn 0.15s ease-in-out;
}
.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Metric card */
.metric-card {
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}
.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
}

/* Plan Badge styles */
.badge-fixed {
  background-color: #e0e7ff;
  color: #4338ca;
}
.dark .badge-fixed {
  background-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.badge-diy {
  background-color: #ecfdf5;
  color: #047857;
}
.dark .badge-diy {
  background-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* ========================================================= */
/* FIX: Sticky Table Header with 100% Solid Opaque Background */
/* ========================================================= */
.sticky-header-table {
  overflow-y: auto;
  position: relative;
}

.sticky-header-table thead,
.sticky-header-table thead tr {
  position: sticky;
  top: 0;
  z-index: 20;
}

.sticky-header-table thead th,
.pvd-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #ede7dc !important; /* Solid opaque warm background */
  border-bottom: 2px solid #d5ccbd !important;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05) !important;
}

.dark .sticky-header-table thead th,
.dark .pvd-table thead th {
  background-color: #1e293b !important; /* Solid opaque dark background */
  border-bottom: 2px solid #334155 !important;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
}

/* Table styling */
.pvd-table th {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Collapsible Box Animation */
.collapsible-box {
  transition: max-height 0.2s ease-in-out, opacity 0.15s ease-in-out;
}
.collapsible-box.collapsed {
  display: none !important;
}

/* Range input */
input[type="range"] {
  accent-color: #4f46e5;
}

/* Dark Mode Form Overrides */
.dark input[type="text"],
.dark input[type="number"],
.dark input[type="date"],
.dark input[type="month"],
.dark select,
.dark textarea {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Print Friendly Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .shadow-sm, .shadow-md, .shadow-lg, .shadow-xs, .shadow-2xs {
    box-shadow: none !important;
    border: 1px solid #e2e8f0;
  }
}

/* KuKitT LLC Logo Mask in Footer - Exact Text Color */
.mask-logo-kukitt {
  mask-image: url('../icons/kukitt_logo.png');
  -webkit-mask-image: url('../icons/kukitt_logo.png');
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
  mask-size: contain;
  -webkit-mask-size: contain;
  display: inline-block;
  vertical-align: middle;
}

