/* ========================================
   DESIGN SYSTEM - Mobile-First Architecture
   Best Practices: Variables, Typography, Spacing, Components
   ======================================== */

/* ===== CSS CUSTOM PROPERTIES (Design Tokens) ===== */
:root {
  /* Colors - Natural & Professional */
  --color-primary: #2d6a4f;
  /* Deep green (health, nature) */
  --color-primary-light: #40916c;
  --color-primary-dark: #1b4332;
  --color-secondary: #f77f00;
  /* Warm orange (energy, food) */
  --color-secondary-light: #fcbf49;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-black: #000000;

  /* Semantic Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-display: 'Georgia', 'Times New Roman', serif;

  --font-size-xs: 0.75rem;
  /* 12px */
  --font-size-sm: 0.875rem;
  /* 14px */
  --font-size-base: 1rem;
  /* 16px */
  --font-size-lg: 1.125rem;
  /* 18px */
  --font-size-xl: 1.25rem;
  /* 20px */
  --font-size-2xl: 1.5rem;
  /* 24px */
  --font-size-3xl: 1.875rem;
  /* 30px */
  --font-size-4xl: 2.25rem;
  /* 36px */
  --font-size-5xl: 3rem;
  /* 48px */

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing (8px base) */
  --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 */

  /* Border Radius */
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 0.75rem;
  /* 12px */
  --radius-xl: 1rem;
  /* 16px */
  --radius-2xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Layout - Mobile First */
  --container-max-width: 1280px;
  --content-max-width: 768px;
  --nav-height: 64px;
  --mobile-nav-height: 56px;
  --bottom-nav-height: 64px;

  /* Touch Targets (minimum 44x44px for accessibility) */
  --touch-target-min: 44px;
}

/* ===== MOBILE-FIRST BREAKPOINTS ===== */
/*
  Mobile:  < 640px  (default, no media query needed)
  Tablet:  ≥ 640px  (sm)
  Laptop:  ≥ 1024px (md)
  Desktop: ≥ 1280px (lg)
  XL:      ≥ 1536px (xl)
*/

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* Better focus styles for accessibility (WCAG 2.4.7) */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* High contrast focus for better visibility */
@media (prefers-contrast: high) {
  :focus-visible {
    outline-width: 4px;
    outline-color: currentColor;
  }
}

/* Remove default button styles */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Better link styles */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Image Loading States */
img[data-src] {
  background-color: var(--color-gray-100);
  background-image: linear-gradient(90deg,
      var(--color-gray-100) 0px,
      var(--color-gray-200) 40px,
      var(--color-gray-100) 80px);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

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

  100% {
    background-position: -200% 0;
  }
}

img.loading {
  opacity: 0.6;
  filter: blur(5px);
  transition: opacity var(--transition-base), filter var(--transition-base);
}

