/* ═══════════════════════════════════════════════════════════════════════════════
   TAOYEN HERITAGE DESIGN SYSTEM
   Fleet Management System - PM Flow

   Version: 1.0
   Last Updated: 2026-04-10

   Philosophy: Thai craftsmanship meets industrial precision
   Warm, serious, refined, cultural, trustworthy
════════════════════════════════════════════════════════════════════════════════ */

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */

:root {
  /* ═══════════════════════════════════════════════════════════════════════════════
     COLOR PALETTE
  ═══════════════════════════════════════════════════════════════════════════════ */

  /* Primary Colors - Navy Foundation */
  --navy-50:   #f0f4f8;
  --navy-100:  #dae9f2;
  --navy-200:  #b5d4eb;
  --navy-300:  #7eb8d6;
  --navy-400:  #4a9dc0;
  --navy-500:  #0c1f3f;  /* PRIMARY - Main brand color */
  --navy-600:  #0a1830;
  --navy-700:  #071122;
  --navy-800:  #040c19;
  --navy-900:  #02060d;

  /* Secondary Colors - Teal Accent */
  --teal-50:   #f0fdfa;
  --teal-100:  #ccfbf1;
  --teal-200:  #99f6e4;
  --teal-300:  #5fead4;
  --teal-400:  #2dd4bf;
  --teal-500:  #0d9488;  /* SECONDARY - Main accent */
  --teal-600:  #0f766e;
  --teal-700:  #0f5156;
  --teal-800:  #115e59;
  --teal-900:  #134e4a;

  /* Accent Colors - Amber Warning */
  --amber-50:   #fffbeb;
  --amber-100:  #fef3c7;
  --amber-200:  #fde68a;
  --amber-300:  #fcd34d;
  --amber-400:  #fbbf24;
  --amber-500:  #d97706;  /* ACCENT - Warning */
  --amber-600:  #b45309;
  --amber-700:  #92400e;
  --amber-800:  #78350f;
  --amber-900:  #451a03;

  /* PM Identity Color - Violet Distinction */
  --pm-50:    #f5f3ff;
  --pm-100:   #ede9fe;
  --pm-200:   #ddd6fe;
  --pm-300:   #c4b5fd;
  --pm-400:   #a78bfa;
  --pm-500:   #6d28d9;  /* PM PRIMARY - PM-specific color */
  --pm-600:   #7c3aed;
  --pm-700:   #6d28d9;
  --pm-800:   #5b21b6;
  --pm-900:   #4c1d95;

  /* Semantic Colors */
  --success-50:  #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #16a34a;
  --success-700: #15803d;

  --error-50:    #fef2f2;
  --error-100:   #fee2e2;
  --error-200:   #fecaca;
  --error-500:   #dc2626;
  --error-600:   #b91c1c;
  --error-700:   #991b1b;

  --warning-50:  #fff7ed;
  --warning-100: #ffedd5;
  --warning-500: #ea580c;
  --warning-700: #c2410c;

  --info-50:     #eff6ff;
  --info-100:    #dbeafe;
  --info-500:    #3b82f6;
  --info-700:    #1d4ed8;

  /* Neutral Colors - Slate Scale */
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-300:  #cbd5e1;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-600:  #475569;
  --slate-700:  #334155;
  --slate-800:  #1e293b;
  --slate-900:  #0f172a;

  /* Legacy aliases (for compatibility) */
  --navy:       var(--navy-500);
  --navy-mid:   var(--navy-600);
  --navy-lite:  var(--navy-400);
  --teal:       var(--teal-500);
  --teal-hi:    var(--teal-400);
  --teal-pale:  var(--teal-100);
  --teal-bg:    var(--teal-50);
  --amber:      var(--amber-500);
  --amber-pale: var(--amber-100);
  --amber-hi:   var(--amber-400);
  --pm:         var(--pm-500);
  --pm-mid:     var(--pm-600);
  --pm-hi:      var(--pm-400);
  --pm-pale:    var(--pm-100);
  --pm-bg:      var(--pm-50);
  --red:        var(--error-500);
  --red-pale:   var(--error-100);
  --green:      var(--success-500);
  --green-pale: var(--success-100);
  --orange:     var(--warning-500);
  --orange-pale: var(--warning-100);

  /* ═══════════════════════════════════════════════════════════════════════════════
     TYPOGRAPHY
  ═══════════════════════════════════════════════════════════════════════════════ */

  /* Font Families */
  --font-display: 'Charmonman', 'Th Sarabun New', serif;
  --font-body:    'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  /* Font Sizes - Major Third Scale (1.250) */
  --text-xs:     0.75rem;   /* 12px */
  --text-sm:     0.875rem;  /* 14px */
  --text-base:   1rem;      /* 16px - body default */
  --text-lg:     1.125rem;  /* 18px */
  --text-xl:     1.25rem;   /* 20px */
  --text-2xl:    1.5rem;    /* 24px */
  --text-3xl:    1.875rem;  /* 30px */
  --text-4xl:    2.25rem;   /* 36px */
  --text-5xl:    3rem;      /* 48px */

  /* Font Weights */
  --font-light:     300;
  --font-regular:   400;
  --font-medium:    500;
  --font-semibold:  600;
  --font-bold:      700;
  --font-extrabold: 800;

  /* Line Heights */
  --leading-tight:   1.25;  /* Headings */
  --leading-snug:    1.375; /* Large text */
  --leading-normal:  1.5;   /* Body text */
  --leading-relaxed:  1.625; /* Relaxed reading */
  --leading-loose:   2;     /* Special cases */

  /* ═══════════════════════════════════════════════════════════════════════════════
     SPACING SYSTEM (4px base unit)
  ═══════════════════════════════════════════════════════════════════════════════ */

  --space-0:   0;
  --space-1:   0.25rem;  /* 4px */
  --space-2:   0.5rem;   /* 8px */
  --space-3:   0.75rem;  /* 12px */
  --space-4:   1rem;     /* 16px */
  --space-5:   1.25rem;  /* 20px */
  --space-6:   1.5rem;   /* 24px */
  --space-8:   2rem;     /* 32px */
  --space-10:  2.5rem;   /* 40px */
  --space-12:  3rem;     /* 48px */
  --space-16:  4rem;     /* 64px */
  --space-20:  5rem;     /* 80px */
  --space-24:  6rem;     /* 96px */

  /* ═══════════════════════════════════════════════════════════════════════════════
     BORDER RADIUS
  ═══════════════════════════════════════════════════════════════════════════════ */

  --radius-none:  0;
  --radius-sm:    0.25rem;  /* 4px */
  --radius-md:    0.375rem; /* 6px */
  --radius-lg:    0.5rem;   /* 8px */
  --radius-xl:    0.75rem;  /* 12px */
  --radius-2xl:   1rem;     /* 16px */
  --radius-full:  9999px;   /* Pills, badges */

  /* Legacy aliases */
  --radius-sm:  var(--radius-sm);
  --radius:     var(--radius-md);
  --radius-lg:  var(--radius-lg);

  /* ═══════════════════════════════════════════════════════════════════════════════
     SHADOWS (Elevation System)
  ═══════════════════════════════════════════════════════════════════════════════ */

  --shadow-xs:    0 1px 2px rgba(12, 31, 63, 0.05);
  --shadow-sm:    0 1px 3px rgba(12, 31, 63, 0.08), 0 1px 2px rgba(12, 31, 63, 0.06);
  --shadow-md:    0 4px 6px rgba(12, 31, 63, 0.1), 0 2px 4px rgba(12, 31, 63, 0.08);
  --shadow-lg:    0 10px 15px rgba(12, 31, 63, 0.12), 0 4px 6px rgba(12, 31, 63, 0.08);
  --shadow-xl:    0 20px 25px rgba(12, 31, 63, 0.15), 0 10px 10px rgba(12, 31, 63, 0.08);
  --shadow-2xl:   0 25px 50px rgba(12, 31, 63, 0.25);
  --shadow-inner: inset 0 2px 4px rgba(12, 31, 63, 0.06);

  /* Colored shadows */
  --shadow-teal:    0 4px 14px rgba(13, 148, 136, 0.25);
  --shadow-amber:   0 4px 14px rgba(217, 119, 6, 0.25);
  --shadow-violet:  0 4px 14px rgba(109, 40, 217, 0.25);
  --shadow-success: 0 4px 14px rgba(22, 163, 74, 0.25);
  --shadow-error:   0 4px 14px rgba(220, 38, 38, 0.25);

  /* Legacy aliases */
  --shadow-sm:  var(--shadow-sm);
  --shadow:     var(--shadow-md);
  --shadow-lg:  var(--shadow-lg);

  /* ═══════════════════════════════════════════════════════════════════════════════
     TRANSITIONS
  ═══════════════════════════════════════════════════════════════════════════════ */

  /* Timing Functions */
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-sharp:   cubic-bezier(0.4, 0, 0.6, 1);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Durations */
  --duration-75:   75ms;
  --duration-100:  100ms;
  --duration-150:  150ms;
  --duration-200:  200ms;
  --duration-300:  300ms;
  --duration-500:  500ms;
  --duration-700:  700ms;

  /* ═══════════════════════════════════════════════════════════════════════════════
     Z-INDEX SCALE
  ═══════════════════════════════════════════════════════════════════════════════ */

  --z-base:        0;
  --z-above:       10;
  --z-dropdown:    100;
  --z-sticky:      200;
  --z-fixed:       300;
  --z-modal-back:  400;
  --z-modal:       500;
  --z-popover:     600;
  --z-tooltip:     700;

  /* ═══════════════════════════════════════════════════════════════════════════════
     LAYOUT
  ═══════════════════════════════════════════════════════════════════════════════ */

  --sidebar-w: 230px;
  --topnav-h: 54px;

  /* Breakpoints (for reference) */
  --breakpoint-sm:  640px;
  --breakpoint-md:  768px;
  --breakpoint-lg:  1024px;
  --breakpoint-xl:  1280px;
  --breakpoint-2xl: 1536px;

  /* Container widths */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1536px;
}

