/**
 * NEFDHA Design System
 * Modern, cutting-edge responsive design system
 * Created: 2024-10-01
 */

/* ============================================================================
   FONT FACE DECLARATIONS
   ============================================================================ */

@font-face {
    font-family: 'Fontastique';
    src: url('../fonts/fontastique-webfont.woff2') format('woff2'),
         url('../fonts/fontastique-webfont.woff') format('woff'),
         url('../fonts/fontastique-webfont.ttf') format('truetype'),
         url('../fonts/fontastique-webfont.svg#fontastique') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
/* ============================================================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================================================ */

:root {
    /* ========== Brand Colors (from logo) ========== */
    --color-primary-green: #99CC33;
    --color-primary-green-rgb: 153, 204, 51;
    --color-teal: #1B9D9B;
    --color-teal-rgb: 27, 157, 155;
    --color-magenta: #C41888;
    --color-magenta-rgb: 196, 24, 136;
    --color-purple: #8B5CF6;
    --color-purple-rgb: 139, 92, 246;
    --color-blue: #3B82F6;
    --color-blue-rgb: 59, 130, 246;
    --color-success: #10B981;
    --color-success-rgb: 16, 185, 129;
    --color-warning: #F59E0B;
    --color-warning-rgb: 245, 158, 11;
    --color-danger: #EF4444;
    --color-danger-rgb: 239, 68, 68;

    /* ========== Neutral Colors ========== */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-black-light: #1a1a1a;
    --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;

    /* ========================================================================
       SEMANTIC / ALIAS TOKENS
       Single source of truth for all design roles
       ======================================================================== */

    /* --- Action Colors --- */
    --color-action-primary: var(--color-primary-green);
    --color-action-primary-hover: var(--color-primary-dark);
    --color-action-secondary: var(--color-teal);
    --color-action-secondary-hover: var(--color-secondary-dark);
    --color-action-accent: var(--color-magenta);
    --color-action-accent-hover: var(--color-accent-dark);

    /* --- Text Colors --- */
    /* WCAG AA requires 4.5:1 contrast ratio for normal text, 3:1 for large text */
    --color-text-heading: var(--color-gray-900);
    --color-text-body: var(--color-gray-700);
    --color-text-body-subtle: var(--color-gray-600);
    --color-text-muted: #5C6370; /* Darker than gray-500 for better contrast (5.3:1 on white) */
    --color-text-on-primary: var(--color-white);
    --color-text-on-dark: var(--color-white);
    --color-text-link: #2d7a46; /* Darker green for better contrast (5.1:1 on white) */
    --color-text-link-hover: var(--color-action-primary-hover);
    --color-text-accent: var(--color-action-accent);

    /* --- Surface Colors --- */
    --color-surface-default: var(--color-white);
    --color-surface-subtle: var(--color-gray-50);
    --color-surface-muted: var(--color-gray-100);
    --color-surface-elevated: var(--color-white);
    --color-surface-dark: var(--color-gray-900);

    /* --- Border Colors --- */
    --color-border-default: var(--color-gray-300);
    --color-border-subtle: var(--color-gray-200);
    --color-border-light: var(--color-gray-100);
    --color-border-focus: var(--color-action-primary);
    --color-border-brand: var(--color-action-primary);

    /* --- Brand Gradients --- */
    --gradient-brand-text: linear-gradient(135deg, var(--color-action-primary) 0%, var(--color-action-secondary) 50%, var(--color-action-accent) 100%);
    --gradient-brand-background: linear-gradient(135deg, var(--color-action-primary), var(--color-action-secondary));

    /* --- Typography Aliases --- */
    --font-size-h1: var(--text-5xl);
    --font-size-h2: var(--text-4xl);
    --font-size-h3: var(--text-3xl);
    --font-size-h4: var(--text-2xl);
    --font-size-h5: var(--text-xl);
    --font-size-h6: var(--text-lg);
    --font-size-body: var(--text-base);
    --font-size-small: var(--text-sm);

    /* Status Colors */
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-success-dark: #065F46;

    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-warning-dark: #92400E;

    --color-error: #EF4444;
    --color-error-light: #FEE2E2;
    --color-error-dark: #991B1B;

    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;
    --color-info-dark: #1E40AF;

    /* ========== Color Shades (lighter/darker variations) ========== */
    --color-primary-light: #B8E056;
    --color-primary-lighter: #D4ED99;
    --color-primary-dark: #7AAA26;
    --color-primary-darker: #5B8019;

    --color-secondary-light: #2BC4C1;
    --color-secondary-lighter: #7EE0DE;
    --color-secondary-dark: #157877;
    --color-secondary-darker: #0F5655;

    --color-accent-light: #D04AA8;
    --color-accent-lighter: #E897CF;
    --color-accent-dark: #8C0F5D;
    --color-accent-darker: #6A0B46;

    /* ========== Typography ========== */
    --font-heading: 'Fontastique', 'Georgia', serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;

    /* Fluid Type Scale - Responsive typography using clamp() */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);      /* 12-14px */
    --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);       /* 14-16px */
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);      /* 16-18px */
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);    /* 18-20px */
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);        /* 20-24px */
    --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);     /* 24-30px */
    --text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);   /* 30-36px */
    --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);         /* 36-48px */
    --text-5xl: clamp(3rem, 2.55rem + 2.25vw, 3.75rem);        /* 48-60px */

    /* Backward compatibility aliases */
    --font-size-xs: var(--text-xs);
    --font-size-sm: var(--text-sm);
    --font-size-base: var(--text-base);
    --font-size-lg: var(--text-lg);
    --font-size-xl: var(--text-xl);
    --font-size-2xl: var(--text-2xl);
    --font-size-3xl: var(--text-3xl);
    --font-size-4xl: var(--text-4xl);
    --font-size-5xl: var(--text-5xl);
    --font-size-6xl: 3.75rem;     /* 60px */
    --font-size-7xl: 4.5rem;      /* 72px */

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

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

    /* ========== Spacing Scale (4px base) ========== */
    --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 */
    --space-32: 8rem;     /* 128px */

    /* ========== Border Radius ========== */
    --radius-none: 0;
    --radius-sm: 0.125rem;    /* 2px */
    --radius-base: 0.25rem;   /* 4px */
    --radius-md: 0.375rem;    /* 6px */
    --radius-lg: 0.5rem;      /* 8px */
    --radius-xl: 0.75rem;     /* 12px */
    --radius-2xl: 1rem;       /* 16px */
    --radius-3xl: 1.5rem;     /* 24px */
    --radius-full: 9999px;

    /* ========== Shadows & Elevation ========== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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 -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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Colored shadows for brand elements */
    --shadow-primary: 0 10px 15px -3px rgba(var(--color-primary-green-rgb), 0.3);
    --shadow-secondary: 0 10px 15px -3px rgba(var(--color-teal-rgb), 0.3);
    --shadow-accent: 0 10px 15px -3px rgba(var(--color-magenta-rgb), 0.3);

    /* Drop shadows with consistent light source (top-left, 45deg) */
    --drop-shadow-sm: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.15));
    --drop-shadow-md: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.25));
    --drop-shadow-lg: drop-shadow(3px 6px 10px rgba(0, 0, 0, 0.3));
    --drop-shadow-xl: drop-shadow(4px 8px 16px rgba(0, 0, 0, 0.35));

    /* ========== Transitions & Animations ========== */
    --transition-fast: 150ms;
    --transition-base: 200ms;
    --transition-slow: 300ms;
    --transition-slower: 500ms;

    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* ========== Z-Index Scale ========== */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;

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

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