img.loaded {
  opacity: 1;
  filter: blur(0);
  animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
  from {
    opacity: 0.6;
    filter: blur(5px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

img.error {
  opacity: 0.5;
  filter: grayscale(1);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  img[data-src] {
    animation: none;
  }

  img.loading,
  img.loaded {
    transition: none;
    animation: none;
  }
}

/* ===== ACCESSIBILITY UTILITIES ===== */

/* Skip to Content Link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-4);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: var(--z-modal);
  border-radius: 0 0 var(--radius-md) 0;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-secondary);
  outline-offset: 0;
}

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

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
  color: var(--color-gray-900);
}

h1 {
  font-size: var(--font-size-3xl);
  font-family: var(--font-display);
}

h2 {
  font-size: var(--font-size-2xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

h5,
h6 {
  font-size: var(--font-size-base);
}

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

/* Tablet & Up */
@media (min-width: 640px) {
  h1 {
    font-size: var(--font-size-4xl);
  }

  h2 {
    font-size: var(--font-size-3xl);
  }

  h3 {
    font-size: var(--font-size-2xl);
  }
}

/* Desktop & Up */
@media (min-width: 1024px) {
  h1 {
    font-size: var(--font-size-5xl);
  }

  h2 {
    font-size: var(--font-size-4xl);
  }
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* Content Width */
.content {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

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

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

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

@media (min-width: 640px) {
  .sm\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .sm\:gap-6 {
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .md\:gap-8 {
    gap: var(--space-8);
  }
}

/* Flexbox Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* Spacing Utilities */
.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mt-12 {
  margin-top: var(--space-12);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

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

.mb-6 {
  margin-bottom: var(--space-6);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.mb-12 {
  margin-bottom: var(--space-12);
}

.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.py-12 {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.px-6 {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* Text Utilities */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-base {
  font-size: var(--font-size-base);
}

.text-lg {
  font-size: var(--font-size-lg);
}

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

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.text-gray-600 {
  color: var(--color-gray-600);
}

.text-gray-700 {
  color: var(--color-gray-700);
}

.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

/* Display Utilities */
.hidden {
  display: none;
}

.block {
  display: block;
}

/* Additional Filters Spacing */
.additional-filters {
  margin-top: var(--space-4);
}

/* Hidden Content */
.hidden-pricing-content {
  display: none;
}

@media (min-width: 1024px) {
  .md\:hidden {
    display: none;
  }

  .md\:block {
    display: block;
  }
}

/* Border Radius */
.rounded {
  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-full {
  border-radius: var(--radius-full);
}

/* Shadows */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  min-height: var(--touch-target-min);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #d97706 100%);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(247, 127, 0, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--color-secondary-light) 0%, var(--color-secondary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 127, 0, 0.4);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
  z-index: -1;
}

.btn-outline:hover::before {
  width: 100%;
}

.btn-outline:hover {
  color: var(--color-white);
  border-color: var(--color-primary);
}

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

.btn-small {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  min-height: 36px;
}

/* Cards */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background-color: var(--color-gray-100);
}

.card-content {
  padding: var(--space-4);
}

@media (min-width: 640px) {
  .card-content {
    padding: var(--space-6);
  }
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
}

.card-description {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
}

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

.badge-secondary {
  background-color: var(--color-secondary-light);
  color: var(--color-gray-900);
}

/* Section */
.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  position: relative;
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-10);
  position: relative;
}

.section-title h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

@media (min-width: 1024px) {
  .section-title {
    margin-bottom: var(--space-12);
  }

  .section-title h2 {
    font-size: var(--font-size-4xl);
  }
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg,
      var(--color-gray-200) 25%,
      var(--color-gray-100) 50%,
      var(--color-gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

  100% {
    background-position: -200% 0;
  }
}

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

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left {
  animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
  animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered animation delays for lists */
.feature-card:nth-child(1) {
  animation-delay: 0ms;
}

.feature-card:nth-child(2) {
  animation-delay: 100ms;
}

.feature-card:nth-child(3) {
  animation-delay: 200ms;
}

.feature-card:nth-child(4) {
  animation-delay: 300ms;
}

.feature-card:nth-child(5) {
  animation-delay: 400ms;
}

.feature-card:nth-child(6) {
  animation-delay: 500ms;
}

.recipe-card:nth-child(1) {
  animation-delay: 0ms;
}

.recipe-card:nth-child(2) {
  animation-delay: 150ms;
}

.recipe-card:nth-child(3) {
  animation-delay: 300ms;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   MODERN UX ENHANCEMENTS
   ======================================== */

/* ===== LOADING STATES ===== */

/* Skeleton Loader Variants */
.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 2em;
  width: 70%;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
}

.skeleton-card {
  padding: var(--space-4);
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* Shimmer Effect (Better than pulse) */
.shimmer {
  background: linear-gradient(90deg,
      var(--color-gray-200) 0%,
      var(--color-gray-100) 20%,
      var(--color-gray-200) 40%,
      var(--color-gray-200) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

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

  100% {
    background-position: 200% 0;
  }
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ===== TOAST NOTIFICATIONS ===== */

.toast-container {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 400px;
}

@media (max-width: 640px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: calc(var(--bottom-nav-height) + var(--space-4));
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid var(--color-primary);
}

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

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-left-color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-error);
}

.toast-warning {
  border-left-color: var(--color-warning);
}

.toast-info {
  border-left-color: var(--color-info);
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
  color: var(--color-gray-900);
}

.toast-message {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
  color: var(--color-gray-400);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
}

/* ===== EMPTY STATES ===== */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  max-width: 400px;
  margin: 0 auto;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
}

.empty-state-message {
  font-size: var(--font-size-base);
  color: var(--color-gray-600);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-6);
}

.empty-state-action {
  margin-top: var(--space-4);
}

/* ===== FORM ENHANCEMENTS ===== */

/* Input Focus Ring (Accessibility) */
.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  min-height: var(--touch-target-min);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-gray-900);
  background-color: var(--color-white);
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--color-gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Input with Icon */
.input-group {
  position: relative;
}

.input-group-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.input-group .form-input {
  padding-left: calc(var(--space-4) + 24px + var(--space-2));
}

/* Input Validation States */
.form-input-success,
.form-input-error {
  padding-right: calc(var(--space-4) + 24px);
}

.form-input-success {
  border-color: var(--color-success);
}

.form-input-error {
  border-color: var(--color-error);
}

.form-input-success:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Form Feedback */
.form-feedback {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
}

.form-feedback-success {
  color: var(--color-success);
}

.form-feedback-error {
  color: var(--color-error);
}

/* Form Label */
.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
}

.form-label-required::after {
  content: ' *';
  color: var(--color-error);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-gray-400);
  cursor: pointer;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.password-toggle:hover {
  color: var(--color-gray-600);
  background-color: var(--color-gray-100);
}

/* ===== MODAL ===== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  animation: fadeIn 0.2s ease-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - var(--space-8));
  max-width: 600px;
  max-height: calc(100vh - var(--space-8));
  background-color: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  animation: modalSlideUp 0.3s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}

.modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
  color: var(--color-gray-400);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid var(--color-gray-200);
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
    animation: modalSlideUp 0.3s ease-out;
  }

  @keyframes modalSlideUp {
    from {
      transform: translateY(100%);
    }

    to {
      transform: translateY(0);
    }
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ===== BOTTOM SHEET (Mobile) ===== */

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  animation: fadeIn 0.2s ease-out;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: var(--z-modal);
  animation: slideUpFromBottom 0.3s ease-out;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@keyframes slideUpFromBottom {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--color-gray-300);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto var(--space-2);
}

.bottom-sheet-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
}

.bottom-sheet-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  text-align: center;
}

.bottom-sheet-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* ===== FLOATING ACTION BUTTON (FAB) ===== */

.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  right: var(--space-4);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
}

.fab:hover {
  background-color: var(--color-primary-dark);
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.fab:active {
  transform: scale(0.95);
}

@media (min-width: 1024px) {
  .fab {
    bottom: var(--space-6);
  }
}

/* ===== PROGRESS INDICATORS ===== */

.progress {
  width: 100%;
  height: 8px;
  background-color: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.progress-bar-animated {
  background-image: linear-gradient(45deg,
      rgba(255, 255, 255, 0.15) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.15) 75%,
      transparent 75%,
      transparent);
  background-size: 1rem 1rem;
  animation: progressBarStripes 1s linear infinite;
}

@keyframes progressBarStripes {
  0% {
    background-position: 1rem 0;
  }

  100% {
    background-position: 0 0;
  }
}

/* Steps Progress */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.step {
  flex: 1;
  position: relative;
  text-align: center;
}

.step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  right: -50%;
  height: 2px;
  background-color: var(--color-gray-300);
  z-index: 0;
}

.step:last-child::before {
  display: none;
}

.step-indicator {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gray-300);
  color: var(--color-white);
  border-radius: 50%;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  position: relative;
  z-index: 1;
}

.step-active .step-indicator {
  background-color: var(--color-primary);
}

.step-complete .step-indicator {
  background-color: var(--color-success);
}

.step-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
}

