:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  width: 100%;
  max-width: 900px;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
}

header p {
  margin: 0;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

select,
input,
textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary-color);
}

select:disabled,
input:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
}

.slots-container {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
}

.slot-btn {
  background: white;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.slot-btn:hover {
  background: #eff6ff;
}

.slot-btn.selected {
  background: var(--primary-color);
  color: white;
}

.hidden {
  display: none !important;
}

#bookingForm {
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#selectedSlotText {
  font-weight: bold;
  color: var(--primary-color);
  margin-top: -0.5rem;
}

.primary-btn {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: var(--secondary-color);
}

.success-box {
  text-align: center;
  padding: 2rem;
}

.success-box h2 {
  color: #16a34a;
}

.error-box {
  text-align: center;
  padding: 2rem;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  color: #c53030;
}

.error-box h2 {
  color: #e53e3e;
  margin-bottom: 0.5rem;
}

.error-box p {
  color: #742a2a;
}

/* Modal Styles */
.modal {
  display: flex !important;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background-color: #fefefe;
  padding: 30px;
  border: 1px solid #888;
  width: 90%;
  max-width: 400px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-btn {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  color: #333;
  text-decoration: none;
}

/* Calendar Styles */
#calendar-container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.fc-event {
  cursor: pointer;
  border-radius: 4px;
}

.fc-event-available {
  background-color: #27ae60 !important;
  border-color: #2ecc71 !important;
}

.fc-day-selected {
  background-color: var(--primary-color) !important;
  color: white !important;
}

.fc-day-selected a {
  color: white !important;
}

.fc-event-busy {
  background-color: #e74c3c !important;
  border-color: #c0392b !important;
  opacity: 0.6;
  cursor: not-allowed;
}

.fc-timegrid-slot {
  height: 3em !important;
  /* Haz que los slots se vean más grandes en móvil */
}

.fc-non-business {
  background-color: rgba(0, 0, 0, 0.05) !important;
  /* Sombreado para horas no laborales */
}

/* --- CAL.COM LAYOUT STYLES --- */

.layout-calcom {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  align-items: flex-start;
}

.calendar-column {
  flex: 1;
  min-width: 300px;
}

.time-slots-column {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  border-left: 1px solid var(--border-color);
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
}

#selectedDateTitle {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Estilos para los botones de las horas a la derecha */
.slots-container.vertical-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  max-height: 400px;
  /* Ajusta según el tamaño de tu calendario */
  padding-right: 10px;
}

.time-slot-btn {
  background: white;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  transition: all 0.2s ease-in-out;
  width: 100%;
}

.time-slot-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.time-slot-btn:active {
  transform: translateY(0);
}

/* Responsividad para móviles */
@media (max-width: 768px) {
  .layout-calcom {
    flex-direction: column;
    gap: 1rem;
  }

  .time-slots-column {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 1rem;
    min-width: 100%;
    max-width: 100%;
  }

  .slots-container.vertical-list {
    max-height: 300px;
  }
}