/* =====================================================
   CALENDARIO - Estilos específicos del calendario
   ===================================================== */

.ci_4a7b2e_booking_booking-agenda-calendar {
  /* =====================================================
   CONTENEDOR PRINCIPAL DEL CALENDARIO
   ===================================================== */

  .booking-agenda-calendar {
    max-width: 600px;
    margin: 0 auto;
    font-family: var(--font-family);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-2xl);
    font-size: var(--font-size-base);
  }

  /* =====================================================
   CONTENEDOR DEL CALENDARIO
   ===================================================== */

  .calendar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
  }

  #booking-calendar {
    background: none;
    border: 1px solid var(--calendar-border-color);
    overflow: hidden;
    width: var(--calendar-width);
    border-radius: var(--calendar-border-radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  }

  /* =====================================================
   OVERLAY DE CARGA DEL CALENDARIO
   ===================================================== */

  .calendar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
  }

  .loading-spinner {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  /* =====================================================
   ENCABEZADO DEL CALENDARIO
   ===================================================== */

  .booking-calendar-header {
    background: var(--calendar-header-bg);
    color: var(--calendar-title-color);
    border-bottom: 1px solid var(--calendar-border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .booking-calendar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--calendar-title-color);
  }

  /* Botones de navegación */
  .btn-calendar-nav {
    background: none;
    border: none;
    color: var(--calendar-arrow-color);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
  }

  .btn-calendar-nav:hover {
    background: rgba(0, 0, 0, 0.1);
  }

  .btn-calendar-nav:disabled,
  .btn-calendar-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--calendar-disabled-color);
  }

  .btn-calendar-nav:disabled:hover,
  .btn-calendar-nav.disabled:hover {
    background: none;
  }

  /* =====================================================
   TABLA DEL CALENDARIO (ESTRUCTURA CLÁSICA)
   ===================================================== */

  .booking-calendar-table {
    width: 100%;
  }

  .booking-calendar-table th {
    background: var(--calendar-header-bg);
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: var(--calendar-title-color);
    border-bottom: 1px solid var(--calendar-border-color);
  }

  .booking-calendar-table td {
    padding: 0;
    text-align: center;
    border: 1px solid #f3f4f6;
    height: 36px;
    vertical-align: middle;
  }

  /* =====================================================
   DÍAS DEL CALENDARIO
   ===================================================== */

  .calendar-day {
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--calendar-text-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Estados de los días */
  .calendar-day.available {
    background: var(--calendar-available-bg);
    color: var(--calendar-text-color);
  }

  .calendar-day.available:hover {
    background: var(--calendar-hover-color);
    color: var(--calendar-hover-text-color);
  }

  .calendar-day.selected {
    background: var(--calendar-primary-color);
    color: var(--calendar-selected-text-color) !important;
  }

  .calendar-day.today.selected {
    color: var(--calendar-selected-text-color) !important;
    background: var(--calendar-primary-color);
  }

  .calendar-day.today::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--calendar-primary-color);
    border-radius: 50%;
  }

  .calendar-day.today.selected::after {
    background: white;
  }

  .calendar-day.past {
    color: var(--calendar-past-color);
    cursor: not-allowed;
  }

  .calendar-day.disabled {
    color: var(--calendar-disabled-color);
    cursor: not-allowed;
    background: var(--calendar-disabled-bg);
  }

  /* =====================================================
   INFORMACIÓN DE FECHA SELECCIONADA
   ===================================================== */

  .selected-date-info {
    background: none;
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--calendar-border-color);
  }
  .selected-date-info strong {
    color: var(--text-color);
  }
  /* =====================================================
   ACCIONES DEL CALENDARIO
   ===================================================== */

  .calendar-actions {
    margin-bottom: 24px;
  }

  .calendar-actions h4 {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    font-family: var(--font-family);
  }

  .calendar-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    outline: none;
    transition: all 0.3s ease;
  }

  .calendar-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .calendar-btn:focus {
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
    transform: translateY(-1px);
  }

  .calendar-btn:active {
    transform: translateY(0);
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.1)
    );
  }

  .calendar-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  /* Colores específicos para diferentes tipos de calendario */
  .google-cal:hover {
    border-color: #4285f4;
    color: #4285f4;
  }

  .outlook-cal:hover {
    border-color: #0078d4;
    color: #0078d4;
  }

  .apple-cal:hover {
    border-color: #007aff;
    color: #007aff;
  }

  /* =====================================================
   CALENDARIO UNIFICADO - Nueva estructura con grid
   ===================================================== */

  /* Contenedor principal del calendario unificado */
  .booking-calendar-unified,
  .calendar-preview {
    background: white;
    border: 1px solid var(--calendar-border-color);
    border-radius: var(--calendar-border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    width: var(--calendar-width);
    font-family: var(
      --font-family,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      Roboto,
      Oxygen,
      Ubuntu,
      Cantarell,
      sans-serif
    );
  }

  /* Encabezado del calendario unificado */
  .booking-calendar-unified .calendar-header,
  .calendar-preview .calendar-header {
    background: var(--calendar-header-bg);
    color: var(--calendar-title-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--calendar-border-color);
  }

  /* Título del mes/año */
  .booking-calendar-unified .month-year,
  .calendar-preview .month-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--calendar-title-color);
    margin: 0;
  }

  /* Botones de navegación del calendario unificado */
  .booking-calendar-unified .calendar-nav,
  .calendar-preview .calendar-nav {
    background: none;
    border: none;
    color: var(--calendar-arrow-color);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    line-height: 1;
  }

  .booking-calendar-unified .calendar-nav:hover,
  .calendar-preview .calendar-nav:hover {
    background: rgba(0, 0, 0, 0.1);
  }

  .booking-calendar-unified .calendar-nav:disabled,
  .booking-calendar-unified .calendar-nav.disabled,
  .calendar-preview .calendar-nav:disabled,
  .calendar-preview .calendar-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--calendar-disabled-color);
  }

  .booking-calendar-unified .calendar-nav:disabled:hover,
  .booking-calendar-unified .calendar-nav.disabled:hover,
  .calendar-preview .calendar-nav:disabled:hover,
  .calendar-preview .calendar-nav.disabled:hover {
    background: none;
  }

  /* Grid del calendario unificado */
  .booking-calendar-unified .calendar-grid,
  .calendar-preview .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
  }

  /* Encabezados de días */
  .booking-calendar-unified .day-header,
  .calendar-preview .day-header {
    background: var(--calendar-header-bg);
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--calendar-title-color);
    border-bottom: 1px solid var(--calendar-border-color);
  }

  /* Celdas de días del calendario unificado */
  .booking-calendar-unified .calendar-day,
  .calendar-preview .calendar-day {
    padding: 0;
    margin: 0;
    border: none;
    color: var(--calendar-text-color);
    text-align: center;
    font-size: 14px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    border-right: 1px solid var(--calendar-border-color);
    border-bottom: 1px solid var(--calendar-border-color);
    transition: all 0.2s ease;
  }

  /* Celdas vacías */
  .booking-calendar-unified .calendar-day.empty,
  .calendar-preview .calendar-day.empty {
    background: var(--calendar-empty-bg);
    pointer-events: none;
  }

  /* Días disponibles (solo frontend) */
  .booking-calendar-unified .calendar-day.available {
    color: var(--calendar-text-color);
    cursor: pointer;
    background: var(--calendar-available-bg);
  }

  .booking-calendar-unified .calendar-day.available:hover {
    background: var(--calendar-hover-color);
    color: var(--calendar-text-color);
  }

  /* Días seleccionados en calendario unificado */
  .booking-calendar-unified .calendar-day.selected,
  .calendar-preview .calendar-day.selected {
    background: var(--calendar-primary-color);
    color: var(--calendar-selected-text-color);
    z-index: 1;
    position: relative;
  }

  /* Día actual en calendario unificado */
  .booking-calendar-unified .calendar-day.today,
  .calendar-preview .calendar-day.today {
    position: relative;
  }

  .booking-calendar-unified .calendar-day.today.selected,
  .calendar-preview .calendar-day.today.selected {
    color: var(--calendar-selected-text-color);
    background: var(--calendar-primary-color);
  }

  .booking-calendar-unified .calendar-day.today::after,
  .calendar-preview .calendar-day.today::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--calendar-primary-color);
    border-radius: 50%;
  }

  .booking-calendar-unified .calendar-day.today.selected::after,
  .calendar-preview .calendar-day.today.selected::after {
    background: white;
  }

  /* Días pasados en calendario unificado */
  .booking-calendar-unified .calendar-day.past,
  .calendar-preview .calendar-day.past {
    color: var(--calendar-disabled-color);
    cursor: not-allowed;
    background: var(--calendar-disabled-bg);
  }
  /* Días deshabilitados */
  .booking-calendar-unified .calendar-day.disabled,
  .calendar-preview .calendar-day.disabled {
    color: var(--calendar-disabled-color);
    background: var(--calendar-disabled-bg);
    color: var(--calendar-disabled-color);
    cursor: not-allowed;
  }

  /* Eliminar borde en la última columna y fila */
  .booking-calendar-unified .calendar-day:nth-child(7n),
  .calendar-preview .calendar-day:nth-child(7n) {
    border-right: none;
  }

  .booking-calendar-unified .calendar-day:nth-last-child(-n + 7),
  .calendar-preview .calendar-day:nth-last-child(-n + 7) {
    border-bottom: none;
  }

  /* =====================================================
   RESPONSIVE - ESTILOS MÓVILES PARA CALENDARIO
   ===================================================== */

  @media (max-width: 768px) {
    #booking-calendar {
      max-width: 100%;
    }

    .booking-calendar-table th,
    .booking-calendar-table td {
      padding: 8px 4px;
      font-size: 12px;
    }

    .calendar-day {
      font-size: 12px;
    }

    .calendar-buttons {
      gap: 6px;
    }

    .calendar-btn {
      padding: 8px 12px;
      font-size: 13px;
    }
  }

  @media (max-width: 480px) {
    .calendar-actions {
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 20px;
    }

    .calendar-btn {
      padding: 14px 16px;
      font-size: 14px;
      border-radius: 8px;
    }

    .calendar-actions .calendar-btn svg {
      width: 18px;
      height: 18px;
    }
  }

  @media (min-width: 480px) {
    .calendar-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .calendar-btn:last-child {
      grid-column: 1 / -1;
    }
  }

  /* Mejoras para hover en desktop */
  @media (hover: hover) {
    .calendar-actions .calendar-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
  }
}