/* ===== BASE STYLES ===== */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--slate-700);
  background: var(--slate-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--navy-500);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

/* Links */
a {
  color: var(--teal-500);
  text-decoration: none;
  transition: color var(--duration-150) var(--ease-out);
}

a:hover {
  color: var(--teal-400);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Focus visible for all interactive elements */
*:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus {
  outline: none;
}

/* ===== UTILITY CLASSES ===== */

/* Text utilities */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.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); }
.text-5xl  { font-size: var(--text-5xl); }

.font-light    { font-weight: var(--font-light); }
.font-regular  { font-weight: var(--font-regular); }
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }
.font-extrabold { font-weight: var(--font-extrabold); }

.leading-tight   { line-height: var(--leading-tight); }
.leading-snug    { line-height: var(--leading-snug); }
.leading-normal  { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

/* Display fonts */
.display {
  font-family: var(--font-display);
}

/* Monospace */
.mono {
  font-family: var(--font-mono);
}

/* Color utilities */
.text-navy       { color: var(--navy-500); }
.text-navy-600   { color: var(--navy-600); }
.text-teal       { color: var(--teal-500); }
.text-amber      { color: var(--amber-500); }
.text-pm         { color: var(--pm-500); }
.text-success    { color: var(--success-500); }
.text-error      { color: var(--error-500); }
.text-warning    { color: var(--warning-500); }
.text-slate      { color: var(--slate-600); }
.text-slate-500  { color: var(--slate-500); }
.text-slate-600  { color: var(--slate-600); }
.text-slate-700  { color: var(--slate-700); }

.bg-navy        { background: var(--navy-500); }
.bg-navy-600    { background: var(--navy-600); }
.bg-teal        { background: var(--teal-500); }
.bg-amber       { background: var(--amber-500); }
.bg-pm          { background: var(--pm-500); }
.bg-success     { background: var(--success-500); }
.bg-error       { background: var(--error-500); }
.bg-warning     { background: var(--warning-500); }
.bg-white       { background: white; }
.bg-slate-50    { background: var(--slate-50); }
.bg-slate-100   { background: var(--slate-100); }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Flexbox utilities */
.flex           { display: flex; }
.inline-flex    { display: inline-flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start  { justify-content: flex-start; }
.justify-end    { justify-content: flex-end; }
.flex-1         { flex: 1; }
.flex-wrap      { flex-wrap: wrap; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid utilities */
.grid           { display: grid; }
.grid-cols-1     { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3     { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4     { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Border utilities */
.border         { border: 1px solid var(--slate-200); }
.border-t        { border-top: 1px solid var(--slate-200); }
.border-r        { border-right: 1px solid var(--slate-200); }
.border-b        { border-bottom: 1px solid var(--slate-200); }
.border-l        { border-left: 1px solid var(--slate-200); }

.rounded-none    { border-radius: var(--radius-none); }
.rounded-sm      { border-radius: var(--radius-sm); }
.rounded         { border-radius: var(--radius-md); }
.rounded-md      { border-radius: var(--radius-md); }
.rounded-lg      { border-radius: var(--radius-lg); }
.rounded-xl      { border-radius: var(--radius-xl); }
.rounded-full    { border-radius: var(--radius-full); }

/* Shadow utilities */
.shadow-sm  { box-shadow: var(--shadow-sm); }
.shadow     { box-shadow: var(--shadow-md); }
.shadow-md  { box-shadow: var(--shadow-md); }
.shadow-lg  { box-shadow: var(--shadow-lg); }
.shadow-xl  { box-shadow: var(--shadow-xl); }

/* Width/Height utilities */
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ===== COMPONENT STYLES ===== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-150) var(--ease-out);
}

.btn:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
}

/* Button variants — primary = teal (main CTA), secondary = navy (supporting) */
.btn-primary {
  background: var(--teal-500);
  color: white;
  border-color: var(--teal-500);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-600);
  border-color: var(--teal-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--navy-500);
  color: white;
  border-color: var(--navy-500);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--navy-600);
  border-color: var(--navy-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-pm {
  background: var(--pm-500);
  color: white;
  border-color: var(--pm-500);
}

.btn-pm:hover:not(:disabled) {
  background: var(--pm-600);
  border-color: var(--pm-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-violet);
}

.btn-outline {
  background: transparent;
  color: var(--navy-500);
  border-color: var(--slate-300);
}

.btn-outline:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--navy-300);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-500);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--slate-100);
}

