/**
 * Public styles for the Restaurant Reservation plugin.
 */

/* Container */
.rr-reservation-container,
.rr-cancellation-container,
.rr-thanks-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
}

/* Header */
.rr-reservation-header,
.rr-cancellation-header,
.rr-thanks-header {
  text-align: center;
  margin-bottom: 30px;
}

.rr-reservation-header h2,
.rr-cancellation-header h2,
.rr-thanks-header h2 {
  font-size: 28px;
  margin-bottom: 10px;
  color: #333;
}

.rr-reservation-header p,
.rr-cancellation-header p,
.rr-thanks-header p {
  font-size: 16px;
  color: #666;
}

/* Form container */
.rr-reservation-form-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin-bottom: 20px;
}

/* Thanks page styles */
.rr-thanks-content {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 40px;
  text-align: center;
}

.rr-thanks-icon {
  font-size: 64px;
  color: #2ecc71;
  margin-bottom: 20px;
}

.rr-thanks-title {
  font-size: 32px;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 600;
}

.rr-thanks-message {
  font-size: 18px;
  color: #7f8c8d;
  margin-bottom: 30px;
  line-height: 1.6;
}

.rr-reservation-details {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
  margin: 30px 0;
  text-align: left;
}

.rr-reservation-details h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 20px;
  text-align: center;
}

.rr-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
}

.rr-detail-row:last-child {
  border-bottom: none;
}

.rr-detail-label {
  font-weight: 600;
  color: #34495e;
}

.rr-detail-value {
  color: #2c3e50;
  font-weight: 500;
}

.rr-thanks-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.rr-calendar-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rr-calendar-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: white;
  text-decoration: none;
}

.rr-home-button {
  background-color: #95a5a6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.rr-home-button:hover {
  background-color: #7f8c8d;
  transform: translateY(-2px);
  color: white;
  text-decoration: none;
}

/* Form rows */
.rr-form-row {
  margin-bottom: 20px;
}

.rr-form-row label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.rr-form-row input[type="text"],
.rr-form-row input[type="email"],
.rr-form-row input[type="tel"],
.rr-form-row input[type="number"],
.rr-form-row select,
.rr-form-row textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.rr-form-row input:focus,
.rr-form-row select:focus,
.rr-form-row textarea:focus {
  border-color: #e74c3c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

/* Phone input container */
.rr-phone-input-container {
  display: flex;
  gap: 10px;
}

.rr-phone-prefix {
  width: 140px;
  flex-shrink: 0;
}

.rr-phone-prefix select {
  width: 100%;
  height: 100%;
}

/* Date and time row */
.rr-form-date-time {
  display: flex;
  gap: 20px;
}

.rr-form-date,
.rr-form-time {
  flex: 1;
}

/* Required field indicator */
.required {
  color: #e74c3c;
}

/* Submit button */
.rr-submit-button,
.rr-button {
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  display: inline-block;
  text-decoration: none;
}

.rr-submit-button:hover,
.rr-button:hover {
  background-color: #c0392b;
}

.rr-submit-button:disabled {
  background-color: #f5b8b1;
  cursor: not-allowed;
}

.rr-button-cancel {
  background-color: #e74c3c;
}

.rr-button-cancel:hover {
  background-color: #c0392b;
}

.rr-button-back {
  background-color: #7f8c8d;
  margin-left: 10px;
}

.rr-button-back:hover {
  background-color: #6c7a7a;
}

/* Loading indicator */
.rr-loading {
  display: inline-block;
  margin-left: 10px;
  color: #666;
}

/* Response messages */
.rr-response-message {
  padding: 15px;
  border-radius: 4px;
  margin-top: 20px;
}

.rr-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  padding: 15px;
  border-radius: 4px;
}

.rr-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 15px;
  border-radius: 4px;
}

