/* =========================================================
   SCHEDULES.CSS
   Estilos de los modales de horarios y de los botones
   ========================================================= */


/* =========================================================
   1. BOTONES Y FILTROS EN CRIAR LINHA
   ========================================================= */

.lc-filtro-transmissoes {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lc-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 10px;
}

/* Botón PROGRAMACIÓN */
.btn-programacion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  min-width: 250px;
  flex-shrink: 0;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  background: #0069d9;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .08s ease;
  white-space: nowrap;
}

.btn-programacion:hover {
  background: #0056b3;
}

.btn-programacion .btn-label {
  text-transform: uppercase;
}

/* Botones TODOS / ACTIVOS / INACTIVOS */
.lc-filter-btn {
  padding: 6px 10px;
  border-radius: 4px;
  background: #f5f5f5;
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.lc-btn-group .btn-filter {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  background: #f5f5f5;
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: background .08s ease;
  flex-shrink: 0;
}

.lc-btn-group .btn-filter:hover {
  background: #e2e6ea;
}

@media (max-width: 768px) {
  .lc-filtro-transmissoes {
    flex-wrap: wrap;
    gap: 6px;
  }
}


/* =========================================================
   2. SISTEMA REUTILIZABLE PARA MODALES
   ========================================================= */

/* ---------- ANCHOS ---------- */

.lc-modal-wide .modal-dialog,
.modal-dialog.lc-modal-wide {
  width: 95%;
  max-width: 1000px;
}

.lc-modal-xwide .modal-dialog,
.modal-dialog.lc-modal-xwide {
  width: 95%;
  max-width: 1200px;
}

.lc-modal-full .modal-dialog,
.modal-dialog.lc-modal-full {
  width: 97%;
  max-width: 1400px;
}

/* ---------- ALTURAS DEL BODY ---------- */

.lc-modal-body-medium {
  min-height: 50vh;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 20px;
}

.lc-modal-body-tall {
  min-height: 60vh;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: 20px;
}

.lc-modal-body-x-tall {
  min-height: 70vh;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 20px;
}

/* ---------- MODAL CON HEADER Y FOOTER FIJOS ---------- */

.lc-modal-scroll .modal-content {
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.lc-modal-scroll .modal-header,
.lc-modal-scroll .modal-footer {
  flex-shrink: 0;
}

.lc-modal-scroll .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* ---------- TABLAS GENÉRICAS ---------- */

.lc-table-scroll {
  max-height: calc(100vh - 300px);
  min-height: 40vh;
  overflow: auto;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
}

.lc-table-scroll .table {
  width: 100%;
  font-size: 14px;
}

.lc-table-scroll .table th,
.lc-table-scroll .table td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
}


/* =========================================================
   3. ESTILOS GLOBALES DE MODALES
   ========================================================= */

.modal-header {
  background-color: #007bff;
  color: #fff;
  position: relative;
}

.modal .close {
  color: #fff;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.modal .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

.modal .btn-secondary:hover {
  background-color: #5a6268;
  border-color: #545b62;
}

.modal .btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #fff;
}

.modal .btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.modal-body {
  background-color: #f5f5f5;
  color: #222;
}

.modal-body h5,
.modal-body label {
  color: #222;
  font-weight: 600;
}

.modal-body p,
.modal-body .text-muted {
  color: #333 !important;
  font-weight: 500;
}

.modal-dialog.modal-md {
  max-width: 800px;
}

.modal-backdrop {
  z-index: 1040 !important;
  opacity: 0.5 !important;
  pointer-events: none !important;
}

.modal-backdrop-custom {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
}

.modal.in {
  display: block;
  z-index: 1050;
}

/* =========================================================
   4. MODAL: IMPORTAR CSV
   ========================================================= */

#importSchedulesModal {
  z-index: 1050 !important;
}

#importSchedulesModal .modal-content {
  pointer-events: auto !important;
}

#importSchedulesModal .modal-dialog {
  max-width: 800px;
}

.hidden-file-input {
  display: none;
}

.import-instructions .help-text {
  margin-bottom: 6px;
  color: #666;
}

.import-controls {
  margin-bottom: 12px;
}

.file-name {
  margin-left: 10px;
  font-weight: 600;
}

.import-actions {
  margin-top: 12px;
}

.upload-error {
  margin-top: 8px;
}

.upload-icon-message {
  color: #333;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
}

.lc-upload-dropzone {
  border: 2px dashed rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 18px;
  text-align: center;
  background: #fff;
  cursor: pointer;
}

.lc-upload-dropzone .upload-icon {
  font-size: 34px;
  color: #2b9cff;
  margin-bottom: 6px;
}