.btn-danger {
  background: var(--error-500);
  color: white;
  border-color: var(--error-500);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-600);
  border-color: var(--error-600);
  box-shadow: var(--shadow-error);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  transition: all var(--duration-300) var(--ease-out);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card:focus-within {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--slate-200);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--slate-200);
}

/* Card variants */
.card--pm {
  border-left: 4px solid var(--pm-500);
}

.card--success {
  border-left: 4px solid var(--success-500);
}

.card--warning {
  border-left: 4px solid var(--amber-500);
}

.card--error {
  border-left: 4px solid var(--error-500);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: #334155;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: #334155;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  transition: all var(--duration-150) var(--ease-out);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #94a3b8;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error-500);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-hint {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: #64748b;
}

.form-error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--error-500);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft {
  background: #f1f5f9;
  color: #334155;
}

.badge-pending {
  background: var(--amber-100);
  color: var(--amber-700);
}

.badge-approved {
  background: var(--teal-100);
  color: var(--teal-700);
}

.badge-in-progress {
  background: var(--pm-100);
  color: var(--pm-700);
}

.badge-closed {
  background: var(--success-100);
  color: var(--success-700);
}

.badge-rejected {
  background: var(--error-100);
  color: var(--error-700);
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
}

.alert-success {
  background: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-700);
}

