/* ==================== DAPURDIGITAL - PREMIUM APPLE DESIGN SYSTEM ==================== */
/* Comprehensive CSS with Full Element Support */
/* Apple-style Design Language with Enhanced UX Structure */

/* ==================== MODERN APPLE DESIGN SYSTEM ==================== */
:root {
  /* Apple Color System - Enhanced Soft Palette */
  --system-blue: #0EA5E9;      /* Tosca cerah */
  --system-blue-light: #38BDF8; /* Tosca muda */
  --system-green: #10B981;      /* Hijau tosca */
  --system-indigo: #5856D6;
  --system-orange: #F97316;     /* Oranye keemasan */
  --system-purple: #8B5CF6;     /* Ungu tosca */
  --system-red: #FF3B30;
  --system-teal: #5AC8FA;
  --system-pink: #FF2D55;
  --system-yellow: #FFCC00;

  /* Surface Colors - Premium Light Theme */
  --surface-primary: #FFFFFF;              /* Clean white background */
  --surface-secondary: #F5F5F7;            /* Cards, sections */
  --surface-tertiary: #FAFAFC;             /* Subtle backgrounds */
  --surface-floating: #FFFFFF;             /* Floating elements */
  --surface-overlay: rgba(0, 0, 0, 0.4);   /* Modal overlays */

  /* Label System - Enhanced Legibility */
  --label-primary: #000000;
  --label-secondary: #3C3C43BF;           /* 75% opacity */
  --label-tertiary: #3C3C4399;            /* 60% opacity */
  --label-quaternary: #3C3C4366;          /* 40% opacity */
  --label-inverse: #FFFFFF;

  /* Fill Colors - Subtle interactions */
  --fill-primary: #7676805C;              /* 35% opacity */
  --fill-secondary: #78788033;            /* 20% opacity */
  --fill-tertiary: #7878801F;             /* 12% opacity */
  --fill-quaternary: #78788014;           /* 8% opacity */

  /* Typography System - SF Pro Display Focus */
  --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-weight-ultra-light: 100;
  --font-weight-thin: 200;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-heavy: 800;

  /* Spacing System - Enhanced Apple Style */
  --spacing-0: 0px;
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-7: 28px;
  --spacing-8: 32px;
  --spacing-9: 36px;
  --spacing-10: 40px;
  --spacing-11: 44px;
  --spacing-12: 48px;
  --spacing-14: 56px;
  --spacing-16: 64px;
  --spacing-20: 80px;
  --spacing-24: 96px;
  --spacing-28: 112px;
  --spacing-32: 128px;

  /* Radius System - Modern Smooth Corners */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;

  /* Shadow System - Premium Light Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.03);

  /* Transition System - Smooth Apple-style */
  --transition-fast: cubic-bezier(0.4, 0, 0.2, 1) 150ms;
  --transition-normal: cubic-bezier(0.4, 0, 0.2, 1) 300ms;
  --transition-slow: cubic-bezier(0.4, 0, 0.2, 1) 500ms;
  --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55) 600ms;

  /* Z-index System - Layer Management */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Breakpoints - Enhanced Responsive */
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;

  /* Device Safe Areas */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

/* ==================== BASE RESET & TYPOGRAPHY ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  max-width: 100vw;
  overflow-x: hidden;
  padding-left: var(--safe-area-left);
  padding-right: var(--safe-area-right);
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  color: var(--label-primary);
  background-color: var(--surface-primary);
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Text Selection Enhancement */
::selection {
  background: var(--system-blue);
  color: white;
}

/* ==================== TYPOGRAPHY SCALE ==================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  margin: 0 0 var(--spacing-2);
  color: var(--label-primary);
}

/* Premium Typography Scale */
.text-display-1 {
  font-size: 3rem; /* 48px */
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.8px;
  line-height: 1.1;
}

