/* Global CSS - Reset, Tokens, and Base Styles */
@layer reset, base, components, utilities;

/* Import component styles */
@import url("components/layout.css");
@import url("components/header.css");
@import url("components/hero.css");
@import url("components/stats.css");
@import url("components/upload.css");
@import url("components/preview.css");
@import url("components/result.css");
@import url("components/loading.css");
@import url("components/footer.css");
@import url("components/background.css");
@import url("components/status.css");
@import url("components/glass.css");
@import url("components/buttons.css");
@import url("components/animations.css");
@import url("components/notifications.css");
@import url("components/utilities.css");
@import url("components/forms.css");
@import url("components/scrollbars.css");
@import url("components/accessibility.css");
@import url("components/container-queries.css");
@import url("components/mobile.css");
@import url("components/shop.css");
@import url("components/reviews.css");
@import url("components/blog.css");

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="auto"] {
  color-scheme: light dark;
}

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
@layer base {
  :root {
    /* Color primitives */
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-neon: #00ff88;
    --green-electric: #39ff14;
    --green-sage: #9caf88;
    --purple-400: #c084fc;
    --purple-500: #9d4edd;
    --purple-600: #7c3aed;
    --orange-400: #fb923c;
    --orange-500: #ff6b35;
    --orange-600: #ea580c;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-500: #71717a;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --gray-900: #18181b;
    --gray-950: #09090b;

    /* Semantic color system */
    --color-primary: #00ff88;
    --color-primary-hover: var(--green-electric);
    --color-primary-soft: var(--green-400);
    --color-secondary: #22c55e;
    --color-accent-purple: #9d4edd;
    --color-accent-orange: #fb923c;
    --color-danger: var(--red-500);
    --color-warning: var(--orange-400);
    --color-success: var(--green-500);

    /* Surface colors */
    --color-background: #09090b;
    --color-background-soft: var(--gray-900);
    --color-surface: rgba(255, 255, 255, 0.03);
    --color-surface-hover: rgba(255, 255, 255, 0.06);
    --color-surface-active: rgba(255, 255, 255, 0.08);
    --color-surface-glass: rgba(255, 255, 255, 0.05);
    --color-surface-elevated: rgba(255, 255, 255, 0.08);

    /* Text colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.8);
    --color-text-muted: rgba(255, 255, 255, 0.6);
    --color-text-disabled: rgba(255, 255, 255, 0.4);
    --color-text-inverse: var(--gray-900);
    --color-text-brand: #a0ffc7;

    /* Border colors */
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-hover: rgba(0, 255, 136, 0.3);
    --color-border-active: var(--color-primary);
    --color-border-focus: var(--color-primary);
    --color-border-danger: var(--color-danger);

    /* Component tokens */
    --border-radius-xs: 4px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --border-radius-2xl: 24px;
    --border-radius-full: 9999px;

    /* Spacing scale with fluid values */
    --space-px: 1px;
    --space-0: 0;
    --space-0-5: clamp(0.125rem, 0.5vw, 0.25rem);
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: clamp(1.25rem, 2.5vw, 1.5rem);
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: clamp(2.5rem, 5vw, 3rem);
    --space-12: 3rem;
    --space-16: clamp(4rem, 8vw, 5rem);
    --space-20: clamp(5rem, 10vw, 6rem);
    --space-24: clamp(6rem, 12vw, 8rem);

    /* Typography scale */
    --font-size-xs: clamp(0.75rem, 1vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 1.2vw, 1rem);
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: clamp(1.5rem, 3vw, 2rem);
    --font-size-3xl: clamp(2rem, 4vw, 3rem);
    --font-size-4xl: clamp(2.5rem, 5vw, 4rem);
    --font-size-5xl: clamp(3rem, 6vw, 5rem);
    --font-size-6xl: clamp(4rem, 8vw, 6rem);

    --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.2;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Effects */
    --backdrop-blur-sm: blur(4px);
    --backdrop-blur: blur(8px);
    --backdrop-blur-md: blur(12px);
    --backdrop-blur-lg: blur(16px);
    --backdrop-blur-xl: blur(24px);
    --backdrop-blur-2xl: blur(40px);
    --backdrop-blur-3xl: blur(64px);

    /* Animation durations */
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;

    /* Animation easings */
    --ease-linear: linear;
    --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);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-index scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* Shadow system */
    --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-glow: 0 0 30px rgba(0, 255, 136, 0.3);
    --shadow-glow-lg: 0 0 50px rgba(0, 255, 136, 0.4);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  }

  /* Theme variants */
  [data-theme="light"] {
    --color-background: #ffffff;
    --color-background-soft: var(--gray-50);
    --color-surface: rgba(0, 0, 0, 0.03);
    --color-surface-hover: rgba(0, 0, 0, 0.06);
    --color-surface-active: rgba(0, 0, 0, 0.08);
    --color-text-primary: var(--gray-900);
    --color-text-secondary: var(--gray-700);
    --color-text-muted: var(--gray-500);
    --color-text-disabled: var(--gray-400);
    --color-text-inverse: #ffffff;
    --color-border: rgba(0, 0, 0, 0.1);
  }

  [data-theme="high-contrast"] {
    --color-primary: #00ff00;
    --color-text-primary: #ffffff;
    --color-text-secondary: #ffffff;
    --color-border: #ffffff;
    --color-surface: rgba(255, 255, 255, 0.1);
  }

  /* ===== MODERN CSS RESET ===== */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background:
      radial-gradient(ellipse at top, rgba(0, 255, 136, 0.06) 0%, transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(157, 78, 221, 0.06) 0%, transparent 50%),
      radial-gradient(ellipse at bottom left, rgba(255, 107, 53, 0.04) 0%, transparent 50%),
      linear-gradient(135deg, var(--gray-950) 0%, #0f0f0f 50%, var(--gray-900) 100%);
    min-height: 100vh;
    color: var(--color-text-primary);
    line-height: var(--line-height-normal);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Remove default button styles */
  button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
  }

  /* Remove default input styles */
  input, textarea, select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
  }

  /* Remove default link styles */
  a {
    color: inherit;
    text-decoration: none;
  }

  /* Image optimization */
  img, svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  /* List styles */
  ul, ol {
    list-style: none;
  }

  /* Table styles */
  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

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

  /* Accessibility */
  .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;
  }

  /* Focus management */
  .focus-trap {
    outline: none;
  }

  /* Text utilities */
  .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-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); }
  .text-4xl { font-size: var(--font-size-4xl); }
  .text-5xl { font-size: var(--font-size-5xl); }
  .text-6xl { font-size: var(--font-size-6xl); }

  .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); }
  .font-extrabold { font-weight: var(--font-weight-extrabold); }

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

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

  /* Layout utilities - adaptive container */
  .container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: clamp(0.75rem, 2vw, 1rem);
    padding-right: clamp(0.75rem, 2vw, 1rem);
    position: relative;
  }
  
  /* Container variations for different sections */
  .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: clamp(0.5rem, 1vw, 1rem);
    padding-right: clamp(0.5rem, 1vw, 1rem);
  }
  
  .container-narrow {
    max-width: 900px;
  }
  
  .container-wide {
    max-width: 1600px;
  }

  .flex { display: flex; }
  .inline-flex { display: inline-flex; }
  .grid { display: grid; }
  .inline-grid { display: inline-grid; }
  .block { display: block; }
  .inline-block { display: inline-block; }
  .inline { display: inline; }
  .hidden { display: none; }

  .flex-row { flex-direction: row; }
  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .flex-nowrap { flex-wrap: nowrap; }

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

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

  .gap-0 { gap: var(--space-0); }
  .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-5 { gap: var(--space-5); }
  .gap-6 { gap: var(--space-6); }
  .gap-8 { gap: var(--space-8); }

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

  /* Spacing utilities */
  .p-0 { padding: var(--space-0); }
  .p-1 { padding: var(--space-1); }
  .p-2 { padding: var(--space-2); }
  .p-3 { padding: var(--space-3); }
  .p-4 { padding: var(--space-4); }
  .p-5 { padding: var(--space-5); }
  .p-6 { padding: var(--space-6); }
  .p-8 { padding: var(--space-8); }

  .m-0 { margin: var(--space-0); }
  .m-1 { margin: var(--space-1); }
  .m-2 { margin: var(--space-2); }
  .m-3 { margin: var(--space-3); }
  .m-4 { margin: var(--space-4); }
  .m-5 { margin: var(--space-5); }
  .m-6 { margin: var(--space-6); }
  .m-8 { margin: var(--space-8); }
  .m-auto { margin: auto; }

  /* Responsive utilities */
  .hide-mobile { display: block; }
  .show-mobile { display: none; }
  .hide-tablet { display: block; }
  .show-tablet { display: none; }
  .hide-desktop { display: block; }
  .show-desktop { display: none; }

  /* ===== ANIMATIONS ===== */
  @media (prefers-reduced-motion: no-preference) {
    @keyframes fade-in-up {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }
}
  
  /* ===== RESPONSIVE BREAKPOINTS ===== */
  /* Small devices (phones) */
  @media (max-width: 639px) {
    .container {
      padding-left: 0.75rem;
      padding-right: 0.75rem;
    }
    
    body {
      font-size: 15px;
    }
    
    /* Adjust spacing for mobile */
    :root {
      --space-1: 0.125rem;
      --space-2: 0.25rem;
      --space-3: 0.5rem;
      --space-4: 0.75rem;
      --space-6: 1rem;
      --space-8: 1.5rem;
      --space-12: 2rem;
      --space-16: 2.5rem;
      --space-20: 3rem;
      --space-24: 3.5rem;
      --space-32: 4rem;
    }
  }
  
  /* Medium devices (tablets) */
  @media (min-width: 640px) and (max-width: 1023px) {
    .hide-mobile { display: block; }
    .show-mobile { display: none; }
    .hide-tablet { display: none; }
    .show-tablet { display: block; }
  }
  
  /* Large devices (desktops) */
  @media (min-width: 1024px) {
    .hide-mobile { display: block; }
    .show-mobile { display: none; }
    .hide-tablet { display: block; }
    .show-tablet { display: none; }
    .hide-desktop { display: none; }
    .show-desktop { display: block; }
  }
  
  /* Extra large devices */
  @media (min-width: 1440px) {
    .container {
      max-width: 1400px;
    }
  }
  
  /* Ultra wide screens */
  @media (min-width: 1920px) {
    .container-wide {
      max-width: 1800px;
    }
  }

/* ===== CRITICAL FIXES ===== */
/* Force hide loading overlay when hidden attribute is present */
.loading-overlay[hidden] {
  display: none !important;
}
