/* BarberiApp - Portal de Reservas Web */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Roboto:wght@300;400;500&display=swap');

:root {
  --bg-dark: #0f1115;
  --bg-panel: rgba(25, 28, 35, 0.85);
  --accent: #d4af37;
  --accent-hover: #b5952f;
  --text-main: #f8f9fa;
  --text-muted: #a0a4b0;
  --border-light: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(20, 22, 28, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Roboto', sans-serif;
  background-color: #07080a; /* Fondo ultra oscuro para el viewport general en desktop */
  color: var(--text-main);
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-shell {
  width: 100%;
  height: 100%;
  max-width: 600px; /* Ancho óptimo tipo celular/tablet para desktop */
  background-color: var(--bg-dark);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.75);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.test-banner {
  background: rgba(212, 175, 55, 0.05);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 500;
  z-index: 999;
}

.test-banner-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-gold 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-gold {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 10px var(--accent); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

h1, h2, h3, h4, h5 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* HEADER */
.app-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#header-title {
  font-size: 1.2rem;
  margin: 0;
}

/* MAIN CONTENT (STEPS) */
.app-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.step-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  visibility: hidden;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.step-view.active {
  transform: translateX(0);
  visibility: visible;
  z-index: 10;
}

.step-view.slide-left {
  transform: translateX(-100%);
  visibility: hidden;
}

.container {
  padding: 20px 16px;
  padding-bottom: 100px; /* Espacio para botones fijos abajo */
}

/* MAPA */
#step-1-map {
  overflow: hidden; /* El mapa no scrollea con CSS */
}

#map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  z-index: 1;
}

/* Personalización del Popup de Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 12px;
}
.leaflet-popup-tip {
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
}
.leaflet-container a.leaflet-popup-close-button {
  color: var(--text-muted);
}

.bottom-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.bottom-panel.visible {
  transform: translateY(0);
}

.panel-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 15px auto;
}

/* BOTONES */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:active {
  background: var(--accent-hover);
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-text {
  color: var(--accent);
  text-align: center;
  display: block;
  text-decoration: none;
  font-weight: 500;
}

.full-width {
  width: 100%;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

.bottom-action-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  background: linear-gradient(to top, var(--bg-dark) 75%, transparent);
  z-index: 100;
}

/* LISTAS Y TARJETAS (Servicios) */
.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.list-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-item:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(255, 255, 255, 0.02);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(212, 175, 55, 0.05);
}

.card-item.selected {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15), 0 0 15px rgba(212, 175, 55, 0.1);
}

.card-item-info h4 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.card-item-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-item-price {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

/* SLOTS Y BARBEROS */
.date-selector {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.date-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.date-text h4 {
  margin: 0;
  font-size: 1.1rem;
}

.barber-group {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.barber-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.barber-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
}

.barber-info h4 { margin: 0; font-size: 1.1rem; }
.barber-info p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.slot-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 0;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.slot-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.slot-btn.selected {
  background: linear-gradient(135deg, var(--accent) 0%, #b5952f 100%);
  color: #050608;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* FORMULARIO Y RESUMEN */
.summary-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
}

.summary-card h4 {
  margin-bottom: 12px;
  color: var(--accent);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.summary-row span:first-child {
  color: var(--text-muted);
}

.summary-row span:last-child {
  font-weight: 500;
}

.price-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-light);
  font-size: 1.1rem;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: 'Roboto', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.form-group input:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.45);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(212, 175, 55, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* EXITO */
.success-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.success-icon svg {
  width: 40px;
  height: 40px;
}

/* SKELETON LOADERS */
.skeleton-item {
  height: 80px;
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.05) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 16px;
  margin-bottom: 12px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.error-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 14px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
