/* ==========================================================================
   PT HULONDALO BERKAH JAYA - CORPORATE & ECOSYSTEM STYLESHEET
   Design System: Modern Gorontalo Heritage & Tech Innovation
   Dials: ENERGY 2 / RHYTHM 3 / MOTION 2
   ========================================================================== */

:root {
  /* Core Palette */
  --color-primary: #0D4E4A;
  --color-primary-light: #14B8A6;
  --color-primary-dark: #042F2E;
  
  --color-accent: #D97706;
  --color-accent-light: #FBBF24;
  --color-accent-dark: #92400E;
  
  /* Light Theme Defaults (Full-page Karawo pattern visibility) */
  --bg-page: transparent;
  --bg-subtle: rgba(241, 245, 249, 0.60);
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #64748B;
  
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  --focus-ring: #0D9488;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-page: transparent;
  --bg-subtle: rgba(15, 23, 42, 0.60);
  --bg-card: #0F1A2A;
  --bg-card-hover: #142236;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  
  --border-subtle: #1E293B;
  --border-strong: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);

  --focus-ring: #2DD4BF;
}

/* Base Document Setup */
html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: #FFFFFF;
  transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme="dark"] html {
  background-color: #070B11;
}

body {
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  background-color: #F8FAFC;
  background-image: url('../images/karawo-pattern.svg');
  background-repeat: repeat;
  background-size: 80px 80px;
  background-attachment: fixed;
}

[data-theme="dark"] body {
  background-color: #070B11;
}

/* Typography Classes */
.font-display {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

/* Focus Accessibility Indicator (R-32 & WCAG AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Karawo Motif Texture Overlay */
.karawo-bg-subtle {
  background-image: url('../images/karawo-pattern.svg');
  background-repeat: repeat;
  background-size: 80px 80px;
}

/* Hero Asymmetric Grid */
.hero-editorial-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 1024px) {
  .hero-editorial-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* Interactive Tabs & Filters (R-05 & User Requirement: distinct active border & animation) */
.interactive-tab-btn,
.kbli-filter-tab,
.calc-role-tab {
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-muted);
}

.interactive-tab-btn:hover,
.kbli-filter-tab:hover,
.calc-role-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  background-color: var(--bg-subtle);
}

.interactive-tab-btn.active,
.kbli-filter-tab.active,
.calc-role-tab.active {
  background-color: var(--color-primary);
  color: #FFFFFF !important;
  border: 2px solid #D97706 !important; /* Prominent Karawo Gold Border */
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3), 0 0 0 1px rgba(217, 119, 6, 0.2);
  transform: translateY(-1px) scale(1.02);
}

[data-theme="dark"] .interactive-tab-btn.active,
[data-theme="dark"] .kbli-filter-tab.active,
[data-theme="dark"] .calc-role-tab.active {
  background-color: #0F766E;
  color: #FFFFFF !important;
  border: 2px solid #F59E0B !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* Nav Dropdown Menu Styles */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 20rem;
  padding-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
}

.nav-dropdown-wrapper:hover .nav-dropdown-panel,
.nav-dropdown-wrapper:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Header Navigation Links with Active Border & Animation (User Requirement) */
.site-nav-link {
  position: relative;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  border: 2px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
  cursor: pointer;
  background-color: transparent;
}

.site-nav-link:hover {
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.site-nav-link.active {
  color: var(--text-main) !important;
  border: 2px solid #D97706 !important; /* Prominent Karawo Gold Border */
  background-color: rgba(217, 119, 6, 0.08);
  box-shadow: 0 2px 12px rgba(217, 119, 6, 0.25);
  transform: translateY(-1px);
  animation: navTabPulse 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .site-nav-link.active {
  color: #FFFFFF !important;
  border: 2px solid #F59E0B !important;
  background-color: rgba(245, 158, 11, 0.16);
  box-shadow: 0 2px 14px rgba(245, 158, 11, 0.35);
}

/* Subtle micro-bounce when tab is activated */
@keyframes navTabPulse {
  0% {
    transform: scale(0.96) translateY(0);
  }
  50% {
    transform: scale(1.04) translateY(-2px);
  }
  100% {
    transform: scale(1) translateY(-1px);
  }
}

/* Dropdown active item inside PRODUK menu */
.dropdown-item {
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.dropdown-item.active {
  background-color: rgba(217, 119, 6, 0.08) !important;
  border: 1.5px solid #D97706 !important;
}

[data-theme="dark"] .dropdown-item.active {
  background-color: rgba(245, 158, 11, 0.14) !important;
  border: 1.5px solid #F59E0B !important;
}

/* Mobile Nav Active Link */
.mobile-nav-link {
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.mobile-nav-link.active {
  color: var(--text-main) !important;
  background-color: rgba(217, 119, 6, 0.08);
  border: 2px solid #D97706 !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .mobile-nav-link.active {
  color: #FFFFFF !important;
  background-color: rgba(245, 158, 11, 0.14);
  border: 2px solid #F59E0B !important;
}

/* KBLI Card Styling */
.kbli-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.kbli-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

/* Modal Drawer / Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 11, 17, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Toast Notification (R-26 Functional Feedback) */
.toast-notice {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 110;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--color-primary-light);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 420px;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Tap Target Constraint (R-03) */
button,
a.tap-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
