/* ===== ENTERPRISE DESIGN SYSTEM - شاه ترند + zone AI ===== */
/* Professional Design System Compatible with Enterprise Standards */
/* Standard-level: Google, Apple, Meta, zone */
/* Inspired by Fortune 500 Companies Design Principles */

@layer reset, base, tokens, components, patterns, utilities;

/* ===== RESET LAYER ===== */
@layer reset {
  /* Modern CSS Reset for Maximum Compatibility */
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }
  
  body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  img, svg, video, canvas, iframe {
    display: block;
    max-width: 100%;
    height: auto;
  }
  
  input, button, textarea, select {
    font: inherit;
    margin: 0;
  }
  
  button {
    background: none;
    border: none;
    cursor: pointer;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  ul, ol {
    list-style: none;
  }
}

/* ===== BASE LAYER ===== */
@layer base {
  html {
    /* Persian/Arabic RTL Support */
    direction: rtl;
    text-align: right;
  }
  
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-background-primary);
  }
}

/* ===== DESIGN TOKENS LAYER ===== */
@layer tokens {
  :root {
    /* ===== Core Brand Colors ===== */
    --color-brand-ai-purple: #7C3AED;        /* AI Purple - Technology & Innovation */
    --color-brand-primary-blue: #2563EB;     /* Trust Blue - Professional & Reliable */
    --color-brand-cta-orange: #F59E0B;       /* CTA Orange - Action & Energy */
    --color-brand-success: #059669;          /* Success Green - Positive Actions */
    
    /* ===== zone Integration Colors ===== */
    --color-zone-dark: #141920;              /* Primary Navigation - zone Dark */
    --color-zone-secondary: #232F3F;         /* Secondary Backgrounds */
    --color-zone-orange: #FF9900;            /* Primary Actions - zone Orange */
    --color-zone-prime: #00B9E7;             /* Premium Features */
    --color-zone-gold: #F19D38;              /* Borders & Accents */
    --color-zone-yellow: #F4BF76;            /* Search & Highlights */
    
    /* ===== zone Header Text Colors ===== */
    --color-header-text: #FFFFFF;            /* Header Text - Pure White */
    --color-header-text-hover: #FFFFFF;      /* Header Text Hover - Pure White */
    --color-header-text-active: #FF9900;     /* Header Text Active - zone Orange */
    
    /* ===== Header Context Colors ===== */
    --color-header-heading: var(--color-header-text);      /* Header Headings - White */
    --color-header-subheading: var(--color-header-text);   /* Header Subheadings - White */
    --color-header-body: var(--color-header-text);         /* Header Body Text - White */
    --color-header-caption: var(--color-header-text);      /* Header Captions - White */
    --color-header-label: var(--color-header-text);        /* Header Labels - White */
    
    /* ===== Header Layout Variables ===== */
    --header-bg: var(--color-zone-dark);                  /* Header Background - zone Dark */
    --header-border: var(--color-zone-secondary);          /* Header Border - Secondary */
    --container-max: 1200px;                              /* Max Container Width */
    --nav-gap: 12px;                                      /* Navigation Gap */
    --hit: 75px;                                          /* Header Item Height */
    
    /* ===== Search System Variables ===== */
    --search-bg: #ffffff;                                  /* Search Background - White */
    --search-border: var(--color-zone-gold);               /* Search Border - zone Gold */
    --search-radius: 8px;                                 /* Search Border Radius */
    --search-width: 280px;                                /* Search Input Width */
    --search-text: var(--color-text-primary);              /* Search Text Color */
    --search-icon: var(--color-text-tertiary);             /* Search Icon Color */
    
    /* ===== zone-Style Dropdown System ===== */
    --zone-dropdown-bg: var(--color-zone-dark);            /* Dropdown Background - zone Dark */
    --zone-dropdown-border: var(--color-zone-secondary);   /* Dropdown Border - zone Secondary */
    --zone-dropdown-shadow: rgba(0, 0, 0, 0.3);           /* Dropdown Shadow - Enhanced */
    --zone-dropdown-hover: var(--color-zone-secondary);    /* Dropdown Hover - zone Secondary */
    --zone-dropdown-text: var(--color-header-text);        /* Dropdown Text - White */
    --zone-dropdown-header: var(--color-zone-secondary);   /* Dropdown Header - zone Secondary */
    --zone-dropdown-divider: var(--color-zone-gold);       /* Dropdown Divider - zone Gold */
    
    /* ===== Semantic Colors ===== */
    --color-background-primary: #FFFFFF;
    --color-background-secondary: #F8FAFC;
    --color-background-tertiary: #F1F5F9;
    --color-text-primary: #0F172A;
    --color-text-secondary: #475569;
    --color-text-tertiary: #64748B;
    --color-border-primary: #E2E8F0;
    --color-border-secondary: #CBD5E1;
    
    /* ===== Color Scales (8-point system) ===== */
    
    /* AI Purple Scale */
    --purple-50: #FAF5FF;
    --purple-100: #F3E8FF;
    --purple-200: #E9D5FF;
    --purple-300: #D8B4FE;
    --purple-400: #C084FC;
    --purple-500: #A855F7;
    --purple-600: #9333EA;
    --purple-700: #7C3AED;
    --purple-800: #6B21A8;
    --purple-900: #581C87;
    
    /* zone Orange Scale */
    --orange-50: #FFF7ED;
    --orange-100: #FFEDD5;
    --orange-200: #FED7AA;
    --orange-300: #FDBA74;
    --orange-400: #FB923C;
    --orange-500: #F97316;
    --orange-600: #EA580C;
    --orange-700: #DC2626;
    --orange-800: #9A3412;
    --orange-900: #7C2D12;
    
    /* ===== Spacing Scale (8pt Grid System) ===== */
    --space-0: 0;
    --space-1: 0.25rem;    /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;       /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */
    --space-16: 4rem;      /* 64px */
    --space-20: 5rem;      /* 80px */
    --space-24: 6rem;      /* 96px */
    
    /* Component Spacing */
    --space-section: var(--space-24);
    --space-component: var(--space-8);
    --space-element: var(--space-4);
    --space-micro: var(--space-2);
    
    /* ===== Typography Scale ===== */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
    --text-6xl: 3.75rem;    /* 60px */
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Font Weights */
    --font-thin: 100;
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;
    
    /* ===== Border Radius System ===== */
    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-full: 9999px;   /* Circle */
    
    /* ===== Shadow System ===== */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* ===== Animation & Timing ===== */
    --duration-fast: 150ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;
    --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ===== Breakpoints ===== */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
  }
}

