/* === ESTILOS GENERALES === */
.calendar-title{
    font-family: "Sora", Sans-serif;
    font-size: 54px;
    font-weight: 600;
    line-height: 68px;
    color: #FFFFFF;
}

.cws-wrapper {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 1200px;
  margin: 16px auto;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cws-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fbff;
  border-radius: 10px;
  border: 1px solid #eaf4ff;
}

.cws-controls label {
  font-weight: 700;
  margin-right: 8px;
  font-size: 16px;
  color: #1a365d;
  flex: 0 0 auto;
}

.cws-controls select,
.cws-controls input {
  padding: 10px 14px;
  border: 1px solid #c2d9f0;
  border-radius: 8px;
  font-size: 16px;
  min-width: 200px;
  background: #fff;
  color: #2c3e50;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .cws-controls input,
  .cws-controls select {
    font-size: 16px !important;
  }
}

#cws-clear {
  padding: 10px 18px;
  background: #352FEE;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s;
  flex: 0 0 auto;
}

#cws-clear:hover {
  background: #2F88EE;
}

/* === GRILLA DE HORARIOS (NUEVO SISTEMA) === */
.cws-grid-container {
    position: relative;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-x: auto;
}

.cws-grid {
    display: grid;
    grid-template-columns: 110px repeat(6, 1fr);
    gap: 0;/* La primera columna es para las horas, las siguientes 6 son para los días */
}

.cws-grid-header,
.cws-grid-cell {
    min-height: 60px;
    border: 1px solid #eef3fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #2c3e50;
    padding: 8px; /* Padding interno para separar el texto del borde */
    box-sizing: border-box; /* Importante para que el padding no aumente el tamaño */
}

.cws-grid-header {
    background: #f5f7fb;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cws-timecell {
    background: #fff;
    font-weight: 600;
    width: 110px;
    min-width: 110px; /* Aseguramos que no se contraiga */
}

/* === BLOQUE DE ESPECIALIDAD (REEMPLAZA AL CHIP) === */
.cws-specialty-block {
    border-radius: 4px;
    padding: 8px 12px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    word-break: break-word; /* ¡CLAVE! Rompe palabras largas */
    white-space: normal; /* Permite que el texto se envuelva */
    cursor: default;
    z-index: 1;
    overflow: hidden; /* Oculta el desbordamiento si es necesario */
    min-width: 0; /* Evita que el bloque fuerce un ancho mínimo */
    flex: 1 1 auto; /* Se adapta al contenido */
}

.cws-block-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}

.cws-block-time {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.2;
}

.cws-specialty-block:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
    z-index: 2;
}


/* === PALETA MÉDICA FRÍA (colores únicos por especialidad) === */
.cws-color-Cardiología { background: #1E88E5; }
.cws-color-Coloproctología { background: #0288D1; }
.cws-color-Cirugía-Vascular { background: #00ACC1; }
.cws-color-Endocrinología { background: #26A69A; }
.cws-color-Fisioterapia { background: #4DB6AC; }
.cws-color-Gastroenterología { background: #00897B; }
.cws-color-Ginecología { background: #3949AB; }
.cws-color-Maxilofacial { background: #5E35B1; }
.cws-color-Medicina-General { background: #455A64; }
.cws-color-Medicina-Interna { background: #546E7A; }
.cws-color-Neurocirugía { background: #7E57C2; }
.cws-color-Neurología-Pediátrica { background: #673AB7; }
.cws-color-Nutrición { background: #2E7D32; }
.cws-color-Odontología { background: #00796B; }
.cws-color-Oftalmología { background: #0097A7; }
.cws-color-Ortopedia { background: #388E3C; }
.cws-color-Otorrinolaringología { background: #1976D2; }
.cws-color-Pediatría { background: #0277BD; }
.cws-color-Psicología { background: #4A148C; }
.cws-color-Psiquiatría { background: #6A1B9A; }
.cws-color-Reumatología { background: #00695C; }
.cws-color-Urología { background: #01579B; }
.cws-color-Neumología { background: #00838F; }

/* === MENSAJES === */
.cws-loading,
.cws-noevents {
  padding: 24px;
  text-align: center;
  color: #5a7d9a;
  font-size: 18px;
  font-style: italic;
  background: #f9fbfd;
  border-radius: 10px;
  margin-top: 20px;
}

.cws-grid-container.cws-single-specialty .cws-specialty-block {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 4px);
    height: auto;
    margin: 1px 1px 1px 1px; /* Para separarlos visualmente */
}

.cws-grid-container.cws-single-specialty .cws-grid-cell {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    border: none;
}

.cws-grid-container.cws-single-specialty .cws-grid-cell > .cws-specialty-block {
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    border: 1px solid rgba(255,255,255,0.3);
}

.cws-grid-container.cws-single-specialty .cws-grid-header {
    z-index: 100;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .cws-grid-container {
    display: none !important;
  }
  
  /* El resto de tu CSS para móviles se mantiene igual, ya que no cambiamos la vista móvil */
  .cws-table {
    display: none !important;
  }

  .cws-mobile-view {
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px;
  }

  .cws-day-section {
    margin-bottom: 24px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  }

  .cws-day-header {
    background: #3498db;
    color: white;
    margin: 0;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
  }

  .cws-day-content {
    background: #fff;
  }

  .cws-slot-group {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f4f8;
  }

  .cws-slot-group:last-child {
    border-bottom: none;
  }

  .cws-slot-time {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 17px;
    text-align: center;
  }

  .cws-chip {
    padding: 12px;
    min-width: auto;
    font-size: 15px;
    text-align: center;
    margin: 0;
    border-left: 3px solid currentColor;
    padding-left: 12px;
    text-align: left;
  }

  .cws-chip .cws-chip-title {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 700;
  }

  .cws-chip .cws-chip-time {
    display: block;
    font-size: 14px;
    opacity: 0.95;
  }
}