/* ============================================
   LOURDIN RPG - DESIGN SYSTEM
   Centralized CSS Variables & Utilities
   ============================================ */

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

:root {
    /* ===== COLOR PALETTE ===== */

    /* Primary - Gold (Adjusted for better contrast) */
    --color-primary: #ffd700;           /* Bright gold - for accents, borders, highlights */
    --color-primary-light: #ffec8b;     /* Light gold */
    --color-primary-dark: #daa520;      /* Goldenrod - better for buttons with white text */
    --color-primary-darker: #b8860b;    /* Dark goldenrod - for button gradients */
    
    /* Background - Dark Slate */
    --color-bg-base: #0a0f1e;
    --color-bg-secondary: #0f1419;
    --color-bg-elevated: rgba(30, 41, 59, 0.95);
    --color-bg-elevated-alt: rgba(15, 23, 42, 0.98);
    
    /* Text Colors */
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-tertiary: #64748b;
    --color-text-muted: #475569;
    --color-text-light: #cbd5e1;        /* Light gray text */
    --color-text-lighter: #e2e8f0;      /* Lighter gray text */
    --color-text-lightest: #f1f5f9;     /* Lightest gray text */
    --color-text-dark: #334155;         /* Dark gray text */
    --color-text-darker: #1e293b;       /* Darker gray text */

    /* Gray Scale */
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-850: #12151c;          /* Custom darker gray */
    --color-gray-900: #0f172a;
    
    /* Semantic Colors */
    --color-success: #22c55e;
    --color-success-light: #4ade80;
    --color-success-lighter: #86efac;   /* Light green tint */
    --color-success-dark: #16a34a;

    --color-danger: #ef4444;
    --color-danger-light: #f87171;
    --color-danger-lighter: #fca5a5;    /* Light red tint */
    --color-danger-lightest: #fecaca;   /* Lightest red tint */
    --color-danger-dark: #dc2626;

    --color-warning: #f59e0b;
    --color-warning-light: #fcd34d;
    --color-warning-lighter: #fde047;   /* Light yellow tint */
    --color-warning-lightest: #fde68a;  /* Lightest yellow tint */
    --color-warning-bright: #fbbf24;    /* Bright yellow */
    --color-warning-dark: #d97706;

    --color-info: #3b82f6;
    --color-info-light: #60a5fa;
    --color-info-lighter: #93c5fd;      /* Light blue tint */
    --color-info-lightest: #bfdbfe;     /* Lightest blue tint */
    --color-info-dark: #2563eb;
    
    
    /* Class Colors */
    --color-warrior: #ef4444;
    --color-wizard: #3b82f6;
    --color-ranger: #22c55e;
    --color-rogue: #6366f1;
    --color-rogue-light: #a5b4fc;       /* Light indigo tint */
    --color-rogue-lighter: #c7d2fe;     /* Lighter indigo tint */
    --color-paladin: #f59e0b;
    --color-bard: #ec4899;
    --color-bard-light: #f9a8d4;        /* Light pink tint */
    --color-bard-lighter: #fbcfe8;      /* Lighter pink tint */
    --color-cleric: #10b981;
    --color-cleric-light: #6ee7b7;      /* Light teal tint */
    --color-cleric-lighter: #a7f3d0;    /* Lighter teal tint */
    --color-monk: #8b5cf6;
    --color-monk-light: #c084fc;        /* Light purple tint */
    --color-monk-lighter: #c4b5fd;      /* Lighter purple tint */
    --color-monk-lightest: #ddd6fe;     /* Lightest purple tint */
    --color-barbarian: #dc2626;
    --color-pirate: #06b6d4;
    --color-pirate-light: #67e8f9;      /* Light cyan tint */
    --color-pirate-lighter: #a5f3fc;    /* Lighter cyan tint */
    
    /* Stat Colors */
    --color-stat-str: #ef4444;
    --color-stat-dex: #22c55e;
    --color-stat-con: #f59e0b;
    --color-stat-int: #3b82f6;
    --color-stat-wis: #8b5cf6;
    --color-stat-cha: #ec4899;
    
    /* Combat Colors */
    --color-hp: #22c55e;
    --color-hp-low: #f59e0b;
    --color-hp-critical: #ef4444;
    --color-mana: #3b82f6;
    --color-swagger: #06b6d4;
    --color-xp: #ffd700;

    /* Zone Colors (tactical zone combat) */
    --color-zone-vanguard: #ef4444;
    --color-zone-vanguard-light: #f87171;
    --color-zone-vanguard-bg: rgba(239, 68, 68, 0.07);
    --color-zone-vanguard-border: rgba(239, 68, 68, 0.28);

    --color-zone-flank: #f59e0b;
    --color-zone-flank-light: #fbbf24;
    --color-zone-flank-bg: rgba(245, 158, 11, 0.07);
    --color-zone-flank-border: rgba(245, 158, 11, 0.28);

    --color-zone-rear: #3b82f6;
    --color-zone-rear-light: #60a5fa;
    --color-zone-rear-bg: rgba(59, 130, 246, 0.07);
    --color-zone-rear-border: rgba(59, 130, 246, 0.28);

    /* Zone side accent borders */
    --color-zone-player-accent: rgba(59, 130, 246, 0.6);
    --color-zone-enemy-accent: rgba(239, 68, 68, 0.6);
    
    /* Rarity Colors */
    --color-rarity-common: #94a3b8;
    --color-rarity-uncommon: #22c55e;
    --color-rarity-rare: #3b82f6;
    --color-rarity-epic: #a855f7;
    --color-rarity-legendary: #f59e0b;

    /* Pet Rarity Colors (full set, distinct from item rarity where needed) */
    --color-pet-common: #94a3b8;
    --color-pet-uncommon: #4ade80;
    --color-pet-rare: #60a5fa;
    --color-pet-epic: #c084fc;
    --color-pet-legendary: #fbbf24;

    /* Pet Evolution Stage Colors */
    --color-pet-stage-1: #94a3b8;
    --color-pet-stage-2: #60a5fa;
    --color-pet-stage-3: #fbbf24;

    /* Pet Card Dimensions */
    --pet-card-portrait-sm: 20px;    /* compact row in combat bar */
    --pet-card-portrait-md: 52px;    /* sidebar card (tavern) */
    --pet-card-portrait-lg: 80px;    /* detail dialog */
    --pet-card-portrait-xl: 128px;   /* detail dialog hero */

    /* Pet XP Bar */
    --pet-xp-bar-height: 4px;

    /* Metal Colors (for rankings/medals) */
    --color-gold: #ffd700;
    --color-silver: #c0c0c0;
    --color-bronze: #cd7f32;
    
    /* Borders */
    --color-border-base: rgba(255, 215, 0, 0.15);
    --color-border-hover: rgba(255, 215, 0, 0.25);
    --color-border-active: rgba(255, 215, 0, 0.4);
    --color-border-subtle: rgba(255, 255, 255, 0.08);
    
    /* ===== SPACING SCALE ===== */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 0.75rem;    /* 12px */
    --space-lg: 1rem;       /* 16px */
    --space-xl: 1.5rem;     /* 24px */
    --space-2xl: 2rem;      /* 32px */
    --space-3xl: 3rem;      /* 48px */
    --space-4xl: 4rem;      /* 64px */
    
    /* ===== FONT SCALES ===== */
    --font-size-xs: 0.65rem;    /* 10.4px */
    --font-size-sm: 0.75rem;    /* 12px */
    --font-size-base: 0.875rem; /* 14px */
    --font-size-md: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 2rem;      /* 32px */
    --font-size-4xl: 3rem;      /* 48px */
    --font-size-5xl: 4rem;      /* 64px */
    
    /* ===== FONT FAMILIES ===== */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Cinzel', serif;
    --font-mono: 'Courier New', monospace;
    
    /* ===== FONT WEIGHTS ===== */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* ===== BORDER RADIUS ===== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-3xl: 16px;
    --radius-round: 50%;
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 12px 30px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
    --shadow-gold-lg: 0 0 40px rgba(255, 215, 0, 0.4);
    
    /* ===== TRANSITIONS ===== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* ===== Z-INDEX SCALE ===== */
    --z-base: 1;
    --z-elevated: 10;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    
    /* ===== PAGE LAYOUT ===== */
    /* Content width tokens - use for page containers */
    --page-max-width-sm: 800px;      /* Narrow content: forms, articles */
    --page-max-width-md: 1200px;     /* Medium content: most pages */
    --page-max-width-lg: 1400px;     /* Wide content: dashboards */
    --page-max-width-xl: 1600px;     /* Extra wide: grids, galleries */
    --page-max-width-full: 100%;     /* Full width (respects parent) */
    
    /* Standard page padding */
    --page-padding-x: clamp(1rem, 4vw, 2rem);
    --page-padding-y: var(--space-xl);
    
    /* Container gutter (space between edge and content on small screens) */
    --page-gutter: var(--space-lg);
}

