/* =============================================
   HCDS DESIGN TOKENS
   File: assets/css/design-tokens.css
   Import di semua halaman HTML dan React
   Version: 1.0
   Last Updated: 2026-09-23
   ============================================= */

/* =============================================
   1. ROOT & CSS VARIABLES
   ============================================= */

:root {
  /* ── Brand Colors ── */
  --color-brand-primary:     #00D4B8;   /* Teal – logo, CTA utama */
  --color-brand-primary-dark:#00A896;   /* Teal darker – hover */
  --color-brand-navy:        #1E3A5F;   /* Navy deep – sidebar */
  --color-brand-navy-light:  #264878;   /* Navy – hover sidebar */

  /* ── Background ── */
  --color-bg-base:           #0F172A;   /* Dark base */
  --color-bg-surface:        #1E293B;   /* Card / panel */
  --color-bg-elevated:       #263548;   /* Elevated card (hover) */
  --color-bg-overlay:        rgba(15, 23, 42, 0.85); /* Modal overlay */

  /* ── Text ── */
  --color-text-primary:      #F1F5F9;   /* Heading, label utama */
  --color-text-secondary:    #94A3B8;   /* Subtext, label sekunder */
  --color-text-muted:        #64748B;   /* Placeholder, disabled */
  --color-text-inverse:      #0F172A;   /* Text di atas background terang */
  --color-text-link:         #00D4B8;   /* Link */
  --color-text-link-hover:   #00A896;

  /* ── Border ── */
  --color-border:            rgba(255, 255, 255, 0.08);
  --color-border-focus:      #00D4B8;
  --color-border-error:      #EF4444;

  /* ── Status Colors ── */
  --color-success:           #10B981;   /* Green */
  --color-success-bg:        rgba(16, 185, 129, 0.12);
  --color-success-border:    rgba(16, 185, 129, 0.3);

  --color-warning:           #F59E0B;   /* Amber */
  --color-warning-bg:        rgba(245, 158, 11, 0.12);
  --color-warning-border:    rgba(245, 158, 11, 0.3);

  --color-danger:            #EF4444;   /* Red */
  --color-danger-bg:         rgba(239, 68, 68, 0.12);
  --color-danger-border:     rgba(239, 68, 68, 0.3);

  --color-info:              #3B82F6;   /* Blue */
  --color-info-bg:           rgba(59, 130, 246, 0.12);
  --color-info-border:       rgba(59, 130, 246, 0.3);

  --color-neutral:           #64748B;   /* Gray */
  --color-neutral-bg:        rgba(100, 116, 139, 0.12);

  /* ── Alert Severity Colors ── */
  --severity-critical:       #DC2626;   /* Merah – harus ditangani sekarang */
  --severity-critical-bg:    rgba(220, 38, 38, 0.15);
  --severity-high:           #EA580C;   /* Oranye – dalam 15 menit */
  --severity-high-bg:       rgba(234, 88, 12, 0.15);
  --severity-warning:        #D97706;   /* Kuning – pantau */
  --severity-warning-bg:     rgba(217, 119, 6, 0.15);
  --severity-info:           #2563EB;   /* Biru – informasi */
  --severity-info-bg:        rgba(37, 99, 235, 0.15);

  /* ── SLA Status Colors ── */
  --sla-on-track:            #10B981;   /* > 50% waktu tersisa */
  --sla-at-risk:             #F59E0B;   /* 25-50% waktu tersisa */
  --sla-breaching:           #EF4444;   /* < 25% waktu tersisa */
  --sla-breached:            #7F1D1D;   /* Sudah lewat deadline */

  /* ── Health Status Colors ── */
  --health-healthy:          #10B981;
  --health-degraded:         #F59E0B;
  --health-warning:          #EA580C;
  --health-critical:         #EF4444;
  --health-unknown:          #64748B;

  /* ── Spacing Scale ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Border Radius ── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ── Shadow ── */
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 16px rgba(0, 212, 184, 0.25);

  /* ── Transition ── */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* ── Z-Index ── */
  --z-dropdown:  100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
  --z-tooltip:  500;

  /* ── Typography ── */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-primary);
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* ── Type Scale ── */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;

  /* ── Responsive Breakpoints ── */
  --bp-mobile:  640px;
  --bp-tablet:  768px;
  --bp-laptop:  1024px;
  --bp-desktop: 1280px;
  --bp-wide:    1536px;
}

/* =============================================
   2. BASE STYLES
   ============================================= */

/* Font imports - tambahkan di <head> halaman HTML */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
}

/* Links */
a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-link-hover);
  text-decoration: underline;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* =============================================
   3. UTILITY CLASSES
   ============================================= */

/* Text Colors */
.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-info      { color: var(--color-info); }
.text-link      { color: var(--color-text-link); }

/* Text Sizes */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }

/* Font Weights */
.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* Font Families */
.font-primary { font-family: var(--font-primary); }
.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

/* Background Colors */
.bg-base     { background-color: var(--color-bg-base); }
.bg-surface  { background-color: var(--color-bg-surface); }
.bg-elevated { background-color: var(--color-bg-elevated); }

/* Interactive */
.interactive {
  transition: all var(--transition-normal);
}

.interactive:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =============================================
   4. ANIMATIONS
   ============================================= */

/* Pulse animation for live indicators */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Pulse fast for critical states */
@keyframes pulse-fast {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

/* Shimmer for skeleton loaders */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =============================================
   5. RESPONSIVE HELPERS
   ============================================= */

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 641px) {
  .show-mobile-only { display: none !important; }
}

@media (max-width: 768px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 769px) {
  .show-tablet-only { display: none !important; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
}

/* =============================================
   6. LIGHT MODE OVERRIDES
   ============================================= */

/* Light mode color overrides for better readability */
[data-theme="light"] {
  --color-text-primary: #0F172A !important;
  --color-text-secondary: #334155 !important;
  --color-text-muted: #64748B !important;
}

/* KPI value contrast in light mode */
[data-theme="light"] .wave-kpi-value,
[data-theme="light"] .plat-kpi-value,
[data-theme="light"] .kpi-value {
  color: #0F172A !important;
  font-weight: 700 !important;
}

/* Alert section text in light mode */
[data-theme="light"] .alert-title,
[data-theme="light"] .alert-feed-title {
  color: #0F172A !important;
}

/* Platform comparison text in light mode */
[data-theme="light"] .platform-sub-label {
  color: #64748B !important;
}

/* KPI label in light mode */
[data-theme="light"] .wave-kpi-label {
  color: #64748B !important;
}