.alert-warning {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-700);
}

.alert-error {
  background: var(--error-50);
  border-color: var(--error-200);
  color: var(--error-700);
}

.alert-info {
  background: var(--info-50);
  border-color: var(--info-200);
  color: var(--info-700);
}

/* ===== ANIMATIONS ===== */

/* Fade in up animation */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in-up var(--duration-500) var(--ease-out);
}

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

.animate-fade-in-short {
  animation: fade-in var(--duration-300) var(--ease-out);
}

/* Slide in from right */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in {
  animation: slide-in-right var(--duration-300) var(--ease-out);
}

/* Pulse animation for attention */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin animation for loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOTION & ANIMATION SYSTEM
   Taoyen Heritage - Subtle, refined motion with cultural elegance
════════════════════════════════════════════════════════════════════════════════ */

/* ===== FADE ANIMATIONS ===== */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fade-in var(--duration-300) var(--ease-out);
}

.animate-fade-out {
  animation: fade-out var(--duration-300) var(--ease-in);
}

.animate-fade-in-up {
  animation: fade-in-up var(--duration-500) var(--ease-out);
}

.animate-fade-in-down {
  animation: fade-in-down var(--duration-500) var(--ease-out);
}

.animate-fade-in-left {
  animation: fade-in-left var(--duration-500) var(--ease-out);
}