/* ============================================
   PAGE CONTAINER UTILITIES
   ============================================ */

/* Base page container - centers content with max-width */
.page-container {
    width: 100%;
    max-width: var(--page-max-width-lg);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
    box-sizing: border-box;
}

/* Size variants */
.page-container-sm { max-width: var(--page-max-width-sm); }
.page-container-md { max-width: var(--page-max-width-md); }
.page-container-lg { max-width: var(--page-max-width-lg); }
.page-container-xl { max-width: var(--page-max-width-xl); }
.page-container-full { max-width: var(--page-max-width-full); }

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */

.text-display {
    font-family: var(--font-display);
    letter-spacing: 0.05em;
}

.text-mono {
    font-family: var(--font-mono);
}

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

.text-gold { color: var(--color-primary); }
.text-success { color: var(--color-success-light); }
.text-danger { color: var(--color-danger-light); }
.text-warning { color: var(--color-warning-light); }
.text-info { color: var(--color-info-light); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

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

.uppercase { text-transform: uppercase; }
.letter-spacing { letter-spacing: 0.05em; }

/* ============================================
   CARD SYSTEM (BASE STYLES)
   ============================================ */

.card {
    background: linear-gradient(145deg, var(--color-bg-elevated), var(--color-bg-elevated-alt));
    border: 1px solid var(--color-border-base);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    transition: all var(--transition-slow);
}

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

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

.card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.card-interactive {
    cursor: pointer;
    transition: all var(--transition-slow);
}

.card-interactive:hover {
    transform: translateY(-2px);
    border-color: var(--color-border-hover);
}

.card-interactive:active {
    transform: translateY(0);
}

/* Card Header */
.card-header {
    background: rgba(255, 215, 0, 0.15);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border-base);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    margin: calc(var(--space-xl) * -1) calc(var(--space-xl) * -1) var(--space-xl);
}

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

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