.text-display-2 {
  font-size: 2.5rem; /* 40px */
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.text-display-3 {
  font-size: 2rem; /* 32px */
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.3px;
}

.text-headline-1 {
  font-size: 1.75rem; /* 28px */
  font-weight: var(--font-weight-semibold);
}

.text-headline-2 {
  font-size: 1.5rem; /* 24px */
  font-weight: var(--font-weight-semibold);
}

.text-headline-3 {
  font-size: 1.25rem; /* 20px */
  font-weight: var(--font-weight-semibold);
}

.text-title {
  font-size: 1.125rem; /* 18px */
  font-weight: var(--font-weight-medium);
}

.text-body-1 {
  font-size: 1rem; /* 16px */
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
}

.text-body-2 {
  font-size: 0.875rem; /* 14px */
  font-weight: var(--font-weight-regular);
  line-height: 1.43;
}

.text-callout {
  font-size: 0.9375rem; /* 15px */
  font-weight: var(--font-weight-medium);
}

.text-subhead {
  font-size: 0.875rem; /* 14px */
  font-weight: var(--font-weight-semibold);
}

.text-footnote {
  font-size: 0.8125rem; /* 13px */
  font-weight: var(--font-weight-medium);
}

.text-caption-1 {
  font-size: 0.75rem; /* 12px */
  font-weight: var(--font-weight-medium);
}

.text-caption-2 {
  font-size: 0.6875rem; /* 11px */
  font-weight: var(--font-weight-medium);
}

.text-overline {
  font-size: 0.75rem; /* 12px */
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Text Transform */
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

/* Text Decoration */
.text-underline { text-decoration: underline; }
.text-line-through { text-decoration: line-through; }
.text-no-underline { text-decoration: none; }

/* Color Utilities */
.text-primary { color: var(--label-primary); }
.text-secondary { color: var(--label-secondary); }
.text-tertiary { color: var(--label-tertiary); }
.text-quaternary { color: var(--label-quaternary); }
.text-inverse { color: var(--label-inverse); }
.text-blue { color: var(--system-blue); }
.text-green { color: var(--system-green); }
.text-red { color: var(--system-red); }
.text-orange { color: var(--system-orange); }

/* Background Utilities */
.bg-primary { background-color: var(--surface-primary); }
.bg-secondary { background-color: var(--surface-secondary); }
.bg-tertiary { background-color: var(--surface-tertiary); }
.bg-floating { background-color: var(--surface-floating); }
.bg-blue { background-color: var(--system-blue); }
.bg-green { background-color: var(--system-green); }
.bg-red { background-color: var(--system-red); }

/* ==================== LAYOUT SYSTEM ==================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(var(--spacing-2) * -1);
}

.col {
  flex: 1 0 0%;
  padding: 0 var(--spacing-2);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-4);
}

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

/* Flexbox System */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.self-stretch { align-self: stretch; }

/* Gap System */
.gap-0 { gap: var(--spacing-0); }
.gap-1 { gap: var(--spacing-1); }
.gap-2 { gap: var(--spacing-2); }
.gap-3 { gap: var(--spacing-3); }
.gap-4 { gap: var(--spacing-4); }
.gap-5 { gap: var(--spacing-5); }
.gap-6 { gap: var(--spacing-6); }
.gap-8 { gap: var(--spacing-8); }
.gap-10 { gap: var(--spacing-10); }

/* Spacing System */
.m-0 { margin: 0; }
.m-1 { margin: var(--spacing-1); }
.m-2 { margin: var(--spacing-2); }
.m-3 { margin: var(--spacing-3); }
.m-4 { margin: var(--spacing-4); }
.m-5 { margin: var(--spacing-5); }
.m-6 { margin: var(--spacing-6); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: var(--spacing-1); margin-bottom: var(--spacing-1); }
.my-2 { margin-top: var(--spacing-2); margin-bottom: var(--spacing-2); }
.my-3 { margin-top: var(--spacing-3); margin-bottom: var(--spacing-3); }
.my-4 { margin-top: var(--spacing-4); margin-bottom: var(--spacing-4); }
.my-5 { margin-top: var(--spacing-5); margin-bottom: var(--spacing-5); }
.my-6 { margin-top: var(--spacing-6); margin-bottom: var(--spacing-6); }

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

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--spacing-1); padding-right: var(--spacing-1); }
.px-2 { padding-left: var(--spacing-2); padding-right: var(--spacing-2); }
.px-3 { padding-left: var(--spacing-3); padding-right: var(--spacing-3); }
.px-4 { padding-left: var(--spacing-4); padding-right: var(--spacing-4); }
.px-5 { padding-left: var(--spacing-5); padding-right: var(--spacing-5); }
.px-6 { padding-left: var(--spacing-6); padding-right: var(--spacing-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--spacing-1); padding-bottom: var(--spacing-1); }
.py-2 { padding-top: var(--spacing-2); padding-bottom: var(--spacing-2); }
.py-3 { padding-top: var(--spacing-3); padding-bottom: var(--spacing-3); }
.py-4 { padding-top: var(--spacing-4); padding-bottom: var(--spacing-4); }
.py-5 { padding-top: var(--spacing-5); padding-bottom: var(--spacing-5); }
.py-6 { padding-top: var(--spacing-6); padding-bottom: var(--spacing-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-1); }
.mt-2 { margin-top: var(--spacing-2); }
.mt-3 { margin-top: var(--spacing-3); }
.mt-4 { margin-top: var(--spacing-4); }
.mt-5 { margin-top: var(--spacing-5); }
.mt-6 { margin-top: var(--spacing-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-1); }
.mb-2 { margin-bottom: var(--spacing-2); }
.mb-3 { margin-bottom: var(--spacing-3); }
.mb-4 { margin-bottom: var(--spacing-4); }
.mb-5 { margin-bottom: var(--spacing-5); }
.mb-6 { margin-bottom: var(--spacing-6); }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Display Items */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* Sizing */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

.min-h-screen { min-height: 100vh; }
.min-h-0 { min-height: 0; }

.max-w-full { max-width: 100%; }
.max-w-screen { max-width: 100vw; }

.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }

/* Float */
.float-left { float: left; }
.float-right { float: right; }
.float-none { float: none; }

.clear-left { clear: left; }
.clear-right { clear: right; }
.clear-both { clear: both; }

/* Object Fit */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }
.object-scale-down { object-fit: scale-down; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ==================== BUTTON SYSTEM ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  padding: 0 var(--spacing-4);
  font-family: var(--font-family);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:focus {
  outline: none;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--system-blue) 0%, #0A84FF 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--system-blue-light) 0%, #3D8DFF 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.btn-secondary {
  background: var(--surface-secondary);
  color: var(--label-primary);
  border: 1px solid var(--surface-quaternary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-tertiary);
  box-shadow: var(--shadow-md);
}

.btn-secondary:active:not(:disabled) {
  background: var(--surface-secondary);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--system-blue);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--fill-secondary);
}

.btn-ghost:active:not(:disabled) {
  background: var(--fill-tertiary);
}

.btn-destructive {
  background: var(--system-red);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-destructive:hover:not(:disabled) {
  background: #FF453A;
  box-shadow: var(--shadow-lg);
}

.btn-destructive:active:not(:disabled) {
  background: var(--system-red);
  box-shadow: var(--shadow-md);
}

/* Button Sizes */
.btn-xs {
  padding: var(--spacing-1) var(--spacing-2);
  font-size: var(--text-footnote);
  min-height: 28px;
  border-radius: var(--radius-full);
}

.btn-sm {
  padding: var(--spacing-1) var(--spacing-3);
  font-size: var(--text-callout);
  min-height: 32px;
  border-radius: var(--radius-full);
}

.btn-md {
  padding: var(--spacing-2) var(--spacing-4);
  font-size: var(--text-callout);
  min-height: 40px;
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: var(--spacing-3) var(--spacing-5);
  font-size: var(--text-body-1);
  min-height: 48px;
  border-radius: var(--radius-full);
}

.btn-xl {
  padding: var(--spacing-4) var(--spacing-6);
  font-size: var(--text-headline-3);
  min-height: 56px;
  border-radius: var(--radius-full);
}

/* Icon Button */
.btn-icon {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.btn-icon.btn-md {
  width: 40px;
  height: 40px;
}

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
}

/* Full Width Button */
.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ==================== CARD SYSTEM ==================== */
.card {
  background: var(--surface-floating);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-quaternary);
  overflow: hidden;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.card-plain {
  background: transparent;
  border: none;
  box-shadow: none;
}

.card-plain:hover {
  transform: none;
  box-shadow: none;
}

.card-primary {
  background: var(--surface-primary);
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-xl);
}

.card-secondary {
  background: var(--surface-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--fill-secondary);
}

.card-floating {
  background: var(--surface-floating);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: none;
}

.card-header {
  padding: var(--spacing-4);
  border-bottom: 1px solid var(--surface-quaternary);
}

