/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ========================================
   MODERN 2025 CSS CUSTOM PROPERTIES SYSTEM
   ======================================== */

:root {
  /* ===== COLOR SYSTEM ===== */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-light: #dbeafe;
  --color-secondary: #6b7280;
  --color-secondary-hover: #4b5563;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* Background Colors */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;
  --color-bg-dark: #1f2937;
  
  /* Text Colors */
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-text-inverse: #ffffff;
  
  /* Border Colors */
  --color-border-primary: #e5e7eb;
  --color-border-secondary: #d1d5db;
  --color-border-focus: #3b82f6;
  
  /* ===== SPACING SYSTEM ===== */
  --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
  --space-sm: clamp(0.5rem, 1vw, 0.75rem);
  --space-md: clamp(0.75rem, 1.5vw, 1rem);
  --space-lg: clamp(1rem, 2vw, 1.5rem);
  --space-xl: clamp(1.5rem, 3vw, 2rem);
  --space-2xl: clamp(2rem, 4vw, 3rem);
  --space-3xl: clamp(3rem, 6vw, 4rem);
  
  /* ===== TYPOGRAPHY SYSTEM ===== */
  --font-family-primary: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  
  /* Font Sizes - Responsive with clamp() */
  --text-xs: clamp(0.75rem, 1.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 1.4vw, 1rem);
  --text-base: clamp(1rem, 1.6vw, 1.125rem);
  --text-lg: clamp(1.125rem, 2vw, 1.25rem);
  --text-xl: clamp(1.25rem, 2.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 3vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 4vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 5vw, 3rem);
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  
  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* ===== LAYOUT SYSTEM ===== */
  --container-max-width: 1280px;
  --container-padding: clamp(1rem, 4vw, 2rem);
  
  /* Border Radius */
  --radius-sm: clamp(0.25rem, 0.5vw, 0.375rem);
  --radius-md: clamp(0.375rem, 0.75vw, 0.5rem);
  --radius-lg: clamp(0.5rem, 1vw, 0.75rem);
  --radius-xl: clamp(0.75rem, 1.5vw, 1rem);
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
  
  /* 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;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #1f2937;
    --color-bg-secondary: #111827;
    --color-bg-tertiary: #374151;
    --color-bg-dark: #ffffff;
    
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-text-inverse: #111827;
    
    --color-border-primary: #374151;
    --color-border-secondary: #4b5563;
  }
}

/* ===== MODERN RESET AND BASE STYLES ===== */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: var(--color-border-primary);
}

html {
  line-height: var(--leading-normal);
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: var(--font-family-primary);
  font-size: clamp(14px, 1.5vw, 18px); /* Responsive base font size */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  line-height: inherit;
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  min-height: 100dvh; /* Use dynamic viewport height for better mobile support */
}

/* ===== MODERN LAYOUT UTILITIES ===== */
.min-h-screen { min-height: 100dvh; } /* Use dynamic viewport height */
.min-h-screen-fallback { min-height: 100vh; } /* Fallback for older browsers */

/* Container System */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Responsive Width Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-max { width: max-content; }
.w-min { width: min-content; }

/* Responsive Height Utilities */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-fit { height: fit-content; }
.h-max { height: max-content; }
.h-min { height: min-content; }

/* Responsive Size Utilities - Using clamp() for better scaling */
.w-xs { width: clamp(1rem, 2vw, 1.5rem); }
.w-sm { width: clamp(1.5rem, 3vw, 2rem); }
.w-md { width: clamp(2rem, 4vw, 2.5rem); }
.w-lg { width: clamp(2.5rem, 5vw, 3rem); }
.w-xl { width: clamp(3rem, 6vw, 4rem); }

.h-xs { height: clamp(1rem, 2vw, 1.5rem); }
.h-sm { height: clamp(1.5rem, 3vw, 2rem); }
.h-md { height: clamp(2rem, 4vw, 2.5rem); }
.h-lg { height: clamp(2.5rem, 5vw, 3rem); }
.h-xl { height: clamp(3rem, 6vw, 4rem); }

/* Legacy support for existing classes */
.max-w-7xl { max-width: 80rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.w-64 { width: 16rem; }
.h-16 { height: 4rem; }
.w-16 { width: 4rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }

/* Flexbox utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.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; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-6 { gap: 1.5rem; }

/* ===== MODERN SPACING UTILITIES ===== */
/* Padding Utilities - Using custom properties for consistent spacing */
.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); }
.p-2xl { padding: var(--space-2xl); }
.p-3xl { padding: var(--space-3xl); }

