/* ==========================================================================
   AI DALAM GOVUC - MAIN DESIGN SYSTEM & STYLESHEET
   Palet: Latar Putih (#FFFFFF / #F8FAFC), Primary Blue (#1557D6), Dark Navy (#102A63), Light Blue (#F2F6FF), AI Gradient (#1557D6 -> #7C3AED)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette - Professional White & Corporate Blue */
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-light-blue: #F2F6FF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFCFF;
  
  --border-subtle: #E2E8F0;
  --border-card: #E5E7EB;
  --border-focus: #1557D6;

  --text-main: #102A63;          /* Dark Navy */
  --text-muted: #64748B;         /* Slate */
  --text-light: #94A3B8;
  --text-white: #FFFFFF;

  /* Brand Accents */
  --primary: #1557D6;            /* Royal Corporate Blue */
  --primary-hover: #0E44AB;
  --primary-light: #EBF2FF;
  --navy: #102A63;
  --purple-ai: #7C3AED;
  --cyan-ai: #06B6D4;
  --emerald-success: #10B981;
  --amber-warning: #F59E0B;
  --rose-danger: #EF4444;

  /* Gradients */
  --grad-ai: linear-gradient(135deg, #1557D6 0%, #7C3AED 100%);
  --grad-hero: linear-gradient(180deg, #F2F6FF 0%, #FFFFFF 100%);
  --grad-card-header: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  --grad-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --grad-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --grad-navy: linear-gradient(135deg, #102A63 0%, #1E3A8A 100%);

  /* Typography */
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(16, 42, 99, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(16, 42, 99, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(16, 42, 99, 0.12);
  --shadow-ai: 0 8px 24px -4px rgba(124, 58, 237, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* Global Anti-Overflow & Word Wrap */
p, span, h1, h2, h3, h4, h5, h6, li, div, button, a {
  overflow-wrap: break-word;
  word-break: normal;
}

.view-section, .main-content-container, .header-container {
  max-width: 100%;
  box-sizing: border-box;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* Header & Main Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-badge {
  background: var(--grad-ai);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  display: block;
  letter-spacing: 0.02em;
}

/* Navigation Links */
.desktop-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--bg-light-blue);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  max-width: 100%;
}

.nav-item-btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  white-space: nowrap;
  word-break: keep-all;
}

.nav-item-btn:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.9);
}

.nav-item-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.nav-item-admin {
  background: rgba(239, 68, 68, 0.08);
  color: var(--rose-danger);
}
.nav-item-admin.active {
  background: var(--rose-danger);
  color: #ffffff;
}

/* Mobile Toggle */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 65px;
  left: 0;
  width: 100vw;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer.active {
  display: flex;
}

/* Main Container Layout */
.main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

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

/* Standard Card & Components */
.card-white {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-white:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.card-highlight-ai {
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-ai {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple-ai);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-blue {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(21, 87, 214, 0.2);
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--rose-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(21, 87, 214, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(21, 87, 214, 0.35);
  transform: translateY(-1px);
}

.btn-ai-grad {
  background: var(--grad-ai);
  color: #ffffff;
  box-shadow: var(--shadow-ai);
}
.btn-ai-grad:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--navy);
  border: 1px solid var(--border-card);
}
.btn-secondary:hover {
  background: var(--bg-light-blue);
  border-color: var(--primary);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 87, 214, 0.15);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  width: 100%;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-main);
  animation: slideUp 0.3s ease;
}

.toast-message.success { border-left-color: var(--emerald-success); }
.toast-message.warning { border-left-color: var(--amber-warning); }
.toast-message.error { border-left-color: var(--rose-danger); }

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

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 42, 99, 0.4);
  backdrop-filter: blur(6px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

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

.modal-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.96);
  transition: var(--transition);
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #F8FAFC;
}

/* Responsive Rules */
@media (max-width: 992px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
}