.lc-upload-dropzone.has-file {
  border-style: solid;
  border-color: #2b9cff;
  background: #f6fbff;
}

.upload-preview pre {
  max-height: 160px;
  overflow: auto;
  background: #f8f8f8;
  padding: 8px;
  border-radius: 4px;
}

.csv-scroll-box {
  max-height: 250px;
  overflow-y: auto;
  background-color: #fff5f5;
  border: 1px solid #e0a0a0;
  padding: 10px;
  margin-top: 10px;
  font-size: 15px;
  color: #b00020;
  font-weight: bold;
  white-space: pre-wrap;
}

.csv-error-text {
  color: #b00020;
  font-weight: bold;
  margin-top: 1px;
  margin-bottom: 1px;
  font-size: 15px;
  white-space: pre-line;
}

.text-danger {
  color: #b00020 !important;
  font-weight: bold;
}


/* =========================================================
   5. MODAL: PROGRAMACIÓN
   ========================================================= */

#programacoesSchedulesModal {
  z-index: 1050;
}

#programacoesSchedulesModal .modal-header {
  background-color: #007bff;
  color: #fff;
  border-bottom: 0;
  padding: 24px 28px 8px;
}

#programacoesSchedulesModal .modal-title {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

#programacoesSchedulesModal .close {
  color: #fff;
  font-size: 30px;
  font-weight: 400;
  opacity: 0.8;
}

#programacoesSchedulesModal .modal-body {
  background-color: #eef5f3;
  padding: 8px 28px 20px;
}

/* El scroll queda solamente en la tabla. */
#programacoesSchedulesModal .modal-body.lc-modal-body-tall {
  min-height: auto;
  max-height: none;
  overflow: visible;
  padding-bottom: 16px;
}

#programacoesSchedulesModal .modal-body .text-muted {
  color: #a5b4b1 !important;
  font-size: 18px;
  font-weight: 400;
  margin: 0 0 26px;
}

#programacoesSchedulesModal .modal-footer {
  background-color: #eef5f3;
  border-top: 0;
  padding: 12px 28px 24px;
}

#programacoesSchedulesModal .modal-footer {
  background-color: #eef5f3;
  border-top: 0;
  padding: 12px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
}

#programacoesSchedulesModal .modal-footer .text-muted {
  text-align: left;
  margin: 0;
  flex: 1;
}

/* Contenedor de la tabla: altura suficiente para ver
   varios horarios completos. */
.lc-schedules-table-box {
  width: 100%;
  max-height: calc(100vh - 240px);
  min-height: 480px;
  overflow: auto;
  background: #eef5f3;
  border: 1px solid #6d7c79;
  border-radius: 7px;
}

.lc-schedules-table {
  width: 100%;
  min-width: 1080px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #eef5f3;
  color: #1a2424;
  font-size: 18px;
}

.lc-schedules-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 14px;
  background: #eef5f3;
  color: #182222;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  border-top: 0 !important;
  border-bottom: 1px solid #6d7c79 !important;
}

.lc-schedules-table tbody td {
  padding: 16px 14px;
  vertical-align: middle !important;
  background: #eef5f3;
  border-top: 0 !important;
  border-bottom: 1px solid #6d7c79 !important;
}

/* Filas alternadas en Programación:
   conserva el fondo base y aclara ligeramente las filas pares. */
#programacoesSchedulesModal .lc-schedules-table tbody tr:nth-child(even) td {
  background-color: #e4efec !important;
}

/* Hover de fila: celeste claro en toda la fila. */
#programacoesSchedulesModal .lc-schedules-table tbody tr:hover td {
  background-color: #d9edf7 !important;
}

.lc-schedules-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.lc-schedules-table th:nth-child(1),
.lc-schedules-table td:nth-child(1) {
  min-width: 300px;
}

.lc-schedules-table th:nth-child(2),
.lc-schedules-table td:nth-child(2) {
  min-width: 95px;
}

.lc-schedules-table th:nth-child(3),
.lc-schedules-table td:nth-child(3) {
  min-width: 260px;
}

.lc-schedules-table th:nth-child(4),
.lc-schedules-table td:nth-child(4) {
  min-width: 125px;
}

.lc-schedules-table th:nth-child(5),
.lc-schedules-table td:nth-child(5),
.lc-schedules-table th:nth-child(6),
.lc-schedules-table td:nth-child(6) {
  min-width: 115px;
  white-space: nowrap;
}

.lc-schedules-table th:nth-child(7),
.lc-schedules-table td:nth-child(7) {
  min-width: 135px;
}

.lc-schedule-action-column {
  width: 70px;
  min-width: 70px;
}

.lc-schedule-time {
  line-height: 1.7;
  white-space: normal !important;
}

.lc-schedule-time span {
  display: inline-block;
}