.step-active .step-label,
.step-complete .step-label {
  color: var(--color-gray-900);
  font-weight: var(--font-weight-medium);
}

/* ===== TOOLTIP ===== */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-gray-900);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip);
  pointer-events: none;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--color-gray-900) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== ACCORDION ===== */

.accordion {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
}

.accordion-item {
  border-bottom: 1px solid var(--color-gray-200);
}

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

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  min-height: var(--touch-target-min);
  background-color: var(--color-white);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-align: left;
}

.accordion-header:hover {
  background-color: var(--color-gray-50);
}

.accordion-title {
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
}

.accordion-icon {
  transition: transform var(--transition-base);
  color: var(--color-gray-400);
}

.accordion-item-active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item-active .accordion-content {
  max-height: 1000px;
}

.accordion-body {
  padding: var(--space-4);
  color: var(--color-gray-600);
  line-height: var(--line-height-relaxed);
}

/* ===== CHIPS / TAGS ===== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.chip-clickable {
  cursor: pointer;
}

.chip-clickable:hover {
  background-color: var(--color-gray-200);
}

.chip-primary {
  background-color: var(--color-primary-light);
  color: var(--color-white);
}

.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.chip-remove:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

/* ===== DIVIDER ===== */

.divider {
  height: 1px;
  background-color: var(--color-gray-200);
  margin: var(--space-6) 0;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background-color: var(--color-gray-200);
}

/* ===== PULL TO REFRESH ===== */

.pull-to-refresh {
  position: relative;
  overflow: hidden;
}

.pull-to-refresh-indicator {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: top var(--transition-base);
}

.pull-to-refresh-pulling .pull-to-refresh-indicator {
  top: 10px;
}

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

/* Pointer */
.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

/* User Select */
.select-none {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* Position */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

/* Flexbox */
.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-around {
  justify-content: space-around;
}

.justify-end {
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 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);
}

/* Grid */
.grid {
  display: grid;
}

.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);
}

@media (max-width: 640px) {

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

/* Width */
.w-full {
  width: 100%;
}

.w-80 {
  width: 80%;
}

.max-w-xl {
  max-width: 36rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.max-w-4xl {
  max-width: 56rem;
}

/* Height */
.h-full {
  height: 100%;
}

/* Opacity */
.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

/* ===== ACCESSIBILITY HELPERS ===== */

/* 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-width: 0;
}

/* Focus Visible Enhancement */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn {
    border: 2px solid currentColor;
  }

  .form-input,
  .form-select,
  .form-textarea {
    border-width: 2px;
  }
}

/* ===== PRINT STYLES ===== */

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

  body {
    background-color: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}