/* File: /asset/css/WeeklyGrid.css */

/* === RESET Y BASE === */
.weekly-grid-desktop, .weekly-grid-mobile {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.4;
  color: #333;
}

/* === DESKTOP GRID === */
.weekly-grid-desktop {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}
.schedule-table th, .schedule-table td{
    width: auto;       /* Se distribuye automáticamente pero de forma equitativa */
  text-align: left;  /* Opcional: Alineación del texto */
  overflow: hidden;  /* Evita que el contenido se desborde */
  text-overflow: ellipsis;
  white-space: nowrap;
    
} 
.schedule-table th {
  background: #111111;
  color: #fff;
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-header {
  width: 100px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
}

.time-period-row {
  height: 250px;
}

.time-label {
  background: #f8f9fa;
  border-right: 2px solid #dee2e6;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  font-size: 16px;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.classes-cell {
  padding: 15px 10px;
  vertical-align: top;
  border-right: 1px solid #dee2e6;
  background: #fafbfc;
  position: relative;
}

.classes-cell:last-child {
  border-right: none;
}

/* === CLASS CARDS === */
.class-card {
  position: relative;
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  min-height: 90px;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.class-card:last-child {
  margin-bottom: 0;
}

.class-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.class-content {
  padding: 12px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Primera línea: Icono + Sede */
.class-venue-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.modality-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Hace los iconos blancos */
  opacity: 0.9;
  flex-shrink: 0;
}

.class-venue {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 500;
  
  flex: 1;
}

/* Segunda línea: Nombre de la clase */
.class-name {
  color: #fff;
  font-weight: 600;
  font-size: 14px;

  line-height: 1.2;
  flex: 1;
}

/* Tercera línea: Horario */
.class-time {
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Monaco', 'Menlo', monospace;
 
}

/* Remover estilos antiguos de modalidad */
.class-modality {
  display: none;
}

/* === MOBILE GRID === */
.weekly-grid-mobile {
  max-width: 480px;
  margin: 0 auto;
}

.day-selector {
  display: flex;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow-x: auto;
}

.day-btn {
  flex: 1;
  min-width: 45px;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  transform: scale(1.05);
}

.day-content {
  display: none;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.day-content.active {
  display: block;
}

.day-content h3 {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  text-align: center;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.time-period {
  margin-bottom: 25px;
}

.time-period:last-child {
  margin-bottom: 0;
}

.time-period h4 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 4px solid #667eea;
  padding-left: 12px;
}

.classes-grid {
  display: grid;
  gap: 12px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .weekly-grid-desktop {
    display: none;
  }
  
  .schedule-table th,
  .time-label {
    font-size: 12px;
    padding: 10px 5px;
  }
  
  .classes-cell {
    padding: 8px 5px;
  }
  
  .class-card {
    min-height: 70px;
  }
  
  .class-content {
    padding: 8px;
  }
  
  .class-name {
    font-size: 12px;
  }
}

@media (min-width: 769px) {
  .weekly-grid-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  .day-btn {
    min-width: 40px;
    padding: 10px 6px;
    font-size: 11px;
  }
  
  .day-content {
    padding: 15px;
  }
  
  .day-content h3 {
    font-size: 20px;
  }
  
  .time-period h4 {
    font-size: 16px;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  .class-card,
  .day-btn {
    transition: none;
  }
  
  .class-card:hover {
    transform: none;
  }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
  .weekly-grid-desktop,
  .weekly-grid-mobile {
    color: #e9ecef;
  }
  
  .schedule-table {
    background: #2c3e50;
  }
  
  .classes-cell {
    background: #34495e;
    border-color: #495057;
  }
  
  .time-label {
    background: #495057;
    color: #e9ecef;
  }
  
  .day-content {
    background: #2c3e50;
  }
  
  .day-content h3 {
    color: #e9ecef;
    border-color: #495057;
  }
}

/* === ICONOS DE MODALIDAD === */
.modality-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Hace los iconos blancos */
  opacity: 0.9;
  flex-shrink: 0;
}

/* Icono híbrido con doble ancho */
.modality-icon.hybrid-icon {
  width: 40px; /* Doble del ancho normal */
}