.lc-schedule-time-separator {
  padding: 0 8px;
}

.lc-delete-schedule-btn {
  padding: 4px 8px;
  color: #92c83e !important;
  font-size: 23px;
  line-height: 1;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
}

.lc-delete-schedule-btn:hover,
.lc-delete-schedule-btn:focus {
  color: #669b1d !important;
  background: transparent !important;
  outline: none;
}

/* Scrollbar del contenedor de la tabla */
.lc-schedules-table-box::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.lc-schedules-table-box::-webkit-scrollbar-track {
  background: #dfe8e5;
  border-radius: 8px;
}

.lc-schedules-table-box::-webkit-scrollbar-thumb {
  background: #939393;
  border: 3px solid #dfe8e5;
  border-radius: 8px;
}

.lc-schedules-table-box::-webkit-scrollbar-thumb:hover {
  background: #727272;
}


/* =========================================================
   6. MODAL CREATE SCHEDULE
   ========================================================= */

/* Scroll vertical solamente en el cuerpo del modal Crear Horario */
#createScheduleModal .lc-modal-body-tall {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 12px;
}

#createScheduleModal .lc-modal-body-tall::-webkit-scrollbar {
  width: 8px;
}

#createScheduleModal .lc-modal-body-tall::-webkit-scrollbar-track {
  background: transparent;
}

#createScheduleModal .lc-modal-body-tall::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;
  border-radius: 4px;
}

/* Sube un poco el modal sin cambiar ancho ni agrupaciones */
#createScheduleModal .modal-dialog {
  margin-top: 30px;
  margin-bottom: 30px;
}

@media (max-width: 767px) {
  #createScheduleModal .lc-modal-body-tall {
    max-height: 65vh;
  }

  #createScheduleModal .modal-dialog {
    margin-top: 15px;
    margin-bottom: 15px;
  }
}


/* =========================================================
   7. RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
  .lc-modal-wide .modal-dialog,
  .modal-dialog.lc-modal-wide,
  .lc-modal-xwide .modal-dialog,
  .modal-dialog.lc-modal-xwide,
  .lc-modal-full .modal-dialog,
  .modal-dialog.lc-modal-full {
    width: 98%;
    max-width: 98%;
    margin: 10px auto;
  }

  .lc-modal-body-medium,
  .lc-modal-body-tall,
  .lc-modal-body-x-tall {
    min-height: auto;
    max-height: calc(100vh - 120px);
    padding: 12px;
  }

  .lc-table-scroll {
    min-height: auto;
    max-height: 60vh;
  }

  #programacoesSchedulesModal .modal-header {
    padding: 18px 16px 8px;
  }

  #programacoesSchedulesModal .modal-title {
    font-size: 21px;
    padding-right: 32px;
  }

  #programacoesSchedulesModal .modal-body {
    padding: 8px 16px 16px;
  }

  .lc-schedules-table-box {
    min-height: 320px;
    max-height: calc(100vh - 200px);
  }

  .lc-schedules-table {
    font-size: 15px;
  }

  .lc-schedules-table thead th,
  .lc-schedules-table tbody td {
    padding: 12px 10px;
    font-size: 15px;
  }
}


/* Dar espacio a las horas de inicio y fin en la fila en edición. */
#programacoesSchedulesModal .lc-schedule-time-edit-cell {
  min-width: 190px;
  vertical-align: top;
}

/* Apilar ambos controles para no comprimirlos en dos columnas. */
#programacoesSchedulesModal .lc-schedule-time-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 170px;
}

#programacoesSchedulesModal .lc-schedule-time-field {
  min-width: 170px;
}

#programacoesSchedulesModal .lc-schedule-time-field label {
  display: block;
  margin-bottom: 4px;
}

/* Mantener visible el contenido, además del icono del reloj. */
#programacoesSchedulesModal .lc-schedule-time-input {
  display: block;
  width: 100%;
  min-width: 170px;
  box-sizing: border-box;
}

/* Mantener los botones de cada grupo en una misma fila,
   con separación para evitar pulsaciones equivocadas. */
#programacoesSchedulesModal .lc-schedule-actions-inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Evitar que los botones se compriman dentro de la columna. */
#programacoesSchedulesModal .lc-schedule-actions-inline > .btn {
  flex: 0 0 auto;
  margin: 0;
}

/* Separación entre Guardar/Cancelar y Editar/Eliminar. */
#programacoesSchedulesModal .lc-schedule-actions-inline > .btn + .btn {
  margin-left: 10px;
}

/* Reservar espacio para el grupo más ancho: Guardar y Cancelar. */
#programacoesSchedulesModal .lc-schedule-action-column {
  min-width: 180px;
}