/* Cancellation styles */
.rr-cancellation-details {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.rr-cancellation-details h3 {
  margin-top: 0;
  color: #333;
}

.rr-cancellation-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rr-cancellation-details li {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.rr-cancellation-details li:last-child {
  border-bottom: none;
}

.rr-cancellation-confirm {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
}

.rr-cancellation-confirm p {
  font-size: 18px;
  margin-bottom: 20px;
}

.rr-cancellation-success,
.rr-cancellation-error,
.rr-cancellation-info {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
}

.rr-success-icon,
.rr-error-icon,
.rr-info-icon {
  margin-bottom: 20px;
}

.rr-success-icon svg {
  color: #2ecc71;
}

.rr-error-icon svg {
  color: #e74c3c;
}

.rr-info-icon svg {
  color: #3498db;
}

.rr-cancellation-success h3,
.rr-cancellation-error h3,
.rr-cancellation-info h3 {
  font-size: 24px;
  margin-bottom: 15px;
}

.rr-cancellation-success p,
.rr-cancellation-error p,
.rr-cancellation-info p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #666;
}

/* Time slot unavailable styles */
.rr-time-unavailable {
  color: #999 !important;
  text-decoration: line-through;
  font-style: italic;
}

/* ---------------------------------------------------------------------------
 * Blindaje del calendario frente a los estilos del tema.
 *
 * jQuery UI inyecta el calendario en <body> con el id #ui-datepicker-div, fuera
 * del contenedor del plugin. Las reglas de arriba usan selectores de clase
 * (.ui-datepicker), así que cualquier regla del tema sobre ese id las gana por
 * especificidad: de ahí el fondo oscuro y los números ilegibles.
 *
 * El JS le añade la clase .rr-datepicker en beforeShow, y estas reglas combinan
 * id + clase para ganar siempre. El !important cubre el caso de que el tema
 * también lo use.
 * ------------------------------------------------------------------------ */

#ui-datepicker-div.rr-datepicker,
#ui-datepicker-div.rr-datepicker .ui-datepicker-header,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar thead,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar tbody,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar tr,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar td {
  background: #ffffff !important;
  background-image: none !important;
  border: none !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-header {
  border-bottom: 1px solid #f0f0f0 !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-title,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar th {
  color: #333333 !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar td a,
#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar td span {
  color: #333333 !important;
  background: transparent !important;
  text-shadow: none !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar td a:hover {
  background: #ffe6e6 !important;
  color: #e74c3c !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar .ui-state-active {
  background: #e74c3c !important;
  color: #ffffff !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar .ui-datepicker-today a {
  background: #fff5f5 !important;
  color: #e74c3c !important;
  border: 2px solid #e74c3c !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-calendar .ui-state-disabled span,
#ui-datepicker-div.rr-datepicker .ui-datepicker-other-month span,
#ui-datepicker-div.rr-datepicker .ui-datepicker-other-month a {
  color: #c7c7c7 !important;
}

/* Flechas de navegación */
#ui-datepicker-div.rr-datepicker .ui-datepicker-prev,
#ui-datepicker-div.rr-datepicker .ui-datepicker-next {
  background: #e74c3c !important;
  border: none !important;
}

#ui-datepicker-div.rr-datepicker .ui-datepicker-prev:hover,
#ui-datepicker-div.rr-datepicker .ui-datepicker-next:hover {
  background: #c0392b !important;
}

/* Días en los que el restaurante no abre */
#ui-datepicker-div.rr-datepicker td.rr-day-closed,
#ui-datepicker-div.rr-datepicker td.rr-day-closed span {
  background: #f7f7f8 !important;
  color: #bdbdbd !important;
  cursor: not-allowed;
}

