/**
 * Booking Block Styles
 */

/* Block Container */
.pcc-booking-block {
  margin: 20px 0;
}

/* Filters Accordion */
.pcc-filters-accordion {
  margin-bottom: 20px;
}

.pcc-filters-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #000;
  color: #fff;
  border: 1px solid #ddd;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pcc-filters-toggle:hover {
  background: #000d;
}

.pcc-filters-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.pcc-filters-container {
  background: #f7f7f7;
  padding: 20px;
  margin-top: 0;
  border: 1px solid #ddd;
  border-top: none;
}

.pcc-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.pcc-filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.pcc-filter-group label {
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 0.9em;
}

.pcc-filter-group input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
}

.pcc-filter-actions {
  display: flex;
  gap: 10px;
}

/* Loading */
.pcc-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

/* No Clases */
.pcc-no-clases,
.pcc-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background: #f7f7f7;
  border-radius: 0;
}

/* List View - Table */
.pcc-clases-list-table {
  width: 100%;
  overflow-x: auto;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pcc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.pcc-table thead {
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
}

.pcc-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.pcc-table tbody tr {
  border-bottom: 1px solid #eee;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

.pcc-table tbody tr:hover {
  background-color: #f9f9f9;
}

.pcc-table tbody tr:last-child {
  border-bottom: none;
}

.pcc-table-row-completo {
  opacity: 0.6;
}

.pcc-table tbody td {
  padding: 15px;
  color: #555;
}

.pcc-table-cell-title {
  font-size: 1em;
}

.pcc-badge-completo {
  display: inline-block;
  padding: 3px 8px;
  background: #f44336;
  color: #fff;
  border-radius: 0;
  font-size: 0.75em;
  font-weight: 600;
  margin-top: 5px;
}

.pcc-table .pcc-status-disponible {
  color: #2e7d32;
  font-weight: 600;
}

.pcc-table .pcc-status-agotado {
  color: #f44336;
  font-weight: 600;
}

.pcc-table-btn {
  display: inline-block;
  padding: 8px 16px;
  color: #fff !important;
  text-decoration: none;
  border-radius: 0;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pcc-table-btn:hover {
  background-color: #000;
}

.pcc-table-no-action {
  color: #999;
  font-style: italic;
}

.pcc-reservar-btn {
  display: inline-block;
  padding: 12px 24px;
  color: #fff !important;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pcc-reservar-btn:hover {
  background: #000;
  border-color: #000;
}

.pcc-reservar-btn.disabled {
  background: #000;
  border-color: #000;
  cursor: not-allowed;
  opacity: 0.5;
}

.pcc-reservar-btn.disabled:hover {
  background: #000;
  border-color: #000;
}

/* Grid View (old calendar) */
.pcc-clases-grid {
  display: grid;
  gap: 30px;
}

.pcc-grid-day {
  border: 1px solid #ddd;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}

.pcc-grid-date {
  margin: 0;
  padding: 15px 20px;
  background: #e9001b;
  color: #fff;
  font-size: 1.2em;
}

.pcc-grid-clases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  padding: 20px;
}

/* Calendar View (Monthly) */
.pcc-calendar-view {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 0;
}

/* Calendar Navigation */
.pcc-calendar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: #f9f9f9;
  border-bottom: 2px solid #e0e0e0;
  margin: -20px -20px 20px -20px;
  border-radius: 0;
}

.pcc-calendar-nav button {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #333;
}

.pcc-calendar-nav button:hover {
  background: #e9001b;
  color: #fff;
  border-color: #e9001b;
}

.pcc-calendar-nav button:active {
  transform: scale(0.98);
}

.pcc-calendar-today {
  background: #e9001b !important;
  color: #fff !important;
  border-color: #e9001b !important;
}

.pcc-calendar-today:hover {
  background: #c7001a !important;
}

.pcc-calendar-month {
  width: 100%;
}

.pcc-calendar-header {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.pcc-calendar-title {
  margin: 0;
  font-size: 2em;
  font-weight: 600;
  color: #333;
}

.pcc-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  overflow: hidden;
}

.pcc-calendar-day-header {
  background: #e9001b;
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-weight: 600;
  font-size: 0.9em;
  text-transform: uppercase;
}

.pcc-calendar-cell {
  background: #fff;
  min-height: 120px;
  padding: 8px;
  position: relative;
  transition: background-color 0.2s ease;
}

.pcc-calendar-cell-empty {
  background: #fafafa;
}

.pcc-calendar-cell-today {
  background: #f6f6f6;
}

.pcc-calendar-cell-has-clases {
  background: #f3f3f3;
  cursor: pointer;
}

.pcc-calendar-cell-has-clases:hover {
  background: #d9d9d9;
}

.pcc-calendar-day-number {
  font-weight: 600;
  font-size: 1.1em;
  color: #333;
  margin-bottom: 8px;
}

.pcc-calendar-cell-today .pcc-calendar-day-number {
  color: #d32f2f;
}

.pcc-calendar-day-clases {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pcc-calendar-clase-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #e9001b;
  border-radius: 0;
  padding: 8px;
  font-size: 0.85em;
  transition: all 0.2s ease;
}

.pcc-calendar-clase-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Color will be set inline from clase.color */

.pcc-calendar-clase-time {
  display: block;
  font-weight: 600;
  color: #e9001b;
  margin-bottom: 4px;
}

.pcc-calendar-clase-title {
  display: block;
  color: #333;
  margin-bottom: 4px;
  font-weight: 500;
  line-height: 1.3;
}

.pcc-calendar-clase-places {
  display: inline-block;
  font-size: 0.9em;
  color: #666;
  margin-right: 8px;
}

.pcc-calendar-clase-btn {
  display: inline-block;
  padding: 4px 12px;
  background-color: #000;
  color: #fff !important;
  text-decoration: none;
  border-radius: 0;
  font-size: 0.85em;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.pcc-calendar-clase-btn:hover {
  background: #000;
}

.pcc-calendar-clase-completo {
  display: block;
  font-size: 0.8em;
  color: #f44336;
  font-weight: 600;
  margin-top: 4px;
}

/* Calendar Multiple Clases Indicator */
.pcc-calendar-multiple {
  cursor: pointer;
}

.pcc-calendar-multiple-indicator {
  color: #000;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #e9001b;
  border-radius: 0;
  padding: 8px;
  font-size: 0.85em;
  transition: all 0.2s ease;
}

.pcc-calendar-multiple-indicator:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pcc-calendar-multiple-count {
  display: block;
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 4px;
}

.pcc-calendar-multiple-action {
  display: block;
  font-size: 0.85em;
  text-decoration: underline;
}

/* Modal Overlay */
.pcc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  animation: pccFadeIn 0.2s ease;
}

@keyframes pccFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pcc-modal-content {
  background: #fff;
  border-radius: 0;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 0 2px #000;
  animation: pccSlideUp 0.2s ease;
}

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

.pcc-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #fff;
  border: 2px solid #000;
  font-size: 20px;
  color: #000;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 0;
  transition: all 0.2s ease;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pcc-modal-close:hover {
  background: #e9001b;
  border-color: #e9001b;
  color: #fff;
}

.pcc-modal-title {
  margin: 0;
  padding: 25px 60px 25px 25px;
  border-bottom: 3px solid #e9001b;
  font-size: 1.4em;
  color: #000;
  font-weight: 700;
  background: #fff;
}

.pcc-modal-clases {
  padding: 20px 25px;
}

.pcc-modal-clase-item {
  padding: 20px;
  border: 2px solid #000;
  border-radius: 0;
  margin-bottom: 15px;
  background: #fff;
  transition: all 0.2s ease;
  border-left-width: 4px;
}

.pcc-modal-clase-item:last-child {
  margin-bottom: 0;
}

.pcc-modal-clase-item:hover {
  background: #f9f9f9;
}

.pcc-modal-clase-item.pcc-status-agotado {
  opacity: 0.7;
  background: #f5f5f5;
}

/* Color will be set inline from clase.color */

.pcc-modal-clase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.pcc-modal-clase-header h4 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

.pcc-modal-clase-badge {
  padding: 6px 12px;
  border-radius: 0;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid;
}

.pcc-modal-clase-badge.disponible {
  background: #fff;
  color: #000;
  border-color: #000;
}

.pcc-modal-clase-badge.agotado {
  background: #000;
  color: #fff;
  border-color: #000;
}

.pcc-modal-clase-info {
  margin: 15px 0;
}

.pcc-modal-clase-info p {
  margin: 8px 0;
  color: #555;
  line-height: 1.6;
}

.pcc-modal-clase-info strong {
  color: #333;
}

.pcc-modal-clase-excerpt {
  padding-top: 10px;
  border-top: 1px solid #eee;
  margin-top: 10px;
  font-size: 0.95em;
  line-height: 1.6;
}

.pcc-modal-reservar-btn {
  display: inline-block;
  padding: 12px 24px;
  color: #fff !important;
  text-decoration: none;
  border-radius: 0;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.pcc-modal-reservar-btn:hover {
  background: #000;
}

.pcc-modal-completo {
  display: inline-block;
  padding: 10px 20px;
  background: #000;
  color: #fff;
  border-radius: 0;
  font-weight: 600;
  margin-top: 10px;
  border: 2px solid #000;
}

.pcc-clase-card {
  border: 1px solid #e0e0e0;
  border-left: 4px solid #e9001b;
  padding: 15px;
  border-radius: 0;
  background: #fafafa;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pcc-clase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pcc-clase-card h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1em;
  color: #333;
}

.pcc-clase-time {
  margin: 5px 0;
  color: #666;
  font-weight: 600;
}

.pcc-clase-instructor-small {
  margin: 5px 0;
  color: #555;
  font-size: 0.9em;
}

.pcc-clase-plazas-small {
  margin: 10px 0;
  font-weight: bold;
}

.pcc-clase-plazas-small.pcc-status-disponible {
  color: #2e7d32;
}

.pcc-clase-plazas-small.pcc-status-agotado {
  color: #c62828;
}

.pcc-reservar-btn-small {
  display: block;
  width: 100%;
  padding: 8px 16px;
  color: #fff !important;
  text-align: center;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.pcc-reservar-btn-small:hover {
  background: #000;
}

.pcc-reservar-btn-small.disabled {
  background: #000;
  cursor: not-allowed;
  opacity: 0.5;
}

.pcc-reservar-btn-small.disabled:hover {
  background: #000;
}

/* Ver más button */
.pcc-ver-mas-container {
  margin-top: 2rem;
  text-align: center;
  padding: 20px 0;
}

.pcc-ver-mas-btn,
.pcc-booking-block .button.pcc-ver-mas-btn {
  display: inline-block !important;
  padding: 12px 32px !important;
  background: #000 !important;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease;
  border: 2px solid #000 !important;
  cursor: pointer !important;
}

.pcc-ver-mas-btn:hover,
.pcc-booking-block .button.pcc-ver-mas-btn:hover {
  background: #333 !important;
  border-color: #333 !important;
  color: #fff !important;
}

/* Responsive */
/* Text below calendar */
.pcc-calendar-below-text {
  margin-top: 2.5rem;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-left: 4px solid #e9001b;
  color: #222;
  white-space: pre-wrap;
  font-size: 1.05em;
  line-height: 1.6;
}
@media (max-width: 1024px) {
  /* Make list table mobile-friendly as stacked cards */
  .pcc-clases-list-table {
    overflow: visible;
    box-shadow: none;
    background: transparent;
  }

  .pcc-table {
    border-collapse: separate;
    border-spacing: 0 12px;
    display: block;
  }

  .pcc-table thead { display: none; }
  .pcc-table tbody { display: block; }

  .pcc-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
  }

  .pcc-table tbody td {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    word-break: break-word;
  }

  .pcc-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #333;
  }

  /* Hide label for Accion on mobile, show only button and make it full width */
  .pcc-table tbody td[data-label="Acción"] {
    grid-template-columns: 1fr;
  }
  .pcc-table tbody td[data-label="Acción"]::before {
    content: "";
    display: none;
  }
  .pcc-table tbody td[data-label="Acción"] .pcc-table-btn {
    width: 100%;
  }

  /* Provide labels when data-label is not present */
  .pcc-table tbody td:nth-child(1)::before { content: "Clase"; }
  .pcc-table tbody td:nth-child(2)::before { content: "Fecha"; }
  .pcc-table tbody td:nth-child(3)::before { content: "Horario"; }
  .pcc-table tbody td:nth-child(4)::before { content: "Instructor"; }
  .pcc-table tbody td:nth-child(5)::before { content: "Plazas"; }
  .pcc-table tbody td:nth-child(6)::before { content: "Acción"; }

  .pcc-table-cell-title { font-size: 1.05em; }
  .pcc-table-btn { width: 100%; text-align: center; }

  /* Grid adjusts below 1024 */
  .pcc-grid-clases { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .pcc-filters-form {
    flex-direction: column;
  }

  .pcc-filter-group {
    width: 100%;
  }

  .pcc-filter-actions {
    width: 100%;
  }

  .pcc-filter-actions button {
    flex: 1;
  }

  .pcc-grid-clases {
    grid-template-columns: 1fr;
  }

  /* List table mobile */
  .pcc-clases-list-table {
    overflow-x: auto;
  }

  .pcc-table {
    font-size: 0.85em;
    margin: 0;
  }

  .pcc-table th,
  .pcc-table td {
    padding: 10px 8px;
  }

  .pcc-table-btn {
    padding: 6px 12px;
    font-size: 0.85em;
  }

  /* Calendar mobile styles */
  .pcc-calendar-view {
    padding: 10px;
  }

  .pcc-calendar-nav {
    margin: -10px -10px 15px -10px;
    padding: 10px;
    gap: 8px;
  }

  .pcc-calendar-nav button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .pcc-calendar-prev,
  .pcc-calendar-next {
    flex: 1;
  }

  .pcc-calendar-title {
    font-size: 1.5em;
  }

  .pcc-calendar-day-header {
    padding: 10px 5px;
    font-size: 0.75em;
  }

  .pcc-calendar-cell {
    min-height: 80px;
    padding: 4px;
  }

  .pcc-calendar-day-number {
    font-size: 0.9em;
  }

  .pcc-calendar-clase-item {
    padding: 6px;
    font-size: 0.75em;
  }

  .pcc-calendar-clase-title {
    display: none; /* Hide title on mobile to save space */
  }

  .pcc-calendar-clase-btn {
    padding: 3px 8px;
    font-size: 0.75em;
  }

  .pcc-calendar-multiple-indicator {
    padding: 8px;
  }

  .pcc-calendar-multiple-count {
    font-size: 0.9em;
  }

  .pcc-calendar-multiple-action {
    font-size: 0.75em;
  }

  /* Modal mobile */
  .pcc-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .pcc-modal-title {
    font-size: 1.2em;
    padding: 20px 15px 15px;
  }

  .pcc-modal-clases {
    padding: 15px;
  }

  .pcc-modal-clase-item {
    padding: 15px;
  }

  .pcc-modal-clase-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pcc-modal-clase-header h4 {
    font-size: 1.1em;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .pcc-grid-clases {
    grid-template-columns: repeat(2, 1fr);
  }

  .pcc-calendar-cell {
    min-height: 100px;
  }

  .pcc-calendar-clase-item {
    font-size: 0.8em;
  }
}

@media (min-width: 1025px) {
  .pcc-calendar-cell {
    min-height: 140px;
  }
}