.card-body {
  padding: var(--spacing-4);
}

.card-footer {
  padding: var(--spacing-4);
  border-top: 1px solid var(--surface-quaternary);
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
  margin-bottom: var(--spacing-4);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-1);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-footnote);
  color: var(--label-primary);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-3);
  font-size: var(--text-body-1);
  line-height: 1.5;
  color: var(--label-primary);
  background-color: var(--surface-secondary);
  background-clip: padding-box;
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-lg);
  transition: var(--transition-fast);
  min-height: 44px;
}

.form-control:focus {
  color: var(--label-primary);
  background-color: var(--surface-secondary);
  border-color: var(--system-blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.form-control::placeholder {
  color: var(--label-tertiary);
  opacity: 1;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--surface-tertiary);
  opacity: 1;
}

.form-text {
  display: block;
  margin-top: var(--spacing-1);
  font-size: var(--text-footnote);
  color: var(--label-secondary);
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}

.form-check .form-check-input {
  float: left;
  margin-left: -1.5em;
}

.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: var(--surface-primary);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  appearance: none;
  color-adjust: exact;
  transition: var(--transition-fast);
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25em;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:active {
  filter: brightness(90%);
}

.form-check-input:focus {
  border-color: var(--system-blue);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 122, 255, 0.25);
}

.form-check-input:checked {
  background-color: var(--system-blue);
  border-color: var(--system-blue);
}

.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

.form-check-input[type="checkbox"]:indeterminate {
  background-color: var(--system-blue);
  border-color: var(--system-blue);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}

.form-check-input:disabled {
  pointer-events: none;
  filter: none;
  opacity: 0.5;
}

.form-check-input[disabled] ~ .form-check-label,
.form-check-input:disabled ~ .form-check-label {
  cursor: default;
  opacity: 0.5;
}

.form-check-label {
  color: var(--label-primary);
  font-weight: var(--font-weight-regular);
  font-size: var(--text-body-1);
}

textarea.form-control {
  min-height: calc(1.5em + 0.75rem + 2px);
  resize: vertical;
}

.form-select {
  display: block;
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--text-body-1);
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  color: var(--label-primary);
  background-color: var(--surface-secondary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--spacing-3) center;
  background-size: 16px 12px;
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-lg);
  appearance: none;
}

.form-select:focus {
  border-color: var(--system-blue);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 122, 255, 0.25);
}

.form-select:disabled {
  background-color: var(--surface-tertiary);
}

.form-range {
  width: 100%;
  height: 1.5rem;
  padding: 0;
  background-color: transparent;
  appearance: none;
}

.form-range:focus {
  outline: none;
}

.form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px var(--surface-primary), 0 0 0 0.25rem rgba(0, 122, 255, 0.25);
}

.form-range:focus::-moz-range-thumb {
  box-shadow: 0 0 0 1px var(--surface-primary), 0 0 0 0.25rem rgba(0, 122, 255, 0.25);
}

.form-range::-webkit-slider-thumb {
  width: 1rem;
  height: 1rem;
  margin-top: -0.25rem;
  background-color: var(--system-blue);
  border: 0;
  border-radius: 1rem;
  transition: var(--transition-fast);
  appearance: none;
}

.form-range::-webkit-slider-thumb:active {
  background-color: #b3d7ff;
}

.form-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 0.5rem;
  color: transparent;
  cursor: pointer;
  background-color: var(--surface-secondary);
  border-color: transparent;
  border-radius: 1rem;
}

.form-range::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  background-color: var(--system-blue);
  border: 0;
  border-radius: 1rem;
  transition: var(--transition-fast);
  appearance: none;
}

.form-range::-moz-range-thumb:active {
  background-color: #b3d7ff;
}

.form-range::-moz-range-track {
  width: 100%;
  height: 0.5rem;
  color: transparent;
  cursor: pointer;
  background-color: var(--surface-secondary);
  border-color: transparent;
  border-radius: 1rem;
}

/* ==================== MODAL SYSTEM ==================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-modal);
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal-open {
  overflow: hidden;
}

.modal-open .modal {
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: var(--spacing-4);
  pointer-events: none;
  max-width: 500px;
  margin: 1.75rem auto;
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}

.modal-dialog-scrollable {
  height: calc(100% - var(--spacing-8));
}

.modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - var(--spacing-8));
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--surface-floating);
  background-clip: padding-box;
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-2xl);
  outline: 0;
  box-shadow: var(--shadow-2xl);
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-modal-backdrop);
  width: 100vw;
  height: 100vh;
  background-color: var(--surface-overlay);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4) var(--spacing-4);
  border-bottom: 1px solid var(--surface-quaternary);
  border-top-left-radius: calc(var(--radius-2xl) - 1px);
  border-top-right-radius: calc(var(--radius-2xl) - 1px);
}

.modal-header .btn-close {
  padding: calc(var(--spacing-2) * 0.5) var(--spacing-2);
  margin: calc(var(--spacing-2) * -0.5) calc(var(--spacing-2) * -0.5) calc(var(--spacing-2) * -0.5) auto;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-headline-2);
  color: var(--label-primary);
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: var(--spacing-4);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: calc(var(--spacing-4) - var(--spacing-1)) var(--spacing-4);
  border-top: 1px solid var(--surface-quaternary);
  border-bottom-right-radius: calc(var(--radius-2xl) - 1px);
  border-bottom-left-radius: calc(var(--radius-2xl) - 1px);
}

.modal-footer > * {
  margin: calc(var(--spacing-1) * 0.5);
}

@media (max-width: 575.98px) {
  .modal-dialog {
    max-width: calc(100% - var(--spacing-8));
    margin: var(--spacing-4) auto;
  }

  .modal-dialog-scrollable {
    height: calc(100% - var(--spacing-8));
  }

  .modal-dialog-centered {
    min-height: calc(100% - var(--spacing-8));
  }

  .modal-content {
    border-radius: var(--radius-xl);
  }

  .modal-sm {
    max-width: 300px;
  }
}

@media (min-width: 992px) {
  .modal-lg,
  .modal-xl {
    max-width: 800px;
  }
}

@media (min-width: 1200px) {
  .modal-xl {
    max-width: 1140px;
  }
}

.modal-fullscreen {
  width: 100vw;
  max-width: none;
  height: 100%;
  margin: 0;
}

.modal-fullscreen .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.modal-fullscreen .modal-header,
.modal-fullscreen .modal-footer {
  border-radius: 0;
}

.modal-fullscreen .modal-body {
  overflow-y: auto;
}

@media (max-width: 575.98px) {
  .modal-fullscreen-sm-down {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
  }

  .modal-fullscreen-sm-down .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-header,
  .modal-fullscreen-sm-down .modal-footer {
    border-radius: 0;
  }

  .modal-fullscreen-sm-down .modal-body {
    overflow-y: auto;
  }
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-modal-backdrop);
  width: 100vw;
  height: 100vh;
  background-color: var(--surface-overlay);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 1;
}

/* ==================== CHAT COMPONENT SYSTEM ==================== */
.chat-container {
  background: var(--surface-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-quaternary);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 80vh;
  box-shadow: var(--shadow-md);
}

