/* =========================================================
   Módulo de Agendamiento DH2OCOL — Estilos del Calendario
   ========================================================= */

/* ── Página principal ── */
.agendar-page { padding-top: 2rem; padding-bottom: 4rem; }

/* ── Banner de conversión ── */
.banner-club {
  background: linear-gradient(135deg, #008037 0%, #1986c8 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.banner-club.es-miembro { background: linear-gradient(135deg, #1986c8 0%, #1eb8d1 100%); }
.banner-club .banner-text { font-size: 0.95rem; }
.banner-club .btn-banner {
  background: #fff;
  color: #008037;
  font-weight: 700;
  white-space: nowrap;
}
.banner-club.es-miembro .btn-banner { color: #1986c8; }

/* ── Sección del calendario ── */
.calendario-section {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
  border: 1px solid #eef2f5;
}
.calendario-section h5 {
  color: #008037;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* ── Cabecera de navegación del mes ── */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  gap: 0.5rem;
}
.cal-nav .mes-label {
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: capitalize;
  text-align: center;
  flex: 1;
  letter-spacing: 0.2px;
}
.cal-nav button {
  background: #fff;
  border: 1px solid #d9e2ea;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #525861;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.cal-nav button:hover {
  background: #f8f9fa;
  border-color: #b9c7d3;
  transform: translateY(-1px);
}
.cal-nav button:disabled { opacity: 0.35; cursor: default; }

/* ── Grilla del calendario ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-grid .cal-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #525861;
  padding: 2px 0 4px;
  text-transform: uppercase;
}
.cal-grid .cal-day {
  width: clamp(30px, 4.2vw, 38px);
  height: clamp(30px, 4.2vw, 38px);
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: default;
  position: relative;
  border: 1px solid transparent;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
  user-select: none;
}
.cal-day.vacio { visibility: hidden; }
.cal-day.bloqueado { color: #adb5bd; }
.cal-day.disponible {
  background: #d4edda;
  color: #155724;
  cursor: pointer;
  font-weight: 600;
  border-color: #b9e2c6;
}
.cal-day.disponible:hover {
  background: #008037;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(0,128,55,0.28);
}
.cal-day.ocupado {
  background: #f8d7da;
  color: #721c24;
  border-color: #f3c7cc;
}
.cal-day.parcial {
  background: #dbeeff;
  color: #0b4f87;
  cursor: pointer;
  font-weight: 600;
  border-color: #b8dbfb;
}
.cal-day.parcial:hover {
  background: #1986c8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(25,134,200,0.25);
}
.cal-day.solo_miembros {
  background: #fff3cd;
  color: #856404;
  border-color: #f6e4a5;
}
.cal-day.seleccionado {
  outline: 2px solid #0d6efd;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(13,110,253,0.2);
  transform: translateY(-1px);
}
.cal-day.hoy::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1986c8;
}

/* ── Leyenda ── */
.cal-leyenda {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
  margin-top: 1rem;
  font-size: 0.74rem;
}
.cal-leyenda .item { display: flex; align-items: center; gap: 0.35rem; }
.cal-leyenda .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-disponible { background: #008037; }
.dot-ocupado    { background: #dc3545; }
.dot-miembros   { background: #ffc107; }
.dot-parcial    { background: #1986c8; }
.dot-bloqueado  { background: #adb5bd; }

/* ── Slots de horario ── */
.slots-section { margin-top: 1.5rem; }
.slots-section h6 { font-weight: 700; color: #2c3136; margin-bottom: 0.75rem; }
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.slot-btn {
  padding: 0.5rem 0.25rem;
  border-radius: 0.4rem;
  border: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.slot-btn.libre {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
.slot-btn.libre:hover, .slot-btn.libre.activo {
  background: #008037;
  color: #fff;
  border-color: #008037;
}
.slot-btn.ocupado {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
  cursor: not-allowed;
}
.slot-btn.solo-miembros {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeeba;
  cursor: pointer;
  position: relative;
}
.slot-btn.solo-miembros:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* ── Formulario de solicitud ── */
.form-section {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
}
.form-section h5 { color: #008037; font-weight: 700; margin-bottom: 1.25rem; }
.form-section .form-label { font-weight: 600; font-size: 0.9rem; }
.form-section .form-control:focus,
.form-section .form-select:focus {
  border-color: #008037;
  box-shadow: 0 0 0 0.2rem rgba(0,128,55,0.2);
}
.btn-agendar {
  background: #008037;
  border-color: #008037;
  font-weight: 700;
  padding: 0.65rem 2rem;
  font-size: 1rem;
}
.btn-agendar:hover { background: #006a2d; border-color: #006a2d; }
.btn-agendar:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Alerta de fecha seleccionada ── */
.fecha-seleccionada-badge {
  background: #008037;
  color: #fff;
  border-radius: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.75rem;
}

/* ── Sección mis citas (miembros) ── */
.mis-citas-section {
  margin-top: 2.5rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 1.5rem;
}
.mis-citas-section h5 { color: #1986c8; font-weight: 700; margin-bottom: 1rem; }
.cita-card {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}
.cita-card .cita-numero { font-size: 0.75rem; color: #6c757d; }
.cita-card .cita-estado {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
}
.estado-pendiente   { background: #fff3cd; color: #856404; }
.estado-confirmada  { background: #d4edda; color: #155724; }
.estado-cancelada   { background: #f8d7da; color: #721c24; }
.estado-completada  { background: #d1ecf1; color: #0c5460; }
.estado-rechazada   { background: #f8d7da; color: #721c24; }

/* ── Modal de éxito ── */
.modal-exito-icon { font-size: 3.5rem; color: #008037; }

/* ── Loader ── */
.cal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: #6c757d;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .calendario-section { padding: 1rem; border-radius: 0.65rem; }
  .calendario-section h5 { font-size: 0.95rem; margin-bottom: 0.85rem; }
  .cal-nav .mes-label { font-size: 0.9rem; }
  .cal-nav button { width: 30px; height: 30px; }
  .cal-grid { gap: 4px; }
  .cal-grid .cal-day {
    width: clamp(28px, 9.6vw, 34px);
    height: clamp(28px, 9.6vw, 34px);
    font-size: 0.74rem;
    border-radius: 8px;
  }
  .cal-leyenda { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 0.69rem; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .banner-club { flex-direction: column; text-align: center; }
}