.animate-fade-in-right {
  animation: fade-in-right var(--duration-500) var(--ease-out);
}

/* ===== SLIDE ANIMATIONS ===== */

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slide-left {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slide-right {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-slide-up {
  animation: slide-up var(--duration-300) var(--ease-sharp);
}

.animate-slide-down {
  animation: slide-down var(--duration-300) var(--ease-sharp);
}

.animate-slide-left {
  animation: slide-left var(--duration-300) var(--ease-sharp);
}

.animate-slide-right {
  animation: slide-right var(--duration-300) var(--ease-sharp);
}

/* ===== SCALE ANIMATIONS ===== */

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scale-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@keyframes scale-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-scale-in {
  animation: scale-in var(--duration-200) var(--ease-out);
}

.animate-scale-out {
  animation: scale-out var(--duration-200) var(--ease-in);
}

.animate-scale-pulse {
  animation: scale-pulse 2s var(--ease-in-out) infinite;
}

/* ===== SHAKE ANIMATIONS ===== */

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
  }
}

.animate-shake {
  animation: shake 500ms var(--ease-sharp);
}

/* ===== LOADING ANIMATIONS ===== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(
    90deg,
    var(--slate-100) 0%,
    var(--slate-50) 50%,
    var(--slate-100) 100%
  );
  background-size: 1000px 100%;
}

/* Dot loading animation */
@keyframes dot-flashing {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

.loading-dot {
  animation: dot-flashing 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0s;
}

/* ===== STAGGERED ANIMATIONS ===== */

.stagger-1 {
  animation-delay: 100ms;
}

.stagger-2 {
  animation-delay: 200ms;
}

.stagger-3 {
  animation-delay: 300ms;
}

.stagger-4 {
  animation-delay: 400ms;
}

.stagger-5 {
  animation-delay: 500ms;
}

.stagger-6 {
  animation-delay: 600ms;
}

.stagger-7 {
  animation-delay: 700ms;
}

.stagger-8 {
  animation-delay: 800ms;
}

/* ===== PAGE TRANSITIONS ===== */

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.page-enter {
  animation: page-enter var(--duration-300) var(--ease-out);
}

.page-exit {
  animation: page-exit var(--duration-200) var(--ease-in);
}

/* ===== MICRO-INTERACTIONS ===== */

/* Hover lift effect */
.hover-lift {
  transition: transform var(--duration-200) var(--ease-out),
              box-shadow var(--duration-200) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Icon bounce on hover */
.icon-bounce:hover svg {
  animation: bounce 500ms var(--ease-sharp);
}

/* Focus ring animation */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--navy-100),
              0 0 0 5px var(--navy-500);
  transition: box-shadow var(--duration-150) var(--ease-out);
}