/* ============================================================================
   MODERN 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;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: var(--line-height-normal);
    color: var(--color-text-body);
    background-color: var(--color-surface-default);
    overflow-x: hidden;
}

/* ========== Typography Base ========== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-heading);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--font-size-h1);
}

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

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

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

h5 {
    font-size: var(--font-size-h5);
}

h6 {
    font-size: var(--font-size-h6);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 { font-size: var(--font-size-h2); }
    h2 { font-size: var(--font-size-h3); }
    h3 { font-size: var(--font-size-h4); }
    h4 { font-size: var(--font-size-h5); }
    h5 { font-size: var(--font-size-h6); }
    h6 { font-size: var(--font-size-body); }
}

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

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-base) var(--ease-out);
}

a:hover {
    color: var(--color-text-link-hover);
}

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

/* ========== Lists ========== */

ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

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

/* ========== Images ========== */

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

/* ========== Buttons Reset ========== */

button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

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

/* ========== Display ========== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

/* ========== Flexbox ========== */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

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

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

/* ========== Font Weights ========== */
.font-light { font-weight: var(--font-weight-light); }
.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); }

/* ========== Text Colors ========== */
.text-primary { color: var(--color-action-primary); }
.text-secondary { color: var(--color-action-secondary); }
.text-accent { color: var(--color-text-accent); }
.text-white { color: var(--color-white); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-900 { color: var(--color-gray-900); }

/* ========== Background Colors ========== */
.bg-primary { background-color: var(--color-action-primary); }
.bg-secondary { background-color: var(--color-action-secondary); }
.bg-accent { background-color: var(--color-action-accent); }
.bg-white { background-color: var(--color-white); }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }

/* ========== Spacing Utilities ========== */
/* Margins */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* Padding */
.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.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); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* ========== Border Radius ========== */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-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); }
.shadow-xl { box-shadow: var(--shadow-xl); }

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

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