/* Horizontal Padding */
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }
.px-2xl { padding-left: var(--space-2xl); padding-right: var(--space-2xl); }

/* Vertical Padding */
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }

/* Individual Padding Sides */
.pt-xs { padding-top: var(--space-xs); }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }
.pt-xl { padding-top: var(--space-xl); }

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

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

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

/* Margin Utilities - Using custom properties for consistent spacing */
.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); }
.m-2xl { margin: var(--space-2xl); }
.m-3xl { margin: var(--space-3xl); }

/* Horizontal Margin */
.mx-xs { margin-left: var(--space-xs); margin-right: var(--space-xs); }
.mx-sm { margin-left: var(--space-sm); margin-right: var(--space-sm); }
.mx-md { margin-left: var(--space-md); margin-right: var(--space-md); }
.mx-lg { margin-left: var(--space-lg); margin-right: var(--space-lg); }
.mx-xl { margin-left: var(--space-xl); margin-right: var(--space-xl); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Vertical Margin */
.my-xs { margin-top: var(--space-xs); margin-bottom: var(--space-xs); }
.my-sm { margin-top: var(--space-sm); margin-bottom: var(--space-sm); }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

/* Individual Margin Sides */
.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); }

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

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

/* Legacy support for existing classes */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-20 { padding-bottom: 5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }

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

/* Responsive Font Sizes - Using custom properties */
.text-xs { 
  font-size: var(--text-xs); 
  line-height: var(--leading-tight); 
}
.text-sm { 
  font-size: var(--text-sm); 
  line-height: var(--leading-tight); 
}
.text-base { 
  font-size: var(--text-base); 
  line-height: var(--leading-normal); 
}
.text-lg { 
  font-size: var(--text-lg); 
  line-height: var(--leading-normal); 
}
.text-xl { 
  font-size: var(--text-xl); 
  line-height: var(--leading-normal); 
}
.text-2xl { 
  font-size: var(--text-2xl); 
  line-height: var(--leading-tight); 
}
.text-3xl { 
  font-size: var(--text-3xl); 
  line-height: var(--leading-tight); 
}
.text-4xl { 
  font-size: var(--text-4xl); 
  line-height: var(--leading-tight); 
}