/* Responsive styles */
@media (max-width: 768px) {
  .rr-form-date-time {
    flex-direction: column;
    gap: 10px;
  }

  .rr-reservation-form-container,
  .rr-cancellation-confirm,
  .rr-cancellation-success,
  .rr-cancellation-error,
  .rr-cancellation-info,
  .rr-thanks-content {
    padding: 20px;
  }

  .rr-button-back {
    margin-left: 0;
    margin-top: 10px;
    display: block;
  }

  .rr-phone-input-container {
    flex-direction: column;
    gap: 10px;
  }

  .rr-phone-prefix {
    width: 100%;
  }

  .rr-thanks-actions {
    flex-direction: column;
    align-items: center;
  }

  .rr-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Datepicker Styles Mejorados - Sin borde negro, con sombra sutil */
.ui-datepicker {
  background: #ffffff;
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
  width: 320px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
    sans-serif;
  overflow: hidden;
}

.ui-datepicker-header {
  background: #ffffff;
  color: #333333;
  border: none;
  border-radius: 0;
  padding: 20px 24px 16px;
  margin: 0;
  position: relative;
  text-align: left; /* Alineado a la izquierda */
  border-bottom: 1px solid #f0f0f0;
}

.ui-datepicker-title {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: #333333;
  margin: 0;
  text-align: left; /* Título alineado a la izquierda */
}

.ui-datepicker-prev,
.ui-datepicker-next {
  cursor: pointer;
  position: absolute;
  top: 16px;
  width: 35px; /* Reducido 80% del tamaño original (44px * 0.8 ≈ 35px) */
  height: 35px;
  border-radius: 10px; /* Proporcionalmente reducido */
  background: #e74c3c;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-indent: -9999px;
  overflow: hidden;
  border: none;
}

.ui-datepicker-prev {
  right: 65px; /* Ajustado para el nuevo tamaño */
}

.ui-datepicker-next {
  right: 20px;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
  background: #c0392b;
  transform: scale(1.05);
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ui-datepicker-prev span {
  border-width: 6px 8px 6px 0; /* Reducido proporcionalmente */
  border-color: transparent white transparent transparent;
}

.ui-datepicker-next span {
  border-width: 6px 0 6px 8px; /* Reducido proporcionalmente */
  border-color: transparent transparent transparent white;
}

.ui-datepicker-calendar {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: white;
}

.ui-datepicker-calendar thead {
  background: #ffffff;
}

.ui-datepicker-calendar th {
  padding: 16px 8px;
  text-align: center;
  font-weight: 600;
  color: #666666;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  border: none;
  background: #f8f9fa;
}

.ui-datepicker-calendar td {
  padding: 0;
  text-align: center;
  border: none;
  position: relative;
  width: 14.28%;
}

.ui-datepicker-calendar a {
  display: block;
  padding: 12px 8px;
  text-decoration: none;
  color: #333333;
  font-weight: 500;
  border-radius: 0;
  margin: 0;
  transition: all 0.2s ease;
  position: relative;
  min-height: 20px;
  line-height: 20px;
  font-size: 16px;
}

.ui-datepicker-calendar a:hover {
  background: #ffe6e6;
  color: #e74c3c;
}

.ui-datepicker-calendar .ui-state-active {
  background: #e74c3c;
  color: white;
  font-weight: 600;
}

.ui-datepicker-calendar .ui-state-active:hover {
  background: #c0392b;
  color: white;
}

.ui-datepicker-calendar .ui-state-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.ui-datepicker-calendar .ui-state-disabled a {
  color: #cccccc;
  background: transparent;
}

.ui-datepicker-calendar .ui-datepicker-today a {
  background: #fff5f5;
  color: #e74c3c;
  font-weight: 600;
  border: 2px solid #e74c3c;
}

.ui-datepicker-calendar .ui-datepicker-today a:hover {
  background: #e74c3c;
  color: white;
  border-color: #e74c3c;
}

/* Other month dates */
.ui-datepicker-other-month a {
  color: #cccccc !important;
  opacity: 0.5;
}

/* Animation for calendar appearance */
.ui-datepicker {
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide default month/year dropdowns */
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
  display: none;
}

.ui-datepicker-title select {
  display: none;
}

/* Custom styles for input field */
#rr-date {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

#rr-date:focus {
  border-color: #e74c3c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ui-datepicker {
    width: 300px;
  }

  .ui-datepicker-header {
    padding: 16px 20px 12px;
  }

  .ui-datepicker-title {
    font-size: 20px;
  }

  .ui-datepicker-prev,
  .ui-datepicker-next {
    width: 32px;
    height: 32px;
    top: 12px;
  }

  .ui-datepicker-prev {
    right: 58px;
  }

  .ui-datepicker-next {
    right: 16px;
  }
}

/* Botón de cancelar reserva */
.rr-cancel-button {
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rr-cancel-button:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
  color: white;
  text-decoration: none;
}
