/* ==========================================================================
   YOLDA DESIGN SYSTEM — DESIGN TOKENS (tokens.css)
   Sıfır emoji, POUR erişilebilirlik standartları, 3 katmanlı token mimarisi
   ========================================================================== */

:root {
  /* --- 1. PRIMITIVE / COLOR PALETTE (CALM SOFT DARK DEFAULT) --- */
  --color-bg: #0C0E14;
  --color-surface: #121620;
  --color-surface-2: #181D29;
  --color-surface-3: #202736;
  --color-surface-card: #151A26;

  /* Lines & Borders */
  --color-line: rgba(255, 255, 255, 0.06);
  --color-line-focus: rgba(255, 255, 255, 0.12);
  --color-line-active: rgba(255, 255, 255, 0.18);

  /* Brand / Action Primary (Calm Mint / Emerald) */
  --color-brand: #00B871;
  --color-brand-hover: #05C97D;
  --color-brand-active: #009E60;
  --color-brand-glow: rgba(0, 184, 113, 0.09);
  --color-brand-dim: rgba(0, 184, 113, 0.05);

  /* Danger / Destructive (Rose / Red) */
  --color-error: #E11D48;
  --color-error-hover: #F43F5E;
  --color-error-active: #BE123C;
  --color-error-glow: rgba(225, 29, 72, 0.09);
  --color-error-dim: rgba(225, 29, 72, 0.05);

  /* Info (Sky / Blue) */
  --color-info: #3B82F6;
  --color-info-hover: #60A5FA;
  --color-info-active: #2563EB;
  --color-info-glow: rgba(59, 130, 246, 0.09);
  --color-info-dim: rgba(59, 130, 246, 0.05);

  /* Warning / Pending (Warm Amber) */
  --color-warning: #F59E0B;
  --color-warning-hover: #FBBF24;
  --color-warning-active: #D97706;
  --color-warning-glow: rgba(245, 158, 11, 0.09);
  --color-warning-dim: rgba(245, 158, 11, 0.05);

  /* Accent (Soft Violet) */
  --color-accent: #8B5CF6;
  --color-accent-hover: #A78BFA;
  --color-accent-glow: rgba(139, 92, 246, 0.09);

  /* Typography Colors */
  --color-text: #F1F5F9;
  --color-text-2: #CBD5E1;
  --color-muted: #8E9BAE;
  --color-subtle: #5A6980;
  --color-disabled: #475569;

  /* Backward Compatibility Aliases */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-2);
  --surface-3: var(--color-surface-3);
  --line: var(--color-line);
  --line-focus: var(--color-line-focus);
  --brand: var(--color-brand);
  --brand-hover: var(--color-brand-hover);
  --brand-active: var(--color-brand-active);
  --brand-glow: var(--color-brand-glow);
  --brand-dim: var(--color-brand-dim);
  --lime: var(--color-brand);
  --lime-glow: var(--color-brand-glow);
  --lime-hover: var(--color-brand-hover);
  --ember: var(--color-error);
  --ember-glow: var(--color-error-glow);
  --blue: var(--color-info);
  --blue-glow: var(--color-info-glow);
  --gold: var(--color-warning);
  --gold-glow: var(--color-warning-glow);
  --purple: var(--color-accent);
  --text: var(--color-text);
  --muted: var(--color-muted);

  /* Kurye.html legacy aliases */
  --c-bg: var(--color-bg);
  --c-surface: var(--color-surface);
  --c-card: var(--color-surface-2);
  --c-border: var(--color-line);
  --c-border2: var(--color-line-focus);
  --c-green: var(--color-brand);
  --c-green-bg: var(--color-brand-glow);
  --c-green-dim: var(--color-brand-dim);
  --c-amber: var(--color-warning);
  --c-amber-bg: var(--color-warning-glow);
  --c-red: var(--color-error);
  --c-red-bg: var(--color-error-glow);
  --c-blue: var(--color-info);
  --c-blue-bg: var(--color-info-glow);
  --c-text: var(--color-text);
  --c-text2: var(--color-muted);
  --c-text3: var(--color-subtle);

  /* --- 2. TYPOGRAPHY SCALE --- */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;

  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* --- 3. 4PX BASE 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;

  /* --- 4. BORDER RADII --- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* --- 5. ELEVATION & SHADOWS --- */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-focus: 0 0 0 3px rgba(0, 184, 113, 0.20);
  --shadow-focus-error: 0 0 0 3px rgba(225, 29, 72, 0.20);

  /* --- 6. MOTION & TRANSITIONS --- */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 350ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* --- 7. LAYOUT & DIMENSIONS --- */
  --header-h: 66px;
  --sidebar-w: 260px;
  --bottom-nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --touch-min-target: 44px;

  /* Shared workspace component tokens. */
  --border-thin: 1px;
  --border-focus: 2px;
  --opacity-disabled: 0.5;
  --size-icon-sm: 16px;
  --size-icon-md: 20px;
  --size-map: 440px;
  --size-map-mobile: 320px;
  --size-workspace-rail: 320px;
  --size-workspace-max: 1600px;
  --color-selected-text: var(--color-brand);
  --color-on-primary: #0C0E14;
  --color-status-warning-text: #FBBF24;
  --color-status-error-text: #FDA4AF;
  --color-status-info-text: #93C5FD;
}