/* Crear Horario: fondo transparente en todos los estados. */
button.lc-create-schedule-btn,
button.lc-create-schedule-btn:hover,
button.lc-create-schedule-btn:focus,
button.lc-create-schedule-btn:active,
button.lc-create-schedule-btn.active,
button.lc-create-schedule-btn:disabled,
button.lc-create-schedule-btn[disabled] {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Estado normal: verde claro. */
button.lc-create-schedule-btn,
button.lc-create-schedule-btn i,
button.lc-create-schedule-btn i::before {
  color: #8ac926 !important;
  transition: color 0.15s ease;
}

/* Cursor encima: verde ligeramente más oscuro, sin ocultar el reloj. */
button.lc-create-schedule-btn:hover,
button.lc-create-schedule-btn:hover i,
button.lc-create-schedule-btn:hover i::before {
  color: #73ad1f !important;
}

/* Al presionar: conservar el verde del estado hover. */
button.lc-create-schedule-btn:active,
button.lc-create-schedule-btn:active i,
button.lc-create-schedule-btn:active i::before {
  color: #73ad1f !important;
}

/* Indicación visible al navegar con teclado. */
button.lc-create-schedule-btn:focus {
  outline: 2px solid #73ad1f;
  outline-offset: 2px;
}


/* =========================================================
   8. MODAL: CARGA MASIVA DE PROGRAMACIONES
   ========================================================= */

/*
  Ventana externa de carga masiva administrada por AngularStrap.
  La plantilla se carga desde LinhasConsultarCtrl.
  La apertura y el cierre los administra el servicio $modal.
*/
#modalCargaMassivaSchedules {
  position: fixed;
  z-index: 1050;
  color: #222;
}

#modalCargaMassivaSchedules .modal-content {
  background-color: #fff;
  color: #222;
}

#modalCargaMassivaSchedules .modal-header {
  position: relative;
  padding: 15px 45px 15px 15px;
  background-color: #007bff;
  color: #fff;
}

/* Título blanco del modal de carga masiva. */
#modalCargaMassivaSchedules .modal-header .modal-title {
  margin: 0;
  color: #fff !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

#modalCargaMassivaSchedules .modal-header .close {
  position: absolute;
  top: 10px;
  right: 15px;
  margin: 0;
  color: #fff;
}

#modalCargaMassivaSchedules .modal-body {
  padding: 20px;
  background-color: #f5f5f5;
  color: #222;
}

#modalCargaMassivaSchedules .modal-body p {
  margin: 0 0 15px;
  color: #333;
}

#modalCargaMassivaSchedules .modal-body input[type="file"] {
  width: 100%;
  max-width: 100%;
}

#modalCargaMassivaSchedules .modal-footer {
  padding: 15px;
  background-color: #fff;
}

/*
  No redefinir los colores de verde-btn ni azul-btn.
  Se reutilizan las clases de CONSULTAR y + CREAR RUTA:
    CANCELAR: btn btn-new verde-btn
    GUARDAR:  btn btn-new azul-btn
*/

@media (max-width: 767px) {
  #modalCargaMassivaSchedules .modal-body {
    padding: 15px;
  }
}

/* =========================================================
   IMPORTAR CSV: recuadro compacto de archivo y errores.
   No modificar los contenedores de tablas de otros modales.
   ========================================================= */

#importSchedulesModal .csv-scroll-box.lc-table-scroll {
  min-height: 0;
  max-height: 250px;
  padding: 10px;
  margin-top: 10px;
  white-space: normal;
}

#importSchedulesModal .csv-scroll-box strong {
  display: block;
  margin: 0 0 8px;
}

#importSchedulesModal .csv-scroll-box pre {
  margin: 0;
  padding: 8px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

#importSchedulesModal .csv-scroll-box .csv-error-text {
  margin: 8px 0 0;
  white-space: pre-line;
}

/* Botón Editar: fondo transparente, igual al de la fila;
   lápiz verde claro. */
.lc-edit-schedule-btn {
  padding: 4px 8px;
  background: transparent !important;
  border: 0;
  box-shadow: none !important;
}

.lc-edit-schedule-btn i,
.lc-edit-schedule-btn i::before {
  color: #8ac926 !important;
}

.lc-edit-schedule-btn:hover,
.lc-edit-schedule-btn:focus,
.lc-edit-schedule-btn:active {
  background: transparent !important;
  border-color: transparent !important;
  outline: none;
}

.lc-edit-schedule-btn:hover i,
.lc-edit-schedule-btn:hover i::before,
.lc-edit-schedule-btn:focus i,
.lc-edit-schedule-btn:focus i::before,
.lc-edit-schedule-btn:active i,
.lc-edit-schedule-btn:active i::before {
  color: #73ad1f !important;
}