/* ============================================
   BUTTON SYSTEM
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-display);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

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

/* Button Sizes */
.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-size-lg);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-dark), #b8860b);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), var(--color-success-dark));
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), var(--color-danger-dark));
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning), var(--color-warning-dark));
    color: white;
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--color-info), var(--color-info-dark));
    color: white;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: rgba(255, 215, 0, 0.05);
    color: var(--color-primary);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.btn-outline:hover:not(:disabled) {
    border-color: rgba(255, 215, 0, 0.8);
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-primary);
}

/* ============================================
   BADGE SYSTEM
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Badge Variants */
.badge-primary {
    background: rgba(255, 215, 0, 0.2);
    color: var(--color-primary);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success-light);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-pink {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-teal {
    background: rgba(20, 184, 166, 0.2);
    color: #5eead4;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

/* ============================================
   STAT BAR SYSTEM
   ============================================ */

.stat-bar-container {
    margin-bottom: var(--space-md);
}

.stat-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.stat-bar-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-bar-value {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
}

.stat-bar {
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.stat-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Stat Fill Colors */
.stat-bar-fill.hp {
    background: linear-gradient(90deg, var(--color-hp), var(--color-success-light));
}

.stat-bar-fill.hp.low {
    background: linear-gradient(90deg, var(--color-hp-low), var(--color-warning-light));
}

.stat-bar-fill.hp.critical {
    background: linear-gradient(90deg, var(--color-hp-critical), var(--color-danger-light));
}

.stat-bar-fill.mana {
    background: linear-gradient(90deg, var(--color-mana), var(--color-info-light));
}

.stat-bar-fill.xp {
    background: linear-gradient(90deg, var(--color-xp), var(--color-primary-light));
}

.stat-bar-fill.swagger {
    background: linear-gradient(90deg, var(--color-swagger), #22d3ee);
}

.stat-bar-fill.ki {
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
}

/* ============================================
   STATUS EFFECT CATEGORY COLORS (se-*)
   Applied to .status-effect-badge, .sticky-status-badge, .mobile-status-badge.
   Base sizing stays in component CSS; these classes provide color/border/shadow.
   ============================================ */

.se-dot-fire   { background: linear-gradient(135deg, #ea580c, #c2410c); border-color: #fb923c; box-shadow: 0 2px 6px rgba(234,88,12,0.4); }
.se-dot-poison { background: linear-gradient(135deg, #16a34a, #14532d); border-color: #4ade80; box-shadow: 0 2px 6px rgba(22,163,74,0.4); }
.se-dot-bleed  { background: linear-gradient(135deg, #dc2626, #7f1d1d); border-color: #fca5a5; box-shadow: 0 2px 6px rgba(220,38,38,0.4); }
.se-cc-stun    { background: linear-gradient(135deg, #7c3aed, #5b21b6); border-color: #a78bfa; box-shadow: 0 2px 6px rgba(124,58,237,0.4); }
.se-cc-freeze  { background: linear-gradient(135deg, #0284c7, #075985); border-color: #7dd3fc; box-shadow: 0 2px 6px rgba(2,132,199,0.4); }
.se-cc-sleep   { background: linear-gradient(135deg, #6d28d9, #4c1d95); border-color: #c4b5fd; box-shadow: 0 2px 6px rgba(109,40,217,0.3); }
.se-cc-charm   { background: linear-gradient(135deg, #db2777, #9d174d); border-color: #f9a8d4; box-shadow: 0 2px 6px rgba(219,39,119,0.4); }
.se-debuff     { background: linear-gradient(135deg, #b45309, #92400e); border-color: #fcd34d; box-shadow: 0 2px 6px rgba(180,83,9,0.3); }
.se-buff       { background: linear-gradient(135deg, #059669, #047857); border-color: #34d399; box-shadow: 0 2px 6px rgba(5,150,105,0.4); }
.se-more       { background: rgba(107, 114, 128, 0.4); border-color: #9ca3af; }

.se-dot-fire .mud-icon-root,
.se-dot-poison .mud-icon-root,
.se-dot-bleed .mud-icon-root,
.se-cc-stun .mud-icon-root,
.se-cc-freeze .mud-icon-root,
.se-cc-sleep .mud-icon-root,
.se-cc-charm .mud-icon-root,
.se-debuff .mud-icon-root,
.se-buff .mud-icon-root { color: white; }

/* ============================================
   SECTION HEADER SYSTEM
   ============================================ */

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-base);
    margin-bottom: var(--space-xl);
}

.section-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    color: var(--color-primary);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    flex: 1;
    margin: 0;
}

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

.section-count {
    font-size: var(--font-size-base);
    color: var(--color-text-tertiary);
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-xs) var(--space-md);
    border-radius: 12px;
}

/* ============================================
   GRID SYSTEMS
   ============================================ */

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

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

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

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

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

/* Responsive Grid Breakpoints */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }

.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ============================================
   FLEX 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; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ============================================
   ANIMATIONS (SHARED)
   ============================================ */

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

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

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

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

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

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

/* Animation Utility Classes */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glow-pulse 2s ease-in-out infinite; }
.animate-fadeIn { animation: fadeIn 0.6s ease-out forwards; }
.animate-slideIn { animation: slideIn 0.4s ease-out forwards; }
.animate-shake { animation: shake 0.4s ease-out; }

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

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

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

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

.hidden { display: none; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.w-full { width: 100%; }
.h-full { height: 100%; }

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

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

/* Focus Visible Styles */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
