/* ==========================================================================
   THE BARBER CLUB - ESTILOS PERSONALIZADOS, RESPONSIVE DESIGN & THEME
   Inspirado en AgendaPro / Dark Barber Lounge Premium (100% Mobile & Desktop)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Paleta Barber Dark Premium */
  --bg-base: #0a0d14;
  --bg-surface: #111722;
  --bg-card: #172030;
  --bg-card-hover: #1e2a3f;
  --border-color: #243147;
  --border-light: #2d3d59;
  
  /* Acentos Dorados Barbería / Cobre */
  --gold-500: #e5a93c;
  --gold-600: #ca8a04;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  
  /* Textos */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Estados */
  --status-pending: #f59e0b;
  --status-confirmed: #3b82f6;
  --status-in-progress: #8b5cf6;
  --status-completed: #10b981;
  --status-cancelled: #ef4444;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-600);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #243147;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #d97706;
}

/* Safe area padding para iPhones y notch Android */
.safe-bottom {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* ==========================================================================
   DROPDOWNS & SELECTS EN MODO OSCURO (Legibilidad 100% en Windows/Chrome)
   ========================================================================== */
select {
  color-scheme: dark !important;
}

select option {
  background-color: #0d121c !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 8px 12px !important;
}

select option:checked,
select option:hover {
  background-color: #d97706 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   CONTROL ESTRICTO DE VISIBILIDAD PARA SUPER ADMIN (RED DE BARBERÍAS)
   ========================================================================== */
body:not(.is-superadmin) .superadmin-only {
  display: none !important;
}

/* Glassmorphism & Cards */
.glass-panel {
  background: rgba(17, 23, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
}

.gold-gradient-bg {
  background: var(--gold-gradient);
}

.gold-text-gradient {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-glow {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.gold-glow-sm {
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.18);
}

/* Badges de Estado de Citas */
.badge-status {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-pendiente {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-confirmada {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-en_atencion {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-finalizada {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cancelada {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Animaciones Fluidas */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.03); }
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s infinite ease-in-out;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE DRAWER UTILITIES
   ========================================================================== */

/* Drawer Sidebar en Mobile */
#app-sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-sidebar.sidebar-open {
  transform: translateX(0) !important;
}

/* Backdrop para Drawer Mobile */
#sidebar-mobile-backdrop.backdrop-active {
  display: block !important;
  opacity: 1 !important;
}

/* Contenedores de tablas con scroll suave horizontal */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Touch targets para móviles (mínimo 42px para pulgares) */
@media (max-width: 768px) {
  button, select, input[type="date"], input[type="time"] {
    min-height: 40px;
  }

  .modal-backdrop > div {
    max-height: 92vh;
    margin: auto 0.75rem;
  }
}

/* ==========================================================================
   IMPRESIÓN TÉRMICA DE TICKETS POS (80mm & 58mm)
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  
  #modal-ticket-receipt, 
  #modal-ticket-receipt * {
    visibility: visible;
  }
  
  #modal-ticket-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0;
    margin: 0;
  }
  
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   MODO PRIVACIDAD (OCULTAR VALORES MONETARIOS)
   ========================================================================== */
body.privacy-mode .privacy-blur {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
}

body.privacy-mode .privacy-blur:hover {
  filter: blur(0);
}
