
/* ══════════════════════════════════════════
   TIMELINE PANEL
══════════════════════════════════════════ */
.timeline-panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 16px 24px; /* Bajamos de 50px a 24px para aprovechar mejor el ancho */
  backdrop-filter: blur(10px); /* Efecto de filtro borroso para el fondo */
  display: flex;
  flex-direction: column;
  min-height: 0;
}



.timeline-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.date-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

/* ── Timeline Rows ── */
.timeline-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Reparte el espacio entre filas */
  flex: 1; /* Esto hace que el contenedor ocupe todo el alto disponible */
  min-height: 0;
  gap: 0; /* Quitamos el gap manual para que el espacio se gestione con flex-grow */
}

.t-row {
  display: grid;
  /* Bajamos el mínimo de 180px a 140px para dar más aire a la barra */
  grid-template-columns: clamp(220px, 18%, 500px) 1fr 80px; 
  align-items: center;
  gap: 12px; /* Reducimos el gap de 20px a 12px */
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Para que la última fila no tenga borde inferior */
.t-row:last-child {
  border-bottom: none;
}

.t-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0; /* Permite que el contenedor se encoja */
}

.t-avatar {
  width: clamp(30px, 6vw, 80px);
  height: clamp(30px, 6vw, 80px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}

.t-name {
  font-size: clamp(0.68rem, 1vw, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bar track */
/* Modifica el contenedor del track */
.t-track {
  position: relative;
  /* El alto que ya habías definido */
  height: clamp(14px, 3vh, 60px); 
  /* Fondo gris oscuro/azulado sutil para que no compita con el fondo general */
  background: rgba(255, 255, 255, 0.05); 
  /* Redondeado para que coincida con las barras */
  border-radius: 20px; 
  /* Opcional: un borde muy fino para darle profundidad */
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Asegúrate de que las barras moradas estén por encima */
.t-bar {
    position: absolute;
    height: 100%;
    z-index: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Eliminamos el border-radius general para que las clases is-first/is-last lo controlen */
    display: flex;
    align-items: center;
    justify-content: center;

    /* GRADIENTE USANDO TUS COLORES PERSONALIZADOS */
    background: linear-gradient(90deg, var(--color-start) 0%, var(--color-end) 100%);
    
    /* Mantiene el gradiente continuo a lo largo de toda la fila */
    background-size: 100vw 100%; 
    background-attachment: fixed;
    
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ajuste para que el texto del hover no se vea afectado por el gradiente fixed */
.t-bar::after {
    background: #1F2640; /* Color sólido para el tooltip */
    z-index: 10;
}

.t-bar:hover::after {
    opacity: 1;
    top: -30px; /* Pequeño salto hacia arriba al aparecer */
}

.is-first {
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.is-last {
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}
/* Si un profesor solo tiene una barra, será first y last a la vez (totalmente redonda) */
.is-first.is-last {
    border-radius: 20px;
}

/* Efecto hover ajustado para no romper los bordes */


/* .bar-gradient {
  background: linear-gradient(90deg, var(--accent-bar) 20%, var(--accent-hot) 80%);
  background-attachment: fixed; 
  background-origin: padding-box;
  background-clip: border-box;
  background-size: 100vw; 
  background-position: left center;
} */



.bar-accent {
  background: var(--accent-hot);
  opacity: 0.85;
}
.bar-soft {
  background: var(--accent-mid);
  opacity: 0.55;
}

.t-duration {
  text-align: right;
  font-size: clamp(0.78rem, 1.1vw, 1rem);
  font-weight: 700;
}

.timeline-axis {
  display: grid;
  grid-template-columns: clamp(140px, 18%, 250px) 1fr 80px;
  gap: 12px;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 10px;
}
.axis-hours {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.axis-hours span {
  width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
}

/* Alineación de los extremos */
.axis-hours span:first-child { justify-content: flex-start; }
.axis-hours span:last-child { justify-content: flex-end; }

/* --- Dentro de initTimeline --- */

@media (max-width: 1600px) {
  .axis-hours span {
    font-size: 9px; /* Texto un poco más pequeño */
  }

  .t-row {
    display: grid;
    /* Bajamos el mínimo de 180px a 140px para dar más aire a la barra */
    grid-template-columns: clamp(170px, 19%, 250px) 1fr 80px; 
  }

  .axis-hours span:nth-child(even) {
    display: none;
  }

  .t-avatar {
    width: clamp(37px, 3vw, 40px);
    height: clamp(37px, 3vw, 40px);
  }

  .t-name {
    font-size: clamp(0.68rem, 1vw, 0.9rem);
    font-weight: 600;
  }
}

/* @media (max-width: 1024px) {

  .axis-hours span {
    display: none;
  }
  .axis-hours span:nth-child(3n+1) {
    display: flex;
  }
} */


@media (max-width: 900px) {

  .timeline-panel {
    min-height: 280px;
  }

  .meetings-list { overflow-y: visible; }

  /* Restore all axis labels */
  .timeline-axis span { display: inline; }
  .timeline-axis span:nth-child(even) { display: none; }
}


@media (max-width: 600px) {
  
  /* 1. Ajuste de la fila: Definimos 2 columnas claras */
  .t-row {
    display: grid;
    /* La primera columna para el usuario, la segunda para la duración (auto) */
    grid-template-columns: 1fr auto; 
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* El usuario a la izquierda */
  .t-user { 
    grid-column: 1; 
    grid-row: 1; 
  }

  /* La duración pegada a la derecha */
  .t-duration { 
    grid-column: 2; 
    grid-row: 1; 
    text-align: right;
    font-size: 0.85rem;
    min-width: 70px; /* Asegura espacio para el texto */
  }

  /* La barra ocupa todo el ancho abajo */
  .t-track { 
    grid-column: 1 / span 2; 
    grid-row: 2; 
    height: 18px; /* Un poco más gruesa para touch */
    margin-top: 4px;
  }

  /* 2. Ajuste del Eje de horas: Quitamos las columnas sobrantes */
  .timeline-axis {
    display: block;
    padding-top: 10px;
    margin-top: 10px;
  }

  .axis-hours {
    display: flex;
    justify-content: space-between;
    width: 100%;
    /* Eliminamos padding excesivo para ganar espacio */
    padding: 0; 
  }

  /* Reset de visibilidad para control total */
  .axis-hours span {
    display: none; 
    font-size: 9px;
    width: auto;
    white-space: nowrap;
  }

  /* MOSTRAMOS 4 HITOS CLAVE PARA CUBRIR TODO EL RANGO: 6AM, 11AM, 4PM, 10PM */
  /* Esto asegura que el usuario vea el inicio, el medio y el final real */
  .axis-hours span:nth-child(1),  /* 6 AM */
  .axis-hours span:nth-child(6),  /* 11 AM */
  .axis-hours span:nth-child(11), /* 4 PM */
  .axis-hours span:last-child {   /* 10 PM (Siempre visible) */
    display: inline-block;
  }

  /* Ajuste de alineación para que el 10 PM no se corte */
  .axis-hours span:last-child {
    text-align: right;
  }
}