/* ========== Max Width ========== */
.max-w-sm { max-width: var(--container-sm); }
.max-w-md { max-width: var(--container-md); }
.max-w-lg { max-width: var(--container-lg); }
.max-w-xl { max-width: var(--container-xl); }
.max-w-2xl { max-width: var(--container-2xl); }

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

/* ========== Responsive Utilities ========== */
@media (max-width: 768px) {
    .md\:hidden { display: none !important; }
}

@media (min-width: 769px) {
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

.animate-fadeIn {
    animation: fadeIn var(--transition-slow) var(--ease-out);
}

.animate-fadeInUp {
    animation: fadeInUp var(--transition-slow) var(--ease-out);
}

.animate-fadeInDown {
    animation: fadeInDown var(--transition-slow) var(--ease-out);
}

.animate-scaleIn {
    animation: scaleIn var(--transition-slow) var(--ease-bounce);
}

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    z-index: var(--z-tooltip);
    border-radius: var(--radius-base);
}

.skip-link:focus {
    top: 10px;
    left: 10px;
}

/* Screen reader only - visually hidden but accessible */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

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

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

/* ============================================================================
   GLASSMORPHISM EFFECTS
   ============================================================================ */

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   RESPONSIVE UTILITIES
   Breakpoint-prefixed utility classes for responsive design
   ============================================================================ */

/* Display utilities */
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }

/* Small breakpoint (640px+) */
@media (min-width: 640px) {
    .sm\:hidden { display: none !important; }
    .sm\:block { display: block !important; }
    .sm\:inline-block { display: inline-block !important; }
    .sm\:flex { display: flex !important; }
    .sm\:inline-flex { display: inline-flex !important; }
    .sm\:grid { display: grid !important; }
}

/* Medium breakpoint (768px+) */
@media (min-width: 768px) {
    .md\:hidden { display: none !important; }
    .md\:block { display: block !important; }
    .md\:inline-block { display: inline-block !important; }
    .md\:flex { display: flex !important; }
    .md\:inline-flex { display: inline-flex !important; }
    .md\:grid { display: grid !important; }
    .md\:flex-row { flex-direction: row !important; }
    .md\:flex-col { flex-direction: column !important; }
    .md\:items-center { align-items: center !important; }
    .md\:justify-between { justify-content: space-between !important; }
    .md\:text-left { text-align: left !important; }
    .md\:text-center { text-align: center !important; }
    .md\:text-right { text-align: right !important; }
}

/* Large breakpoint (1024px+) */
@media (min-width: 1024px) {
    .lg\:hidden { display: none !important; }
    .lg\:block { display: block !important; }
    .lg\:inline-block { display: inline-block !important; }
    .lg\:flex { display: flex !important; }
    .lg\:inline-flex { display: inline-flex !important; }
    .lg\:grid { display: grid !important; }
    .lg\:flex-row { flex-direction: row !important; }
    .lg\:flex-col { flex-direction: column !important; }
    .lg\:items-center { align-items: center !important; }
    .lg\:justify-between { justify-content: space-between !important; }
    .lg\:text-left { text-align: left !important; }
    .lg\:text-center { text-align: center !important; }
    .lg\:text-right { text-align: right !important; }
}

/* Extra large breakpoint (1280px+) */
@media (min-width: 1280px) {
    .xl\:hidden { display: none !important; }
    .xl\:block { display: block !important; }
    .xl\:flex { display: flex !important; }
    .xl\:grid { display: grid !important; }
}

/* Mobile-first hide utilities (max-width) */
@media (max-width: 639px) {
    .hide-mobile { display: none !important; }
}

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

@media (max-width: 1023px) {
    .hide-tablet { display: none !important; }
}

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

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

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

/* Stack utility - adds vertical spacing between children */
.stack > * + * {
    margin-top: var(--space-4);
}

.stack-sm > * + * {
    margin-top: var(--space-2);
}

.stack-lg > * + * {
    margin-top: var(--space-6);
}

.stack-xl > * + * {
    margin-top: var(--space-8);
}

/* Cluster utility - horizontal spacing with wrap */
.cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

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

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

/* Responsive gap utilities */
@media (max-width: 767px) {
    .gap-responsive {
        gap: var(--space-3) !important;
    }

    .gap-sm-responsive {
        gap: var(--space-2) !important;
    }
}

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

/* Text that hides on mobile but keeps layout */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .text-truncate-mobile {
        max-width: 150px;
    }
}

/* Responsive text alignment */
.text-center-mobile {
    text-align: center;
}

@media (min-width: 768px) {
    .text-center-mobile {
        text-align: left;
    }
}

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

/* Auto-fit grid that adapts to screen size */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

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

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

/* Responsive grid columns */
@media (max-width: 767px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