.chat-header {
  padding: var(--spacing-4);
  border-bottom: 1px solid var(--surface-quaternary);
  background: var(--surface-floating);
  border-top-left-radius: calc(var(--radius-xl) - 1px);
  border-top-right-radius: calc(var(--radius-xl) - 1px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-4);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  background: var(--surface-tertiary);
}

.chat-message {
  max-width: 85%;
  padding: var(--spacing-3);
  border-radius: var(--radius-lg);
  animation: fadeInUp 0.3s ease-out;
  position: relative;
  line-height: 1.4;
  font-size: var(--text-body-1);
}

.chat-message.user {
  align-self: flex-end;
  background: var(--system-blue);
  color: white;
  border-bottom-right-radius: var(--radius-xs);
}

.chat-message.assistant {
  align-self: flex-start;
  background: var(--surface-secondary);
  color: var(--label-primary);
  border-bottom-left-radius: var(--radius-xs);
}

.chat-message.system {
  align-self: center;
  background: var(--surface-tertiary);
  color: var(--label-secondary);
  font-size: var(--text-footnote);
  text-align: center;
  max-width: 90%;
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--radius-full);
}

.chat-input-container {
  padding: var(--spacing-4);
  border-top: 1px solid var(--surface-quaternary);
  background: var(--surface-floating);
  border-bottom-left-radius: calc(var(--radius-xl) - 1px);
  border-bottom-right-radius: calc(var(--radius-xl) - 1px);
}

.chat-input-form {
  display: flex;
  gap: var(--spacing-2);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-full);
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--text-body-1);
  background: var(--surface-secondary);
  resize: none;
  min-height: 44px;
  max-height: 120px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--system-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.chat-send-btn {
  background: var(--system-blue);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--system-blue-light);
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-history-list {
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-floating);
  box-shadow: var(--shadow-sm);
}

.chat-history-item {
  padding: var(--spacing-3) var(--spacing-4);
  border-bottom: 1px solid var(--surface-quaternary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: var(--text-callout);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-history-item:last-child {
  border-bottom: none;
}

.chat-history-item:hover {
  background: var(--surface-secondary);
}

.chat-history-item.active {
  background: var(--surface-secondary);
  border-left: 3px solid var(--system-blue);
}

.chat-history-title {
  font-weight: var(--font-weight-medium);
  color: var(--label-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-date {
  font-size: var(--text-caption-1);
  color: var(--label-tertiary);
  margin: 0;
}

/* ==================== RECIPE COMPONENTS ==================== */
.recipe-display {
  background: var(--surface-floating);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-quaternary);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.recipe-header {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.recipe-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-normal);
}

.recipe-image-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, var(--surface-secondary) 0%, var(--surface-tertiary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-secondary);
}

.recipe-content {
  padding: var(--spacing-5);
}

.recipe-title {
  font-size: var(--text-display-3);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-2);
  line-height: 1.2;
  color: var(--label-primary);
}

.recipe-description {
  color: var(--label-secondary);
  margin-bottom: var(--spacing-4);
  line-height: 1.5;
  font-size: var(--text-body-1);
}

.recipe-tabs {
  display: flex;
  border-bottom: 1px solid var(--surface-quaternary);
  margin-bottom: var(--spacing-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.recipe-tabs::-webkit-scrollbar {
  display: none;
}

.recipe-tab {
  padding: var(--spacing-3) var(--spacing-4);
  font-weight: var(--font-weight-medium);
  color: var(--label-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.recipe-tab:hover {
  color: var(--label-primary);
}

.recipe-tab.active {
  color: var(--system-blue);
  border-bottom-color: var(--system-blue);
}

.recipe-tab-content {
  animation: fadeIn 0.3s ease-out;
}

.recipe-section-title {
  font-size: var(--text-headline-2);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-3);
  color: var(--label-primary);
}

.recipe-ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-ingredient-item {
  padding: var(--spacing-2) 0;
  border-bottom: 1px solid var(--surface-quaternary);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.recipe-ingredient-item:last-child {
  border-bottom: none;
}

.recipe-ingredient-name {
  flex: 1;
  font-size: var(--text-body-1);
  color: var(--label-primary);
}

.recipe-ingredient-quantity {
  color: var(--label-secondary);
  font-size: var(--text-callout);
  font-weight: var(--font-weight-medium);
}

.recipe-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
}

.recipe-step-item {
  padding: var(--spacing-3) 0;
  border-bottom: 1px solid var(--surface-quaternary);
  position: relative;
  padding-left: calc(var(--spacing-6) + var(--spacing-2));
}

.recipe-step-item:last-child {
  border-bottom: none;
}

.recipe-step-item::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  position: absolute;
  left: 0;
  top: var(--spacing-3);
  width: var(--spacing-6);
  height: var(--spacing-6);
  background: var(--system-blue);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-footnote);
}

.recipe-step-content {
  color: var(--label-primary);
  line-height: 1.5;
  font-size: var(--text-body-1);
}

.recipe-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recipe-tip-item {
  padding: var(--spacing-3) var(--spacing-4);
  background: var(--surface-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-2);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3);
}

.recipe-tip-item:last-child {
  margin-bottom: 0;
}

.recipe-tip-icon {
  color: var(--system-green);
  flex-shrink: 0;
  margin-top: var(--spacing-1);
}

.recipe-tip-content {
  color: var(--label-primary);
  line-height: 1.5;
  font-size: var(--text-body-1);
}

.recipe-actions {
  display: flex;
  gap: var(--spacing-3);
  margin-top: var(--spacing-5);
  flex-wrap: wrap;
}

.recipe-action-btn {
  flex: 1;
  min-width: 120px;
}

@media (max-width: 768px) {
  .recipe-header {
    height: 250px;
  }

  .recipe-content {
    padding: var(--spacing-4);
  }

  .recipe-title {
    font-size: var(--text-headline-1);
  }

  .recipe-actions {
    flex-direction: column;
  }

  .recipe-action-btn {
    width: 100%;
  }
}

/* ==================== DASHBOARD COMPONENTS ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-6);
  margin-bottom: var(--spacing-6);
}

.dashboard-card {
  background: var(--surface-floating);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-quaternary);
  padding: var(--spacing-5);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

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

.dashboard-card-header {
  margin-bottom: var(--spacing-4);
}

.dashboard-card-title {
  font-size: var(--text-headline-3);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-1);
  color: var(--label-primary);
}

.dashboard-card-subtitle {
  font-size: var(--text-body-2);
  color: var(--label-secondary);
  margin: 0;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-6);
}

.dashboard-stat-card {
  background: var(--surface-floating);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  text-align: center;
  border: 1px solid var(--surface-quaternary);
}

.dashboard-stat-value {
  font-size: var(--text-display-2);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-1);
  color: var(--label-primary);
}

.dashboard-stat-label {
  font-size: var(--text-footnote);
  color: var(--label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.3s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.3s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out forwards;
}

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

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

/* Delayed Animations */
.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }

/* ==================== UTILITY CLASSES ==================== */
/* Border Radius */
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-xs { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-inner { box-shadow: var(--shadow-inner); }

/* Cursors */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-wait { cursor: wait; }
.cursor-move { cursor: move; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* User Select */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }
.select-auto { user-select: auto; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Resize */
.resize-none { resize: none; }
.resize-y { resize: vertical; }
.resize-x { resize: horizontal; }
.resize { resize: both; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-x-visible { overflow-x: visible; }
.overflow-x-scroll { overflow-x: scroll; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-hidden { overflow-y: hidden; }
.overflow-y-visible { overflow-y: visible; }
.overflow-y-scroll { overflow-y: scroll; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Aspect Ratio */
.aspect-auto { aspect-ratio: auto; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }

/* Object Position */
.object-top { object-position: top; }
.object-bottom { object-position: bottom; }
.object-center { object-position: center; }
.object-left { object-position: left; }
.object-right { object-position: right; }

/* Z Index */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ==================== SCROLLBAR CUSTOMIZATION ==================== */
/* Webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--fill-secondary);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fill-primary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--fill-secondary) var(--surface-secondary);
}

/* ==================== ACCESSIBILITY ==================== */
/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Visible - Enhanced */
.focus-visible {
  outline: 2px solid var(--system-blue);
  outline-offset: 2px;
}

.focus-visible-secondary {
  outline: 2px solid var(--system-green);
  outline-offset: 2px;
}

.focus-visible-destructive {
  outline: 2px solid var(--system-red);
  outline-offset: 2px;
}

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

  .animate-fade-in,
  .animate-fade-in-up,
  .animate-fade-in-down,
  .animate-scale-in,
  .animate-slide-in-left,
  .animate-slide-in-right {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --label-primary: #000000;
    --label-secondary: #3C3C43E6; /* 90% opacity */
    --label-tertiary: #3C3C43CC;  /* 80% opacity */
    --surface-secondary: #F2F2F7;
    --surface-quaternary: #D1D1D6;
  }

  .btn-primary {
    background: var(--system-blue);
  }

  .btn-secondary {
    background: var(--surface-secondary);
    border: 2px solid var(--label-primary);
  }

  .card {
    border: 2px solid var(--label-primary);
  }
}

/* Inverted Colors */
@media (prefers-contrast: forced) {
  :root {
    --surface-primary: Canvas;
    --surface-secondary: ButtonFace;
    --label-primary: CanvasText;
    --label-secondary: GrayText;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .card {
    border: 1px solid black;
    box-shadow: none;
  }

  .btn {
    border: 1px solid black;
    background: white;
    color: black;
  }
}

/* ==================== DARK MODE SUPPORT (Future Ready) ==================== */
@media (prefers-color-scheme: dark) {
  :root {
    --surface-primary: #000000;
    --surface-secondary: #1C1C1E;
    --surface-tertiary: #2C2C2E;
    --surface-floating: #1C1C1E;
    --surface-overlay: rgba(0, 0, 0, 0.6);

    --label-primary: #FFFFFF;
    --label-secondary: #EBEBF599; /* 60% opacity */
    --label-tertiary: #EBEBF580;  /* 50% opacity */
    --label-quaternary: #EBEBF566; /* 40% opacity */
    --label-inverse: #000000;

    --surface-quaternary: #48484A;
    --fill-primary: #7878805C;    /* 35% opacity */
    --fill-secondary: #78788033;  /* 20% opacity */
    --fill-tertiary: #7878801F;   /* 12% opacity */
    --fill-quaternary: #78788014; /* 8% opacity */
  }

  .modal-content {
    background: var(--surface-floating);
    border: 1px solid var(--surface-quaternary);
  }

  .card {
    background: var(--surface-floating);
    border: 1px solid var(--surface-quaternary);
  }

  .form-control {
    background: var(--surface-secondary);
    border: 1px solid var(--surface-quaternary);
    color: var(--label-primary);
  }

  .form-control:focus {
    border-color: var(--system-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
  }

  .chat-message.user {
    background: var(--system-blue);
    color: var(--label-inverse);
  }

  .chat-message.assistant {
    background: var(--surface-secondary);
    color: var(--label-primary);
  }

  img {
    filter: brightness(0.9) contrast(1.1);
  }
}

/* ==================== MOBILE RESPONSIVE FIXES ==================== */
/* Prevent zoom on focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px; /* Prevent iOS zoom */
  }

  /* Fix viewport units for mobile browsers */
  .vh-100 {
    height: 100vh;
    height: -webkit-fill-available;
  }

  .min-vh-100 {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* Safe area insets for mobile devices */
@supports (padding: max(0px)) {
  .safe-top { padding-top: max(var(--safe-area-top), var(--spacing-4)); }
  .safe-bottom { padding-bottom: max(var(--safe-area-bottom), var(--spacing-4)); }
  .safe-left { padding-left: max(var(--safe-area-left), var(--spacing-4)); }
  .safe-right { padding-right: max(var(--safe-area-right), var(--spacing-4)); }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* Contain layout, style, paint for better performance */
.card,
.btn,
.modal,
.chat-container,
.recipe-display {
  contain: layout style paint;
}

/* Will-change for animations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Hardware acceleration */
.accelerate {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ==================== CUSTOM COMPONENTS ==================== */
/* Notification System */
.notification {
  position: fixed;
  top: var(--spacing-4);
  right: var(--spacing-4);
  padding: var(--spacing-3) var(--spacing-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  max-width: 320px;
  animation: fadeInDown 0.3s ease-out;
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3);
  background: var(--surface-floating);
  border: 1px solid var(--surface-quaternary);
}

.notification.success {
  border-left: 4px solid var(--system-green);
}

.notification.error {
  border-left: 4px solid var(--system-red);
}

.notification.warning {
  border-left: 4px solid var(--system-orange);
}

.notification.info {
  border-left: 4px solid var(--system-blue);
}

.notification-icon {
  flex-shrink: 0;
  margin-top: var(--spacing-1);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-1);
  font-size: var(--text-callout);
  color: var(--label-primary);
}

.notification-message {
  margin: 0;
  font-size: var(--text-body-2);
  color: var(--label-secondary);
}

.notification-close {
  background: none;
  border: none;
  color: var(--label-tertiary);
  cursor: pointer;
  padding: var(--spacing-1);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.notification-close:hover {
  background: var(--fill-secondary);
  color: var(--label-primary);
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: var(--spacing-4);
  height: var(--spacing-4);
  border: 2px solid var(--fill-secondary);
  border-top: 2px solid var(--system-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.sm {
  width: var(--spacing-3);
  height: var(--spacing-3);
}

.spinner.lg {
  width: var(--spacing-6);
  height: var(--spacing-6);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress Bar */
.progress {
  height: var(--spacing-2);
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--system-blue);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-bar.success {
  background: var(--system-green);
}

.progress-bar.warning {
  background: var(--system-orange);
}

.progress-bar.error {
  background: var(--system-red);
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-2);
  font-size: var(--text-caption-1);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
  vertical-align: baseline;
}

.badge-primary {
  background: var(--system-blue);
  color: white;
}

.badge-secondary {
  background: var(--surface-secondary);
  color: var(--label-primary);
}

.badge-success {
  background: var(--system-green);
  color: white;
}

.badge-warning {
  background: var(--system-orange);
  color: white;
}

.badge-error {
  background: var(--system-red);
  color: white;
}

.badge-neutral {
  background: var(--fill-secondary);
  color: var(--label-primary);
}

/* Chip Component */
.chip {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  background: var(--surface-secondary);
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-full);
  font-size: var(--text-footnote);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.chip:hover {
  background: var(--surface-tertiary);
}

.chip.selected {
  background: var(--system-blue);
  color: white;
  border-color: var(--system-blue);
}

.chip.selected:hover {
  background: var(--system-blue-light);
}

/* Divider Component */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--label-tertiary);
  font-size: var(--text-footnote);
  margin: var(--spacing-4) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--surface-quaternary);
}

.divider:not(:empty)::before {
  margin-right: var(--spacing-2);
}

.divider:not(:empty)::after {
  margin-left: var(--spacing-2);
}

/* Empty State Component */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-8) var(--spacing-4);
  color: var(--label-secondary);
}

.empty-state-icon {
  margin-bottom: var(--spacing-4);
  color: var(--label-tertiary);
}

.empty-state-title {
  font-size: var(--text-headline-2);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-2);
  color: var(--label-primary);
}

.empty-state-description {
  margin-bottom: var(--spacing-4);
  max-width: 400px;
  line-height: 1.5;
}

/* ==================== FINAL OVERRIDES & CLEANUP ==================== */
/* Prevent font boosting in mobile browsers */
* {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Optimize image rendering */
img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

img.emoji {
  display: inline-block;
  border-radius: 0;
}

/* Selection color enhancement */
::selection {
  background-color: rgba(0, 122, 255, 0.3);
  color: var(--label-primary);
}

/* Input placeholder enhancement */
::-webkit-input-placeholder {
  color: var(--label-tertiary);
}

::-moz-placeholder {
  color: var(--label-tertiary);
}

:-ms-input-placeholder {
  color: var(--label-tertiary);
}

::-ms-input-placeholder {
  color: var(--label-tertiary);
}

::placeholder {
  color: var(--label-tertiary);
  opacity: 1;
}

/* Textarea auto-resize */
textarea {
  resize: vertical;
  min-height: 100px;
}

textarea[rows] {
  height: auto;
}

/* File input styling */
input[type="file"] {
  display: block;
  width: 100%;
}

input[type="file"]::-webkit-file-upload-button {
  background: var(--surface-secondary);
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-md);
  padding: var(--spacing-2) var(--spacing-3);
  color: var(--label-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--surface-tertiary);
}

/* Range input styling */
input[type="range"] {
  width: 100%;
  height: var(--spacing-2);
  padding: 0;
  background-color: transparent;
  appearance: none;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: var(--spacing-4);
  height: var(--spacing-4);
  background: var(--system-blue);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: var(--spacing-1);
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
}

/* ==================== COMPATIBILITY ENHANCEMENTS ==================== */
/* IE11 Support */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .grid {
    display: -ms-grid;
  }

  .flex {
    display: -ms-flexbox;
  }

  .hidden\@ie {
    display: none;
  }
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
  .btn {
    -webkit-appearance: none;
  }

  .form-control {
    -webkit-appearance: none;
  }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
  .btn {
    border: none;
  }

  .form-control {
    border: 1px solid var(--surface-quaternary);
  }
}

/* ==================== DEBUGGING HELPERS ==================== */
/* Uncomment for debugging layout issues */
/*
.debug * {
  outline: 1px solid red;
}

.debug-grid {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}
*/

/* ==================== FINAL BODY SETUP ==================== */
body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  color: var(--label-primary);
  background-color: var(--surface-primary);
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent body from horizontal overflow */
body {
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding-left: max(var(--safe-area-left), 0px);
  padding-right: max(var(--safe-area-right), 0px);
}

/* Ensure full viewport height */
html, body {
  height: 100%;
}

/* ==================== BU MAYA PREFERENCE MODAL ==================== */
/* Integrated with Apple Design System - Premium UX Experience */

/* Modal Variables - Apple Style Integration */
.preference-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4);
  animation: fadeIn 0.3s ease-out;
}

.preference-modal-container {
  background: var(--surface-floating);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-2xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--surface-quaternary);
}