/* ===== COMPONENTS LAYER ===== */
@layer components {
  /* ===== Button System (shadcn/ui Pattern) ===== */
  
  /* Base Button */
  .btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-weight: var(--font-medium);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
    outline: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
  }
  
  .btn-base:focus-visible {
    outline: 2px solid var(--color-brand-ai-purple);
    outline-offset: 2px;
  }
  
  .btn-base:disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
  }
  
  /* Size Variants */
  .btn-xs {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    min-height: 32px;
  }
  
  .btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    min-height: 36px;
  }
  
  .btn-md {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    border-radius: var(--radius-lg);
    min-height: 40px;
  }
  
  .btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
    min-height: 48px;
  }
  
  .btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
    min-height: 56px;
  }
  
  /* Primary Variant (شاه ترند) */
  .btn-primary {
    background: linear-gradient(135deg, var(--color-brand-cta-orange), #D97706);
    color: white;
    border: 1px solid #D97706;
    box-shadow: var(--shadow-sm);
  }
  
  .btn-primary:hover {
    background: linear-gradient(135deg, #D97706, #B45309);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
  
  .btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
  }
  
  /* zone Variant */
  .btn-zone {
    background: var(--color-zone-orange);
    color: var(--color-header-text);
    border: 1px solid var(--color-zone-orange);
    box-shadow: var(--shadow-sm);
  }
  
  .btn-zone:hover {
    background: #E88B00;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--color-header-text-hover);
  }
  
  /* Prime Variant */
  .btn-prime {
    background: var(--color-zone-prime);
    color: var(--color-header-text);
    border: 1px solid var(--color-zone-prime);
    box-shadow: var(--shadow-sm);
  }
  
  .btn-prime:hover {
    background: #0099C7;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--color-header-text-hover);
  }
  
  /* AI Variant */
  .btn-ai {
    background: var(--color-brand-ai-purple);
    color: var(--color-header-text);
    border: 1px solid var(--color-brand-ai-purple);
    box-shadow: var(--shadow-sm);
  }
  
  .btn-ai:hover {
    background: #6B21A8;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--color-header-text-hover);
  }
  
  /* Secondary Variants */
  .btn-secondary {
    background: #F3F4F6;
    color: #111827;
    border: 1px solid #D1D5DB;
  }
  
  .btn-secondary:hover {
    background: #E5E7EB;
  }
  
  .btn-outline {
    background: transparent;
    color: var(--color-brand-ai-purple);
    border: 2px solid var(--color-brand-ai-purple);
  }
  
  .btn-outline:hover {
    background: rgba(124, 58, 237, 0.1);
    color: #6B21A8;
    border-color: #6B21A8;
  }
  
  .btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid transparent;
  }
  
  .btn-ghost:hover {
    background: rgba(107, 114, 128, 0.1);
    color: var(--color-text-primary);
  }
  
  /* Header Ghost Button Variant */
  .btn-ghost-header {
    background: transparent;
    color: var(--color-header-text);
    border: 1px solid transparent;
  }
  
  .btn-ghost-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-header-text-hover);
  }
  
  .btn-link {
    background: transparent;
    color: #2563EB;
    border: 1px solid transparent;
    text-decoration: underline;
  }
  
  .btn-link:hover {
    color: #1D4ED8;
  }
  
  /* Header Link Button Variant */
  .btn-link-header {
    background: transparent;
    color: var(--color-header-text);
    border: 1px solid transparent;
    text-decoration: none;
  }
  
  .btn-link-header:hover {
    color: var(--color-header-text-hover);
    text-decoration: underline;
  }
}