/* Font Weights */
.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Line Heights */
.leading-tight { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

/* Text Colors - Using custom properties */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-inverse { color: var(--color-text-inverse); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

/* Text Utilities */
.whitespace-pre-wrap { white-space: pre-wrap; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { word-wrap: break-word; }
.break-all { word-break: break-all; }

/* Legacy support for existing classes */
.leading-6 { line-height: 1.5rem; }

/* Color utilities */
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-green-400 { color: #4ade80; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-yellow-600 { color: #ca8a04; }
.text-red-500 { color: #ef4444; }
.text-white { color: #ffffff; }

/* Background color utilities */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-200 { background-color: #bfdbfe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-yellow-200 { background-color: #fde68a; }

/* Border utilities */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-green-200 { border-color: #bbf7d0; }
.border-transparent { border-color: transparent; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Shadow utilities */
.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }

/* Transition utilities */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-shadow { transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Display utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

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

/* Responsive utilities */
@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .sm\:grid { display: grid; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:gap-4 { gap: 1rem; }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:mt-0 { margin-top: 0; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .sm\:block { display: block; }
  .sm\:my-8 { margin-top: 2rem; margin-bottom: 2rem; }
  .sm\:align-middle { vertical-align: middle; }
  .sm\:max-w-lg { max-width: 32rem; }
  .sm\:w-full { width: 100%; }
  .sm\:flex { display: flex; }
  .sm\:flex-row-reverse { flex-direction: row-reverse; }
  .sm\:ml-3 { margin-left: 0.75rem; }
  .sm\:w-auto { width: auto; }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Form utilities */
input, textarea, select {
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Ensure images are visible */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Custom utilities for admin interface */
.space-x-1 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.25rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }
.space-x-4 > :not([hidden]) ~ :not([hidden]) { margin-left: 1rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }

/* Hover utilities */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:shadow-xl:hover { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }

/* Additional admin-specific styles */
.admin-nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.admin-nav-link.active {
  background-color: #3b82f6;
  color: white;
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

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

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

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: #3b82f6;
  border: 1px solid #dbeafe;
}

.btn-ghost:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
  pointer-events: none;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #374151;
}

.modal-body {
  padding: 1.5rem;
}

/* Carousel thumbnail styles */
.carousel-thumbnails {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: center;
}

.carousel-thumbnails::-webkit-scrollbar {
  display: none;
}

.carousel-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 3px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-thumbnail:hover {
  border-color: #93c5fd;
  transform: scale(1.05);
}

.carousel-thumbnail.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.carousel-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.carousel-thumbnail.active img {
  transform: scale(1.1);
}

/* Hero image styles - large main product image */
.hero-image {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  transition: opacity 0.3s ease;
  background-color: var(--color-bg-tertiary);
}

.hero-image.loading {
  opacity: 0.7;
}

/* ========================================
   RESPONSIVE DESIGN SYSTEM
   ======================================== */

/* Mobile-first responsive typography */
@media (max-width: 640px) {
  .hero-image {
    max-height: 300px;
  }

  .p-4 {
    padding: 0.75rem;
  }

  .p-6 {
    padding: 1rem;
  }

  .px-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .py-6 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .mb-6 {
    margin-bottom: 1rem;
  }

  .gap-6 {
    gap: 1rem;
  }

  .gap-4 {
    gap: 0.75rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .btn-primary {
    font-size: 0.875rem;
  }

  /* Mobile carousel adjustments */
  .carousel-thumbnails {
    gap: 0.5rem;
    padding: 0.75rem 0;
  }

  .carousel-thumbnail {
    width: 60px;
    height: 60px;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
  .hero-image {
    max-height: 500px;
  }

  .p-6 {
    padding: 1.25rem;
  }

  .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .py-6 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Desktop responsive adjustments */
@media (min-width: 1024px) {
  .hero-image {
    max-height: 600px;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Large desktop adjustments */
@media (min-width: 1280px) {
  .hero-image {
    max-height: 700px;
  }
}

/* Ultra-wide adjustments */
@media (min-width: 1536px) {
  .hero-image {
    max-height: 800px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }

  .carousel-thumbnail:hover {
    transform: none;
  }
}

/* ===== MACBOOK M4 PRO & HIGH-DPI OPTIMIZATIONS ===== */
/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  .carousel-thumbnail img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  /* Ensure crisp text rendering on high-DPI displays */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

/* MacBook M4 Pro specific optimizations */
@media screen and (min-width: 1440px) and (max-width: 1728px) {
  /* Optimize for MacBook M4 Pro screen size */
  :root {
    --container-max-width: 1400px;
    --container-padding: clamp(1.5rem, 3vw, 2.5rem);
  }
  
  /* Slightly smaller base font size for better density */
  html {
    font-size: clamp(13px, 1.3vw, 16px);
  }
  
  /* Optimize spacing for MacBook M4 Pro */
  :root {
    --space-xs: clamp(0.25rem, 0.4vw, 0.5rem);
    --space-sm: clamp(0.5rem, 0.8vw, 0.75rem);
    --space-md: clamp(0.75rem, 1.2vw, 1rem);
    --space-lg: clamp(1rem, 1.6vw, 1.25rem);
    --space-xl: clamp(1.25rem, 2vw, 1.75rem);
  }
}

/* Ultra-wide display optimizations */
@media screen and (min-width: 1729px) {
  :root {
    --container-max-width: 1600px;
    --container-padding: clamp(2rem, 4vw, 3rem);
  }
  
  /* Larger base font size for ultra-wide displays */
  html {
    font-size: clamp(15px, 1.4vw, 18px);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }

  .carousel-thumbnail:hover {
    transform: none;
  }
  
  /* Larger touch targets for mobile devices */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  input, textarea, select {
    min-height: 44px;
  }
}

/* Print styles */
@media print {
  .hero-image {
    max-height: none;
    break-inside: avoid;
  }

  .btn {
    border: 1px solid #000;
    background: white;
    color: black;
  }
}

/* Product card hover effects */
.product-card:hover {
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  transform: translateY(-2px) scale(1.02);
}

.product-card h3 a:hover {
  color: var(--color-primary-hover) !important;
}

/* Fullscreen button hover effects */
#fullscreen-trigger:hover {
  background-color: rgba(0, 0, 0, 0.9) !important;
  transform: scale(1.05);
}

/* Header buy now button responsive */
@media (max-width: 768px) {
  .header-buy-now {
    margin-left: 0 !important;
    margin-top: var(--space-md);
  }
}

/* Modern compact header styles */
header a:hover {
  color: var(--color-primary-hover) !important;
}

/* Status indicator animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-indicator {
  animation: pulse 2s infinite;
}

/* Compact header responsive */
@media (max-width: 640px) {
  header .container {
    padding: var(--space-sm) var(--space-md) !important;
  }
  
  header div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-sm) !important;
  }
}

/* Ensure proper focus styles */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
