/* ========================================
   Baróne App — Global Styles
   Version: 1.0.0
   ======================================== */

/* -----------------------------------------
   CSS Variables - Dark Theme (default)
   Escala de grises con negro #000000 como principal
   ----------------------------------------- */
:root {
  /* Theme Mode */
  --theme: dark;
  
  /* Colors - Primary (inverted for dark) */
  --color-black: #000000;
  --color-white: #ffffff;
  
  /* Dark Theme Grays (inverted scale) */
  --color-gray-50: #0a0a0a;
  --color-gray-100: #141414;
  --color-gray-200: #1f1f1f;
  --color-gray-300: #2a2a2a;
  --color-gray-400: #404040;
  --color-gray-500: #6b6b6b;
  --color-gray-600: #8a8a8a;
  --color-gray-700: #a3a3a3;
  --color-gray-800: #c4c4c4;
  --color-gray-900: #e5e5e5;
  
  /* Theme-aware colors */
  --color-bg: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-bg-card: #141414;
  --color-bg-elevated: #1f1f1f;
  --color-text: #e5e5e5;
  --color-text-secondary: #a3a3a3;
  --color-text-muted: #6b6b6b;
  --color-border: #2a2a2a;
  --color-border-light: #1f1f1f;
  
  /* Colors - Semantic */
  --color-primary: #ffffff;
  --color-primary-bg: #1f1f1f;
  --color-danger: #ef4444;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
  /* Reemplazo de color-mix(oklab) para compatibilidad móvil (sin color-mix) */
  --client-status-badge-hover-bg: rgba(10, 10, 10, 0.7);
  
  /* Colors - Barbers (defaults) */
  --barber-color-1: #3b82f6;
  --barber-color-2: #10b981;
  --barber-color-3: #f59e0b;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows (subtle for dark theme) */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease-out;
  
  /* Z-index layers */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-drawer: 60;
  --z-tooltip: 70;
  /* Por encima de toda la app; usado con x-teleport="body" (evita recorte por overflow en móvil) */
  --z-modal-portal: 10000;
  
  /* Layout */
  --app-max-width-mobile: 480px;
  --app-max-width-tablet: 640px;
  --app-max-width-desktop: 900px;
  --app-max-width-wide: 1100px;

  /* Desktop Layout */
  --sidebar-width-expanded: 220px;
  --sidebar-width-collapsed: 64px;
  --subheader-height: 52px;
}

/* -----------------------------------------
   Light Theme
   ----------------------------------------- */
[data-theme="light"] {
  --theme: light;
  
  /* Light Theme Grays */
  --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;
  
  /* Theme-aware colors */
  --color-bg: #f3f4f6;
  --color-bg-secondary: #f9fafb;
  --color-bg-card: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-text: #111827;
  --color-text-secondary: #374151;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  
  /* Colors - Semantic */
  --color-primary: #000000;
  --color-primary-bg: #f3f4f6;
  --client-status-badge-hover-bg: rgba(249, 250, 251, 0.7);
  
  /* Shadows (normal for light theme) */
  --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);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* -----------------------------------------
   Reset & Base
   ----------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--color-bg);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* -----------------------------------------
   Typography
   ----------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin: 0;
}

/* -----------------------------------------
   Utilities
   ----------------------------------------- */

/* Scrollbar hidden */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Snap scroll */
.snap-y {
  scroll-snap-type: y mandatory;
}
.snap-center {
  scroll-snap-align: center;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

/* Screen reader only */
.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;
}

/* Hidden utility */
.hidden {
  display: none;
}

/* Alpine.js cloak (evita parpadeo inicial) */
[x-cloak] {
  display: none !important;
}

/* -----------------------------------------
   Transitions
   ----------------------------------------- */
.transition-transform {
  transition: transform var(--transition-slow);
}

.transition-opacity {
  transition: opacity var(--transition-base);
}

.transition-all {
  transition: all var(--transition-base);
}

/* Alpine.js transition helpers */
.transition {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-200 {
  transition-duration: 200ms;
}

.duration-300 {
  transition-duration: 300ms;
}

.duration-150 {
  transition-duration: 150ms;
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* Transform utilities */
.translate-x-full {
  transform: translateX(100%);
}

.translate-x-0 {
  transform: translateX(0);
}

.translate-y-full {
  transform: translateY(100%);
}

.translate-y-0 {
  transform: translateY(0);
}

/* Scale on active */
.active-scale:active {
  transform: scale(0.95);
}

/* ─── Desktop Layout ≥1024px ──────────────────────────── */
@media (min-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .desktop-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }

  .desktop-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .bottom-nav {
    display: none !important;
  }
}

/* Móvil: wrappers transparentes al layout */
@media (max-width: 1023px) {
  .desktop-body  { display: contents; }
  .desktop-right { display: contents; }
}