/* Modal Header - Premium Gradient */
.preference-modal-header {
  background: linear-gradient(135deg, var(--system-orange) 0%, var(--system-green) 100%);
  color: var(--label-inverse);
  padding: var(--spacing-5) var(--spacing-5) var(--spacing-4);
  position: relative;
}

.modal-header-content {
  text-align: center;
}

.modal-icon-container {
  width: 4rem;
  height: 4rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-3);
}

.modal-icon {
  width: 2rem;
  height: 2rem;
  color: var(--label-inverse);
}

.modal-title {
  font-size: var(--text-headline-1);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--spacing-2);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: var(--text-body-1);
  opacity: 0.9;
  margin: 0;
  font-weight: var(--font-weight-regular);
}

/* Progress System - Apple Style */
.progress-container {
  margin-top: var(--spacing-4);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-footnote);
  margin-bottom: var(--spacing-2);
  color: rgba(255, 255, 255, 0.9);
}

.progress-bar-container {
  width: 100%;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--label-inverse);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Content - Enhanced Scrolling */
.preference-modal-content {
  padding: var(--spacing-5);
  flex: 1;
  overflow-y: auto;
  background: var(--surface-primary);
}

/* Step Navigation */
.preference-step {
  animation: fadeInUp 0.4s ease-out;
  min-height: 300px;
}