/* Button press effect */
.button-press:active {
  transform: scale(0.98);
  transition: transform var(--duration-75) var(--ease-sharp);
}

/* Card shine effect on hover */
@keyframes card-shine {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.card-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 55%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: card-shine 3s infinite;
  opacity: 0;
  transition: opacity var(--duration-300) var(--ease-out);
  pointer-events: none;
}

.card-shine:hover::before {
  opacity: 1;
}

/* ===== ACCESSIBILITY: RESPECT MOTION PREFERENCES ===== */

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

/* ===== TRANSITION UTILITIES ===== */

.transition-all {
  transition: all var(--duration-200) var(--ease-out);
}

.transition-transform {
  transition: transform var(--duration-200) var(--ease-out);
}

.transition-opacity {
  transition: opacity var(--duration-200) var(--ease-out);
}

.transition-colors {
  transition: color var(--duration-200) var(--ease-out),
              background-color var(--duration-200) var(--ease-out),
              border-color var(--duration-200) var(--ease-out);
}

.transition-shadow {
  transition: box-shadow var(--duration-200) var(--ease-out);
}

.duration-75 {
  transition-duration: 75ms;
}

.duration-100 {
  transition-duration: 100ms;
}

.duration-150 {
  transition-duration: 150ms;
}

.duration-200 {
  transition-duration: 200ms;
}

.duration-300 {
  transition-duration: 300ms;
}

.duration-500 {
  transition-duration: 500ms;
}

.duration-700 {
  transition-duration: 700ms;
}

/* ===== RESPONSIVE UTILITIES ===== */

/* Responsive grid layouts */
.responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.responsive-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.responsive-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* Mobile: Stack everything */
@media (max-width: 767px) {
  .responsive-grid,
  .responsive-grid-2,
  .responsive-grid-3 {
    grid-template-columns: 1fr;
  }

  .two-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .responsive-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3+ columns */
@media (min-width: 1024px) {
  .responsive-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .responsive-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }

  /* Show only on mobile */
  .show-mobile {
    display: block !important;
  }
}

/* Hide on tablet and up */
@media (min-width: 768px) {
  .show-mobile {
    display: none !important;
  }

  .hide-mobile {
    display: block !important;
  }
}

/* Show on mobile only */
@media (min-width: 768px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* Responsive text sizes */
@media (max-width: 767px) {
  .text-responsive-xl {
    font-size: var(--text-xl);
  }

  .text-responsive-2xl {
    font-size: var(--text-xl);
  }

  .text-responsive-3xl {
    font-size: var(--text-2xl);
  }
}

/* Responsive spacing */
@media (max-width: 767px) {
  .responsive-spacing {
    padding: var(--space-4);
    gap: var(--space-3);
  }
}

/* Responsive container */
@media (max-width: 767px) {
  .container-responsive {
    padding: 0 var(--space-3);
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .container-responsive {
    padding: 0 var(--space-6);
    max-width: 768px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .container-responsive {
    padding: 0 var(--space-8);
    max-width: 1024px;
  }
}

/* ===== DARK MODE - DISABLED ===== */
/* @media (prefers-color-scheme: dark) {
  :root {
    --slate-50:   #0f172a;
    --slate-100:  #1e293b;
    --slate-200:  #334155;
    --slate-300:  #475569;
    --slate-700:  #f1f5f9;
    --slate-800:  #e2e8f0;
    --slate-900:  #f8fafc;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:  0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg:  0 10px 15px rgba(0, 0, 0, 0.5);
  }

  body {
    background: var(--slate-900);
    color: var(--slate-300);
  }

  .card {
    background: var(--slate-800);
    border-color: var(--slate-700);
  }
} */