/* --- 8. LIGHT THEME OVERRIDES --- */
[data-theme="light"] {
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-2: #F1F5F9;
  --color-surface-3: #E2E8F0;
  --color-surface-card: #FFFFFF;

  --color-line: rgba(15, 23, 42, 0.07);
  --color-line-focus: rgba(15, 23, 42, 0.14);
  --color-line-active: rgba(15, 23, 42, 0.22);

  --color-brand: #059669;
  --color-brand-hover: #047857;
  --color-brand-active: #065F46;
  --color-brand-glow: rgba(5, 150, 105, 0.08);
  --color-brand-dim: rgba(5, 150, 105, 0.04);

  --color-error: #E11D48;
  --color-error-hover: #BE123C;
  --color-error-active: #9F1239;
  --color-error-glow: rgba(225, 29, 72, 0.08);
  --color-error-dim: rgba(225, 29, 72, 0.04);

  --color-info: #2563EB;
  --color-info-hover: #1D4ED8;
  --color-info-active: #1E40AF;
  --color-info-glow: rgba(37, 99, 235, 0.08);
  --color-info-dim: rgba(37, 99, 235, 0.04);

  --color-warning: #D97706;
  --color-warning-hover: #B45309;
  --color-warning-active: #92400E;
  --color-warning-glow: rgba(217, 119, 6, 0.08);
  --color-warning-dim: rgba(217, 119, 6, 0.04);

  --color-accent: #7C3AED;
  --color-accent-hover: #6D28D9;
  --color-accent-glow: rgba(124, 58, 237, 0.08);

  --color-text: #0F172A;
  --color-text-2: #334155;
  --color-muted: #64748B;
  --color-subtle: #94A3B8;
  --color-disabled: #CBD5E1;

  --color-selected-text: #047857;
  --color-on-primary: #FFFFFF;
  --color-status-warning-text: #92400E;
  --color-status-error-text: #BE123C;
  --color-status-info-text: #1D4ED8;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-3: 0 10px 24px rgba(0, 0, 0, 0.09);
}

/* Global utility classes for state & accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skeleton Loading Shimmer */
.skeleton-loading {
  background: linear-gradient(
    90deg,
    var(--color-surface-2) 25%,
    var(--color-surface-3) 50%,
    var(--color-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite var(--ease-standard);
  border-radius: var(--radius-sm);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast Container & Notification Styles */
#yolda-toast-container {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 24px);
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
  width: 380px;
}

.yd-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface-3);
  color: var(--color-text);
  border: 1px solid var(--color-line-focus);
  box-shadow: var(--shadow-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-base) var(--ease-standard);
}

.yd-toast.yd-toast-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.yd-toast-success {
  border-left: 4px solid var(--color-brand);
}
.yd-toast-error {
  border-left: 4px solid var(--color-error);
}
.yd-toast-warning {
  border-left: 4px solid var(--color-warning);
}
.yd-toast-info {
  border-left: 4px solid var(--color-info);
}

.yd-toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.yd-toast-msg {
  flex: 1;
  line-height: var(--leading-tight);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