/* Step Headers - Premium Icons */
.step-header {
  text-align: center;
  margin-bottom: var(--spacing-5);
}

.step-icon-container {
  width: 5rem;
  height: 5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-4);
}

.step-icon-container.step-icon-primary {
  background: linear-gradient(135deg, var(--system-orange) 0%, var(--system-green) 100%);
}

.step-icon-container.step-icon-taste {
  background: linear-gradient(135deg, var(--system-red) 0%, var(--system-orange) 100%);
}

.step-icon-container.step-icon-safety {
  background: linear-gradient(135deg, var(--system-red) 0%, var(--system-pink) 100%);
}

.step-icon-container.step-icon-profile {
  background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
}

.step-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--label-inverse);
}

.step-title {
  font-size: var(--text-headline-2);
  font-weight: var(--font-weight-bold);
  color: var(--label-primary);
  margin: 0 0 var(--spacing-2);
}

.step-description {
  color: var(--label-secondary);
  font-size: var(--text-body-1);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 500px;
}

/* Benefits Section - Highlighted */
.benefits-container {
  background: linear-gradient(135deg, var(--surface-secondary) 0%, var(--surface-tertiary) 100%);
  border-radius: var(--radius-xl);
  padding: var(--spacing-4);
  margin-bottom: var(--spacing-4);
  border: 1px solid var(--surface-quaternary);
}

.benefits-title {
  font-weight: var(--font-weight-bold);
  color: var(--label-primary);
  margin: 0 0 var(--spacing-3);
  display: flex;
  align-items: center;
  font-size: var(--text-title);
}

.benefits-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--system-orange);
  margin-right: var(--spacing-2);
}

.benefits-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  color: var(--label-primary);
  font-size: var(--text-body-1);
  line-height: 1.4;
}

.benefit-icon {
  width: 1rem;
  height: 1rem;
  color: var(--system-green);
  margin-right: var(--spacing-2);
  flex-shrink: 0;
  margin-top: var(--spacing-1);
}

/* Preference Grid System - Responsive */
.preference-grid {
  display: grid;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-4);
}

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

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