/* ===== Input System ===== */

/* Base Input */
.input-base {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  background-color: white;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-md);
  line-height: 1.5;
  transition: border-color var(--duration-fast) var(--ease-out);
  outline: none;
}

.input-base:focus {
  border-color: var(--color-brand-primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-base:disabled {
  background-color: var(--color-background-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.input-base::placeholder {
  color: var(--color-text-tertiary);
}

/* Input Variants */
.input-default {
  /* Uses base styles */
}

.input-zone {
  /* Uses base styles */
}

.input-zone:focus {
  border-color: var(--color-zone-orange);
  box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.input-ai {
  /* Uses base styles */
}

.input-ai:focus {
  border-color: var(--color-brand-ai-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Input Sizes */
.input-xs {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  min-height: 32px;
}

.input-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  min-height: 36px;
}

.input-md {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  min-height: 40px;
}

.input-lg {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-lg);
  min-height: 48px;
}

/* Input States */
.input-error {
  border-color: #EF4444;
}

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

.input-success {
  border-color: #22C55E;
}

.input-success:focus {
  border-color: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Textarea */
.textarea-base {
  @extend .input-base;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* Select */
.select-base {
  @extend .input-base;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--space-3) center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: var(--space-10);
  appearance: none;
}

/* Checkbox & Radio */
.checkbox-base,
.radio-base {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.checkbox-base:checked,
.radio-base:checked {
  background-color: var(--color-brand-ai-purple);
  border-color: var(--color-brand-ai-purple);
}

.checkbox-base:focus,
.radio-base:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.radio-base {
  border-radius: 50%;
}

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

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

.form-help {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.form-error {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: #EF4444;
}

/* ===== Card System ===== */

/* Base Card */
.card-base {
  background-color: white;
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

/* Card Variants */
.card-default {
  /* Uses base styles */
}

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

.card-interactive {
  cursor: pointer;
}

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

.card-interactive:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.card-ai {
  border-color: rgba(124, 58, 237, 0.2);
}

.card-ai:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}

.card-zone {
  border-color: rgba(255, 153, 0, 0.2);
}

.card-zone:hover {
  border-color: rgba(255, 153, 0, 0.3);
  box-shadow: 0 0 20px rgba(255, 153, 0, 0.1);
}

/* Card Sizes */
.card-sm {
  padding: var(--space-3);
}

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

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

.card-xl {
  padding: var(--space-8);
}

/* Card Header & Footer */
.card-header {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-primary);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 0 0;
}

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

.card-footer {
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== Layout System ===== */

/* Container System */
.container-xs {
  max-width: 384px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-sm {
  max-width: 448px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-md {
  max-width: 672px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-lg {
  max-width: 896px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-xl {
  max-width: 1152px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.container-2xl {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.container-full {
  width: 100%;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

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

/* Grid System */
.grid-1 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

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

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

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

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Grid Gaps */
.gap-section {
  gap: var(--space-8);
}

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

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

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

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

@media (min-width: 1024px) {
  .gap-element {
    gap: var(--space-3);
  }
}

/* ===== Status System ===== */

/* Alert Components */
.alert-base {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
}

/* Alert Variants */
.alert-info {
  background-color: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}

.alert-success {
  background-color: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.alert-warning {
  background-color: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.alert-error {
  background-color: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.alert-ai {
  background-color: #FAF5FF;
  border-color: #E9D5FF;
  color: #581C87;
}

/* Badge System */
.badge-base {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  line-height: 1;
  white-space: nowrap;
}

/* Badge Variants */
.badge-primary {
  background-color: rgba(245, 158, 11, 0.1);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-zone {
  background-color: rgba(255, 153, 0, 0.1);
  color: #9A3412;
  border: 1px solid rgba(255, 153, 0, 0.2);
}

.badge-prime {
  background-color: rgba(0, 185, 231, 0.1);
  color: #064E3B;
  border: 1px solid rgba(0, 185, 231, 0.2);
}

.badge-ai {
  background-color: rgba(124, 58, 237, 0.1);
  color: #581C87;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Badge Sizes */
.badge-sm {
  padding: var(--space-1);
  font-size: 0.625rem; /* 10px */
}

.badge-lg {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* ===== Navigation System ===== */

/* zone-Style Header */
.header-zone {
  background-color: var(--color-zone-dark);
  color: var(--color-header-text);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-header-text);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-normal) var(--ease-out);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-header-text-hover);
}

.nav-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.nav-item-active {
  background-color: var(--color-header-text-active);
  color: var(--color-header-text);
}

/* Search Bar */
.search-zone {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.search-zone:focus-within {
  border-color: var(--color-zone-gold);
}

.search-input {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-primary);
  border: none;
  outline: none;
  font-size: var(--text-sm);
  background-color: white;
}

.search-button {
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-primary);
  background-color: var(--color-zone-yellow);
  border: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
  font-size: var(--text-sm);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.search-button:hover {
  background-color: #E5E7EB;
}

/* ===== Utility Classes ===== */

/* Spacing Shortcuts */
.space-section {
  margin-bottom: var(--space-8);
}

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

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

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

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

@media (min-width: 1024px) {
  .space-element {
    margin-bottom: var(--space-3);
  }
}

/* Flex Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Position Utilities */
.absolute-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.absolute-top-right {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
}

.absolute-bottom-right {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
}

/* Text Utilities */
.text-heading {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

.text-subheading {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
}

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

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

.text-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
}

/* Truncation */
.truncate-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Accessibility System ===== */

/* Focus System */
.focus-ring {
  outline: none;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--color-brand-primary-blue);
  outline-offset: 2px;
}

.focus-ring-primary {
  outline: none;
}

.focus-ring-primary:focus-visible {
  outline: 2px solid var(--color-brand-cta-orange);
  outline-offset: 2px;
}

.focus-ring-zone {
  outline: none;
}

.focus-ring-zone:focus-visible {
  outline: 2px solid var(--color-zone-orange);
  outline-offset: 2px;
}

.focus-ring-header:focus-visible {
  outline: 2px solid var(--color-header-text-active);
  outline-offset: 2px;
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-4);
  background-color: #2563EB;
  color: var(--color-header-text);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-medium);
  z-index: 50;
  transition: top var(--duration-normal) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Screen Reader Utilities */
.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:focus {
  position: static;
  width: auto;
  height: auto;
  padding: auto;
  margin: auto;
  overflow: visible;
  white-space: normal;
  clip: auto;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  .high-contrast-border {
    border: 2px solid #000000;
  }
  
  .high-contrast-text {
    color: #000000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .respect-motion-preference {
    transition: none;
    animation: none;
  }
}

/* ===== Responsive System ===== */

/* Mobile First Breakpoints */
@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
  .sm\:flex { display: flex; }
  .sm\:grid { display: grid; }
  
  .sm\:text-xs { font-size: var(--text-xs); }
  .sm\:text-sm { font-size: var(--text-sm); }
  .sm\:text-base { font-size: var(--text-base); }
  .sm\:text-lg { font-size: var(--text-lg); }
  .sm\:text-xl { font-size: var(--text-xl); }
  .sm\:text-2xl { font-size: var(--text-2xl); }
  .sm\:text-3xl { font-size: var(--text-3xl); }
  .sm\:text-4xl { font-size: var(--text-4xl); }
  .sm\:text-5xl { font-size: var(--text-5xl); }
  .sm\:text-6xl { font-size: var(--text-6xl); }
}

@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
  .md\:grid { display: grid; }
  
  .md\:text-xs { font-size: var(--text-xs); }
  .md\:text-sm { font-size: var(--text-sm); }
  .md\:text-base { font-size: var(--text-base); }
  .md\:text-lg { font-size: var(--text-lg); }
  .md\:text-xl { font-size: var(--text-xl); }
  .md\:text-2xl { font-size: var(--text-2xl); }
  .md\:text-3xl { font-size: var(--text-3xl); }
  .md\:text-4xl { font-size: var(--text-4xl); }
  .md\:text-5xl { font-size: var(--text-5xl); }
  .md\:text-6xl { font-size: var(--text-6xl); }
}

@media (min-width: 1024px) {
  .lg\:block { display: block; }
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
  .lg\:grid { display: grid; }
  
  .lg\:text-xs { font-size: var(--text-xs); }
  .lg\:text-sm { font-size: var(--text-sm); }
  .lg\:text-base { font-size: var(--text-base); }
  .lg\:text-lg { font-size: var(--text-lg); }
  .lg\:text-xl { font-size: var(--text-xl); }
  .lg\:text-2xl { font-size: var(--text-2xl); }
  .lg\:text-3xl { font-size: var(--text-3xl); }
  .lg\:text-4xl { font-size: var(--text-4xl); }
  .lg\:text-5xl { font-size: var(--text-5xl); }
  .lg\:text-6xl { font-size: var(--text-6xl); }
}

@media (min-width: 1280px) {
  .xl\:block { display: block; }
  .xl\:hidden { display: none; }
  .xl\:flex { display: flex; }
  .xl\:grid { display: grid; }
  
  .xl\:text-xs { font-size: var(--text-xs); }
  .xl\:text-sm { font-size: var(--text-sm); }
  .xl\:text-base { font-size: var(--text-base); }
  .xl\:text-lg { font-size: var(--text-lg); }
  .xl\:text-xl { font-size: var(--text-xl); }
  .xl\:text-2xl { font-size: var(--text-2xl); }
  .xl\:text-3xl { font-size: var(--text-3xl); }
  .xl\:text-4xl { font-size: var(--text-4xl); }
  .xl\:text-5xl { font-size: var(--text-5xl); }
  .xl\:text-6xl { font-size: var(--text-6xl); }
}

@media (min-width: 1536px) {
  .\2xl\:block { display: block; }
  .\2xl\:hidden { display: none; }
  .\2xl\:flex { display: flex; }
  .\2xl\:grid { display: grid; }
  
  .\2xl\:text-xs { font-size: var(--text-xs); }
  .\2xl\:text-sm { font-size: var(--text-sm); }
  .\2xl\:text-base { font-size: var(--text-base); }
  .\2xl\:text-lg { font-size: var(--text-lg); }
  .\2xl\:text-xl { font-size: var(--text-xl); }
  .\2xl\:text-2xl { font-size: var(--text-2xl); }
  .\2xl\:text-3xl { font-size: var(--text-3xl); }
  .\2xl\:text-4xl { font-size: var(--text-4xl); }
  .\2xl\:text-5xl { font-size: var(--text-5xl); }
  .\2xl\:text-6xl { font-size: var(--text-6xl); }
}

/* ===== Header Context Classes ===== */

/* Header Text Classes */
.text-header-heading {
  color: var(--color-header-heading);
}

.text-header-subheading {
  color: var(--color-header-subheading);
}

.text-header-body {
  color: var(--color-header-body);
}

.text-header-caption {
  color: var(--color-header-caption);
}

.text-header-label {
  color: var(--color-header-label);
}

/* Header Background Classes */
.bg-header-primary {
  background-color: var(--color-zone-dark);
}

.bg-header-secondary {
  background-color: var(--color-zone-secondary);
}

/* Header Border Classes */
.border-header-primary {
  border-color: var(--color-zone-gold);
}

.border-header-secondary {
  border-color: var(--color-zone-yellow);
}


/* ===== zone Account Dropdown Base ===== */
.zone-account-dropdown {
  position: relative;
  cursor: pointer;
  z-index: 1001;
}

.zone-account-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--color-header-text) !important;
  background-color: transparent !important;
}

.zone-account-trigger:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.zone-account-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-header-text) !important;
}

.zone-account-trigger i.chevron.down.icon {
  color: var(--color-header-text) !important;
  font-size: 12px !important;
  margin-right: 4px !important;
}

/* ===== zone Account Dropdown Menu ===== */
.zone-account-dropdown .left.menu {
  border-radius: 1rem;        
  margin-top: -1rem;        
  max-height: 300px;   
  overflow: auto;       
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--zone-dropdown-bg);
  border: 1px solid var(--zone-dropdown-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 280px;
  z-index: 1002;
  opacity: 1 !important;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: zoneDropdownFadeIn 0.2s ease-out;
}

.zone-account-dropdown:hover .left.menu,
.zone-account-dropdown:focus-within .left.menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== zone Account Dropdown Menu Items ===== */
.zone-account-dropdown .left.menu .item {
  padding: 12px 16px;
  color: var(--zone-dropdown-text) !important;
  background-color: var(--zone-dropdown-bg) !important;
  border: none;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s ease;
}

.zone-account-dropdown .left.menu .item:hover {
  background-color: var(--zone-dropdown-hover) !important;
  color: var(--zone-dropdown-text) !important;
}

.zone-account-dropdown .left.menu .item.header {
  font-weight: 600;
  color: var(--zone-dropdown-text) !important;
  background-color: var(--zone-dropdown-header) !important;
  border-bottom: 1px solid var(--zone-dropdown-divider);
}

.zone-account-dropdown .left.menu .item.logout {
  border-top: 1px solid var(--zone-dropdown-divider);
  color: #dc3545 !important;
}

.zone-account-dropdown .left.menu .item.logout:hover {
  background-color: #dc3545 !important;
  color: white !important;
}

/* ===== zone Account Dropdown Special Items ===== */
.zone-account-dropdown .left.menu .item.header.earnings {
  background-color: var(--zone-dropdown-header) !important;
  color: var(--zone-dropdown-text) !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--zone-dropdown-divider) !important;
  padding: 12px 16px !important;
}

.zone-account-dropdown .left.menu .ui.divider {
  margin: 8px 0 !important;
  border-color: var(--zone-dropdown-divider) !important;
}

/* ===== zone Account Dropdown Icons ===== */
.zone-account-dropdown .left.menu .item i.icon {
  color: var(--color-text-tertiary) !important;
  width: 16px !important;
  height: 16px !important;
  margin-right: 8px !important;
}

.zone-account-dropdown .left.menu .item:hover i.icon {
  color: var(--color-text-secondary) !important;
}

/* ===== zone Sign in Button ===== */
.zone-signin-button {
  background-color: rgba(255, 255, 255, 0.7) !important;  /* Transparent white like hover */
  color: var(--color-header-text) !important;              /* White text */
  font-weight: 600 !important;
  border-radius: 4px !important;
  margin: 8px 16px !important;
  text-align: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important; /* Subtle border */
  transition: all 0.2s ease !important;
}

.zone-signin-button:hover {
  background-color: rgba(255, 255, 255, 0.7) !important; /* Slightly more opaque on hover */
  color: var(--color-header-text) !important;               /* Keep white text */
  border-color: rgba(255, 255, 255, 0.3) !important;      /* Enhanced border on hover */
  transform: translateY(-1px) !important;                   /* Subtle lift effect */
}

.zone-signin-button i.icon {
  color: var(--color-text-primary) !important;
  margin-right: 8px !important;
}

.zone-signin-button:hover i.icon {
  color: white !important;
}

/* ===== zone Account Dropdown Responsive Design ===== */
@media (max-width: 768px) {
  .zone-account-dropdown .left.menu {
    min-width: 250px;
    right: -50px;
  }
  
  .zone-account-text {
    font-size: 12px;
  }
}

/* ===== zone Account Dropdown Accessibility ===== */
.zone-account-trigger:focus {
  outline: 2px solid var(--color-zone-orange) !important;
  outline-offset: 2px !important;
}

/* ===== zone Account Dropdown Performance ===== */
.zone-account-dropdown {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.zone-account-dropdown * {
  transition: all 0.2s ease !important;
}

/* ===== zone Account Dropdown Animation ===== */
@keyframes zoneDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== zone Account Dropdown Loading States ===== */
.zone-account-dropdown.loading .left.menu {
  opacity: 0.7;
  pointer-events: none;
}

/* ===== zone Account Dropdown Item States ===== */
.zone-account-dropdown .left.menu .item:first-child {
  border-radius: 12px 12px 0 0 !important;
}

.zone-account-dropdown .left.menu .item:last-child {
  border-radius: 0 0 12px 12px !important;
}
