/* ============================================================
   KopDes Pintar — base.css
   Design tokens, reset, typography, SVG icon styles & animations
   ============================================================ */

/* DESIGN TOKENS */
:root {
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Rose Red Professional Palette — Light Mode */
  --bg-app:        #f8fafc;
  --bg-card:       #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input:      #f8fafc;
  --bg-sidebar:    #0f172a;

  --text-main:     #0f172a;
  --text-muted:    #64748b;
  --text-inverse:  #ffffff;

  --border-color:  #e2e8f0;
  --border-focus:  #f43f5e;

  --primary:       #e11d48;
  --primary-hover: #be123c;
  --primary-light: rgba(225, 29, 72, 0.06);
  --primary-rgb:   225, 29, 72;
  --accent:        #f59e0b;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #2563eb;
  --success:       #10b981;

  --shadow-sm:  0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow:     0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg:  0 10px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl:  0 20px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light dark;
  scrollbar-color: #cbd5e1 #f8fafc;
  scrollbar-width: thin;
}

/* Dark Mode Overrides */
:root[data-theme="dark"] {
  --bg-app:       #090d16;
  --bg-card:      #111827;
  --bg-card-hover:#1f2937;
  --bg-input:     #1f2937;
  --bg-sidebar:   #030712;
  --text-main:    #f8fafc;
  --text-muted:   #94a3b8;
  --text-inverse: #090d16;
  --border-color: #1e293b;
  --border-focus: #f43f5e;
  --primary:      #f43f5e;
  --primary-hover:#e11d48;
  --primary-light:rgba(244, 63, 94, 0.12);
  --primary-rgb:  244, 63, 94;
  --shadow-sm:  0 1px 2px 0 rgba(0,0,0,.3);
  --shadow:     0 4px 12px -2px rgba(0,0,0,.4);
  --shadow-lg:  0 10px 24px -4px rgba(0,0,0,.5);
  --shadow-xl:  0 20px 36px -6px rgba(0,0,0,.6);
  scrollbar-color: #334155 #090d16;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: 0; outline: none; background: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* TYPOGRAPHY */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.025em; font-weight: 700; }

/* SVG ICON SYSTEM */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
}
.icon-wrap {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.icon-wrap.primary { background: rgba(var(--primary-rgb),.1); color: var(--primary); }
.icon-wrap.success { background: rgba(16,185,129,.1); color: var(--success); }
.icon-wrap.info    { background: rgba(37,99,235,.1);  color: var(--info); }
.icon-wrap.warning { background: rgba(245,158,11,.1); color: var(--warning); }
.icon-wrap.danger  { background: rgba(239,68,68,.1);  color: var(--danger); }

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* LOADING SPINNER */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner.dark {
  border-color: rgba(var(--primary-rgb),.2);
  border-top-color: var(--primary);
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 9999;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.1);
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); color: white; border-color: transparent; }

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 90;
  display: none;
  place-items: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: grid; animation: fadeIn .15s ease; }
.modal-card {
  width: 440px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  animation: slideUp .2s ease;
}

/* EMPTY STATE */
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
}

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  background: rgba(225,29,72,.08); color: var(--primary);
  line-height: 1;
}
.badge.green  { background: rgba(16,185,129,.1);  color: #10b981; }
.badge.yellow { background: rgba(245,158,11,.1);  color: #d97706; }
.badge.blue   { background: rgba(37,99,235,.1);   color: #2563eb; }
.badge.red    { background: rgba(239,68,68,.1);   color: #ef4444; }

/* LOADING SCREEN */
#loadingScreen {
  position: fixed; inset: 0;
  background: var(--bg-app);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; z-index: 9998;
  transition: opacity .3s ease;
}
#loadingScreen.hidden { opacity: 0; pointer-events: none; }
#loadingScreen .logo-mark {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: white;
  box-shadow: 0 8px 20px rgba(225,29,72,.35);
}
#loadingScreen p { font-size: 12px; font-weight: 600; color: var(--text-muted); }