@media (min-width: 768px) {
  .preference-grid.preference-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Preference Cards - Premium Interaction */
.preference-option {
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
}

.preference-option:focus-visible {
  outline: 2px solid var(--system-blue);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.preference-input {
  display: none;
}

.preference-card {
  background: var(--surface-floating);
  border: 2px solid var(--surface-quaternary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-3);
  text-align: center;
  transition: var(--transition-fast);
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.preference-card:hover {
  border-color: var(--system-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.preference-input:checked + .preference-card {
  border-color: var(--system-blue);
  background: var(--surface-secondary);
  box-shadow: var(--shadow-md);
  transform: scale(1.02);
}

.preference-input:checked + .preference-card .preference-name {
  color: var(--system-blue);
  font-weight: var(--font-weight-bold);
}

.preference-card-large {
  padding: var(--spacing-4);
  min-height: 100px;
}

.preference-card-medium {
  padding: var(--spacing-3);
  min-height: 80px;
}

.preference-card-small {
  padding: var(--spacing-2);
  min-height: 60px;
}

.preference-card-none:hover {
  border-color: var(--system-green);
}

.preference-input:checked + .preference-card-none {
  border-color: var(--system-green);
  background: var(--surface-secondary);
}

/* Card Content Styling */
.preference-emoji {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-2);
}

.preference-card-large .preference-emoji {
  font-size: 2rem;
  margin-bottom: var(--spacing-2);
}

.preference-card-small .preference-emoji {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-1);
}

.preference-name {
  font-weight: var(--font-weight-semibold);
  color: var(--label-primary);
  margin-bottom: var(--spacing-1);
  font-size: var(--text-callout);
}

.preference-desc {
  font-size: var(--text-caption-1);
  color: var(--label-secondary);
  margin: 0;
  line-height: 1.3;
}

/* Sections Organization */
.preference-section {
  margin-bottom: var(--spacing-5);
}

.preference-section:last-child {
  margin-bottom: 0;
}

.section-title {
  font-weight: var(--font-weight-bold);
  color: var(--label-primary);
  margin: 0 0 var(--spacing-3);
  font-size: var(--text-title);
}

.profile-section {
  margin-bottom: var(--spacing-4);
}

.cooking-profile-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

/* Custom Input Fields - Enhanced */
.custom-input-container {
  margin-bottom: var(--spacing-4);
}

.custom-input-label {
  display: block;
  font-size: var(--text-footnote);
  font-weight: var(--font-weight-medium);
  color: var(--label-primary);
  margin-bottom: var(--spacing-2);
}

.custom-input {
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  border: 1px solid var(--surface-quaternary);
  border-radius: var(--radius-lg);
  font-size: var(--text-body-1);
  color: var(--label-primary);
  background: var(--surface-secondary);
  transition: var(--transition-fast);
  min-height: 44px;
}

.custom-input:focus {
  outline: none;
  border-color: var(--system-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  background: var(--surface-floating);
}

.custom-input::placeholder {
  color: var(--label-tertiary);
}

/* Info Notice - Guidance */
.info-notice {
  background: var(--surface-secondary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-3);
  margin-top: var(--spacing-2);
  border: 1px solid var(--surface-quaternary);
}

.info-notice-text {
  color: var(--label-secondary);
  font-size: var(--text-footnote);
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.info-icon {
  width: 1rem;
  height: 1rem;
  color: var(--system-blue);
  margin-right: var(--spacing-2);
  flex-shrink: 0;
}

/* Modal Footer - Action Buttons */
.preference-modal-footer {
  background: var(--surface-floating);
  padding: var(--spacing-4) var(--spacing-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--surface-quaternary);
}

@media (max-width: 640px) {
  .preference-modal-footer {
    flex-direction: column;
    gap: var(--spacing-3);
    padding: var(--spacing-4);
  }

  .preference-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .preference-modal-footer > *:not(:last-child) {
    margin-right: 0;
    margin-bottom: var(--spacing-2);
  }
}

/* Modal Buttons - Consistent with Main System */
.preference-modal-footer .btn {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-4);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  border: none;
  cursor: pointer;
  font-size: var(--text-callout);
  text-decoration: none;
  min-height: 40px;
}

.preference-modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.preference-modal-footer .btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.preference-modal-footer .btn-secondary {
  background: var(--surface-secondary);
  color: var(--label-primary);
  border: 1px solid var(--surface-quaternary);
  box-shadow: var(--shadow-sm);
}

.preference-modal-footer .btn-secondary:hover:not(:disabled) {
  background: var(--surface-tertiary);
  box-shadow: var(--shadow-md);
}

.preference-modal-footer .btn-success {
  background: linear-gradient(135deg, var(--system-green) 0%, var(--system-blue) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.preference-modal-footer .btn-success:hover:not(:disabled) {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.preference-modal-footer .btn-link {
  background: transparent;
  color: var(--label-secondary);
  padding: var(--spacing-2) var(--spacing-3);
  text-decoration: underline;
}

.preference-modal-footer .btn-link:hover {
  color: var(--label-primary);
  text-decoration: none;
}

.btn-icon-left {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: var(--spacing-2);
}

.btn-icon-right {
  width: 1.25rem;
  height: 1.25rem;
  margin-left: var(--spacing-2);
}

/* Responsive Design - Mobile First */
@media (max-width: 480px) {
  .preference-modal-overlay {
    padding: var(--spacing-2);
  }

  .preference-modal-container {
    border-radius: var(--radius-2xl);
  }

  .preference-modal-header {
    padding: var(--spacing-4) var(--spacing-4) var(--spacing-3);
  }

  .modal-title {
    font-size: var(--text-headline-2);
  }

  .preference-modal-content {
    padding: var(--spacing-4);
  }

  .step-icon-container {
    width: 4rem;
    height: 4rem;
  }

  .step-icon {
    width: 2rem;
    height: 2rem;
  }

  .preference-grid {
    gap: var(--spacing-2);
  }

  .preference-card {
    padding: var(--spacing-2);
  }

  .preference-card-large {
    padding: var(--spacing-3);
  }

  .preference-name {
    font-size: var(--text-body-1);
  }
}

@media (max-width: 360px) {
  .preference-grid.preference-grid-2,
  .preference-grid.preference-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Accessibility Enhancements */
.preference-option:focus-within .preference-card {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
  outline: 2px solid var(--system-blue);
  outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .preference-modal-container {
    background: var(--surface-floating);
    border: 1px solid var(--surface-quaternary);
  }

  .preference-card {
    background: var(--surface-secondary);
    border: 2px solid var(--surface-quaternary);
  }

  .preference-input:checked + .preference-card {
    background: var(--surface-tertiary);
  }

  .custom-input {
    background: var(--surface-secondary);
    border: 1px solid var(--surface-quaternary);
    color: var(--label-primary);
  }

  .custom-input:focus {
    background: var(--surface-floating);
  }

  .benefits-container {
    background: var(--surface-secondary);
    border: 1px solid var(--surface-quaternary);
  }

  .info-notice {
    background: var(--surface-secondary);
    border: 1px solid var(--surface-quaternary);
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .preference-modal-overlay {
    background: rgba(0, 0, 0, 0.8);
  }

  .preference-card {
    border: 2px solid var(--label-primary);
  }

  .preference-input:checked + .preference-card {
    border: 2px solid var(--system-blue);
  }

  .custom-input {
    border: 2px solid var(--label-primary);
  }
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Utility Classes */
.preference-step.hidden {
  display: none;
}

.preference-step.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

/* Loading States */
.preference-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-6);
  color: var(--label-secondary);
}

.preference-loading .spinner {
  margin-right: var(--spacing-3);
}

/* Error States */
.preference-error {
  background: var(--system-red);
  color: white;
  padding: var(--spacing-3);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: var(--spacing-3) 0;
  font-size: var(--text-footnote);
}

/* Success States */
.preference-success {
  background: var(--system-green);
  color: white;
  padding: var(--spacing-3);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: var(--spacing-3) 0;
  font-size: var(--text-footnote);
}

/* Final Touches */
.preference-modal-container * {
  box-sizing: border-box;
}

.preference-modal-container img {
  border-radius: var(--radius-sm);
}

.preference-modal-container a {
  color: var(--system-blue);
  text-decoration: none;
}

.preference-modal-container a:hover {
  text-decoration: underline;
}

.preference-modal-container ul,
.preference-modal-container ol {
  padding-left: var(--spacing-4);
}

.preference-modal-container li {
  margin-bottom: var(--spacing-1);
}

/* Touch Target Enhancement */
.preference-card,
.preference-option,
.btn {
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.preference-card:active,
.btn:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Scrollbar Customization */
.preference-modal-content::-webkit-scrollbar {
  width: 6px;
}

.preference-modal-content::-webkit-scrollbar-track {
  background: var(--surface-secondary);
  border-radius: var(--radius-full);
}

.preference-modal-content::-webkit-scrollbar-thumb {
  background: var(--fill-secondary);
  border-radius: var(--radius-full);
}

.preference-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--fill-primary);
}

/* ==================== END OF DAPURDIGITAL PREMIUM CSS ==================== */
/* Version: 2.0 | Design System: Apple Modern | Responsive: Full Mobile Support */