/* ==============================================================
   RESERVAS-LIST.CSS — TuEstilo
   Lista de Reservas (smart-cards, kebab, badges, filtros)
   Extraído de styles.css (Fase 2 — Refactorización CSS)
   ============================================================== */

.reservas-fixed-date-bar {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--color-surface);
  padding: 0.5rem 1rem 0.5rem 12px;
  margin: 0 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.reservas-fixed-date-bar.hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  .reservas-fixed-date-bar {
    left: 16rem;
  }
}

/* Fecha visible en la lista (donde estaba antes), encima de cada grupo de citas */
.reservas-date-header-in-list {
  padding: 0.5rem 0;
  margin: 0 12px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.reservas-date-header-in-list .reservas-timeline-header {
  margin: 0;
  padding: 0;
}

/* Smart Cards: layout horizontal tipo "ticket" */
.reservas-smart-card {
  display: flex;
  align-items: stretch;
  padding: 10px 12px;
  margin: 0 12px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 1.4;
}

.reservas-smart-card--today {
  border-left: 4px solid #007bff;
}

.reservas-smart-card--past {
  opacity: 0.85;
}

/* Columna Izquierda: Hora (ancho fijo) + separador */
.reservas-smart-card-time {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 10px;
  border-right: 1px solid #eee;
}

.reservas-smart-card-time-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

.reservas-smart-card-duration {
  font-size: 0.7rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

/* Columna Derecha: Info (3 filas compactas) */
.reservas-smart-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-left: 10px;
}

.reservas-smart-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.reservas-smart-card-row--head {
  flex-wrap: nowrap;
  gap: 8px;
}

.reservas-smart-card-client {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservas-smart-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.reservas-smart-card-row--service .reservas-smart-card-service {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
  margin: 0;
}

.reservas-smart-card-row--meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.reservas-smart-card-row--meta .reservas-card-wa {
  width: 28px;
  height: 28px;
}

.reservas-smart-card-row--meta .reservas-wa-icon {
  width: 16px;
  height: 16px;
}

.reservas-smart-card-professional {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.reservas-cat-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

.reservas-cat-badge--pink {
  background: #fce7f3;
  color: #9d174d;
}

.reservas-cat-badge--blue {
  background: var(--color-primary-bg);
  color: #1e40af;
}

/* Toggle vista Lista / Agenda */
.reservas-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
}

.reservas-view-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-light);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.reservas-view-btn:hover {
  transform: translateY(-1px);
}

.reservas-view-btn--active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.reservas-view-icon {
  font-size: 0.9rem;
}

/* Vista Agenda Diaria (estilo Google/Apple Calendar) */
.reservas-agenda-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

/* Selector de fechas horizontal (Date Ribbon - Beunik) */
.agenda-date-section {
  border-bottom: 1px solid var(--color-border-light);
}

.agenda-date-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.agenda-date-header .agenda-date-icon {
  width: 20px;
  height: 20px;
  color: #007bff;
}

.agenda-date-ribbon {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.agenda-date-ribbon::-webkit-scrollbar {
  display: none;
}

.agenda-date-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: transform 0.1s ease;
}

.agenda-date-item:hover {
  transform: scale(1.02);
}

.agenda-date-item:active {
  transform: scale(0.98);
}

.agenda-date-num {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  background-color: var(--color-surface);
  border: 1px solid #007bff;
  color: #007bff;
  box-sizing: border-box;
}

.agenda-date-item.date-active .agenda-date-num {
  background-color: #007bff;
  color: var(--color-surface);
  border: none;
}

.agenda-date-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 4px;
  text-transform: capitalize;
}

.agenda-date-item.date-active .agenda-date-label {
  font-weight: 700;
  color: var(--color-text);
}

/* Barra superior: carrusel de equipo (estilo Instagram Stories) */
.reservas-agenda-staff-scroll.staff-filter-carousel {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.staff-filter-carousel::-webkit-scrollbar {
  display: none;
}

.staff-filter-carousel {
  -webkit-overflow-scrolling: touch;
}

.reservas-agenda-staff-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: 6px 8px 8px;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.reservas-agenda-staff-item:hover {
  border-color: #90caf9;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.reservas-agenda-staff-item--active {
  border-color: #007bff;
  background: #f0f7ff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.reservas-agenda-staff-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  border: 2px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  overflow: hidden;
  box-sizing: border-box;
}

.reservas-agenda-staff-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reservas-agenda-staff-labels {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  max-width: 70px;
  min-height: 2.2em;
}

.reservas-agenda-staff-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reservas-agenda-staff-category {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-placeholder);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reservas-agenda-staff-item--active .reservas-agenda-staff-name {
  color: #007bff;
}

.reservas-agenda-staff-item--active .reservas-agenda-staff-category {
  color: #60a5fa;
}

/* Contenedor principal del timeline: altura mínima para que siempre se vea la cuadrícula */
#reservas-agenda-wrap {
  min-height: 400px;
}

#reservas-agenda-wrap.hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  #reservas-agenda-wrap {
    min-height: 0;
    flex: 0 0 auto;
  }

  #reservas-agenda-wrap .reservas-agenda-inner {
    flex: 0 0 auto;
  }
}

/* === Staff carousel alineado con columnas del grid === */
.staff-filter-carousel.staff-filter-aligned {
  display: flex;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
  overflow-x: visible;
}

/* "Todos" button: match the hours column width */
.staff-filter-aligned .reservas-agenda-staff-item:not(.staff-item-col) {
  flex: 0 0 60px;
  min-width: 60px;
  max-width: 60px;
}

/* Each professional item: equal distribution across the grid area */
.staff-filter-aligned .staff-item-col {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

/* Botón compacto "Bloquear Día" debajo del nombre de cada profesional */
/* Oculto por defecto, visible cuando modo bloqueo está activo */
.staff-block-day-btn {
  display: none;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid #f97316;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(249, 115, 22, 0.15);
}

/* Mostrar cuando el modo bloqueo está activo */
.modo-bloqueo-visible .staff-block-day-btn {
  display: inline-flex;
}

.staff-block-day-btn:hover {
  background: #fed7aa;
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.25);
}

.staff-block-day-btn:active {
  transform: scale(0.95);
}

/* Variante verde para "Desbloquear Día" */
.staff-block-day-btn--unblock {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #15803d;
  box-shadow: 0 1px 3px rgba(34, 197, 94, 0.15);
}

.staff-block-day-btn--unblock:hover {
  background: #bbf7d0;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.25);
}
