/* ========================================
   WIDGET GLOBAL HORARIO ACTUAL
   Reutilizable en cualquier módulo
   ======================================== */
.active-schedule-widget {
  width: 300px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  padding: 0.9rem 1rem 1rem 1rem;
  box-shadow: var(--shadow-md, 0 4px 16px -2px rgba(0,0,0,0.18));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--text-secondary, #64748b);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
[data-theme="dark"] .active-schedule-widget {
  background: var(--bg-card, #1e293b);
  border-color: var(--border-color, #334155);
}
/* Modos */
.asw-mode-floating { position: absolute; top: 1.2rem; right: 1.2rem; }
.asw-mode-inline { position: static; }

[data-theme="dark"] .active-schedule-widget.prev { opacity: .85; }
.asw-header { display:flex; align-items:center; gap:0.45rem; font-weight:600; font-size:0.78rem; letter-spacing:.5px; color: var(--text-primary,#1e293b); }
.asw-header i { color: var(--primary,#06b6d4); font-size:0.85rem; }

/* Integración: el botón Horario reutiliza .action-btn.btn-primary; solo se ajusta icono y estado abierto */
.asw-trigger-btn { min-height:44px; }
.asw-trigger-btn i { font-size:.9rem; }
.asw-trigger-btn.asw-open { box-shadow:0 0 0 3px rgba(139,92,246,.45),0 6px 14px -4px rgba(0,0,0,.4); }

/* Popover modo botón */
.asw-popover { position:absolute; top:100%; right:0; margin-top:.65rem; z-index:2500; width:320px; }
.asw-popover.hidden { display:none; }
.asw-popover:before{content:"";position:absolute;top:-8px;right:18px;width:14px;height:14px;background:inherit;transform:rotate(45deg);border-top:1px solid rgba(139,92,246,0.35);border-left:1px solid rgba(139,92,246,0.35);filter:blur(.2px);} 

/* Ítems previos */
.asw-list li.prev { opacity:0.55; filter:saturate(.6); }
.asw-list li.prev .asw-time { background:linear-gradient(135deg,#64748b,#475569); }

.asw-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:0.5rem; max-height:180px; overflow-y:auto; scrollbar-width:thin; }
.asw-list li { display:flex; align-items:flex-start; gap:0.55rem; background: var(--bg-secondary, #f8fafc); border:1px solid var(--border-color, #e2e8f0); border-radius:12px; padding:0.55rem 0.6rem; position:relative; box-shadow:var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.08)); }
[data-theme="dark"] .asw-list li { background: var(--bg-tertiary, #334155); border-color: var(--border-color, #1e293b); }
.asw-list li.now { border:1px solid var(--primary,#06b6d4); box-shadow:0 0 0 3px rgba(99,102,241,0.15); }
.asw-list li.now .asw-time { background: var(--primary,#06b6d4); }
.asw-time { font-weight:600; font-size:0.70rem; padding:0.25rem 0.45rem; line-height:1; background: var(--secondary, #64748b); color:#fff; border-radius:6px; min-width:66px; text-align:center; }

/* ===================== MODO MODAL ===================== */
.asw-overlay { position:fixed; inset:0; background:rgba(15,23,42,0.45); display:flex; align-items:center; justify-content:center; padding:2rem 1.25rem; z-index:5000; overflow-y:auto; opacity:0; transform:translateY(10px); transition:opacity .3s ease, transform .3s ease; }
.asw-overlay.hidden { pointer-events:none; }
.asw-overlay.asw-open { opacity:1; transform:translateY(0); }
body.asw-scroll-lock { overflow:hidden; }
.asw-modal { background: var(--bg-card, #ffffff); border:1px solid var(--border-color, #e2e8f0); border-radius:26px; width:100%; max-width:760px; box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.4)); position:relative; opacity:0; transform:translateY(24px) scale(.98); transition:opacity .4s ease, transform .4s ease; }
[data-theme="dark"] .asw-modal { background: var(--bg-card, #1e293b); border-color: var(--border-color, #334155); }
.asw-overlay.asw-open .asw-modal { opacity:1; transform:translateY(0) scale(1); }
.asw-modal-header { display:flex; align-items:center; justify-content:space-between; padding:1.25rem 1.5rem 1rem; border-bottom:1px solid var(--border-color, #e2e8f0); }
.asw-modal-header h3 { margin:0; font-size:1rem; font-weight:600; display:flex; gap:.6rem; align-items:center; color: var(--text-primary); }
.asw-modal-header h3 i{color:var(--primary,#06b6d4);}
.asw-close-btn { background:transparent; border:none; font-size:1.75rem; line-height:1; cursor:pointer; color:var(--text-secondary,#64748b); padding:.25rem .5rem; border-radius:10px; }
.asw-close-btn:hover { background: var(--bg-tertiary); color:var(--text-primary); }
.asw-modal-body { padding:1.25rem 1.75rem 2rem; max-height:78vh; overflow-y:auto; }
.asw-in-modal { background:transparent; box-shadow:none; border:none; padding:0; width:100%; }
/* Ocultar header interno en modal (quitamos “Lección en curso”) */
.asw-in-modal .asw-header { display:none !important; }

/* Lista en modal con mejor integración glass */
.asw-in-modal .asw-list { max-height:58vh; padding-top:.25rem; gap:.75rem; }
.asw-in-modal .asw-list li { 
  background: var(--bg-secondary, #f8fafc); 
  border:1px solid var(--border-color, #e2e8f0); 
  transition:background .25s,border-color .25s,transform .25s; 
}
[data-theme="dark"] .asw-in-modal .asw-list li {
  background: var(--bg-tertiary, #334155);
}
.asw-in-modal .asw-list li:hover { background: var(--bg-tertiary, #f1f5f9); border-color: var(--border-hover); transform:translateY(-2px); }
.asw-in-modal .asw-list li.now { background: var(--bg-card); border:1px solid var(--primary,#06b6d4); box-shadow:0 0 0 4px rgba(139,92,246,0.15); }
.asw-in-modal .asw-list li.prev { opacity:.55; filter:saturate(.65); }
.asw-in-modal .asw-time { border-radius:10px; font-size:.68rem; min-width:70px; letter-spacing:.5px; }
.asw-in-modal .asw-grade { font-size:.75rem; letter-spacing:.3px; }
.asw-in-modal .asw-subject { font-size:.70rem; opacity:.95; }
.asw-in-modal .asw-room { opacity:.85; }
.asw-in-modal .asw-list { max-height:50vh; }
.asw-in-modal .asw-list li.prev { background: var(--bg-tertiary); opacity: 0.6; }
.asw-content { flex:1; display:flex; flex-direction:column; gap:0.25rem; }
.asw-grade { font-weight:600; font-size:0.72rem; color: var(--text-primary,#1e293b); }
[data-theme="dark"] .asw-grade { color: var(--text-primary,#f8fafc); }
.asw-subject { font-size:0.70rem; color: var(--text-secondary,#64748b); }
.asw-room { font-size:0.65rem; color: var(--text-muted,#94a3b8); }
.asw-empty { font-size:0.70rem; color: var(--text-secondary,#64748b); padding:0.25rem 0; }

/* Nuevos estilos para indicadores de estado */
.asw-status-now { 
  color: var(--success, #10b981) !important; 
  font-weight: 600; 
  font-size: 0.65rem; 
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
[data-theme="dark"] .asw-status-now { color: #34d399 !important; }

.asw-status-prev { 
  color: var(--text-muted, #94a3b8) !important; 
  font-weight: 500; 
  font-size: 0.65rem; 
  opacity: 0.8;
}

.asw-status-future { 
  color: var(--info, #3b82f6) !important; 
  font-weight: 500; 
  font-size: 0.65rem; 
}
[data-theme="dark"] .asw-status-future { color: #60a5fa !important; }

/* Estilos para bloques de recreo y almuerzo */
.asw-list li.break { 
  background: var(--bg-tertiary, #f1f5f9) !important;
  border-left: 4px solid var(--warning, #f59e0b) !important;
}
.asw-list li.break .asw-time { 
  background: var(--warning, #f59e0b) !important; 
}

.asw-content.asw-break .asw-grade { 
  color: var(--warning, #f59e0b); 
  display: flex; 
  align-items: center; 
  gap: 0.4rem;
}
[data-theme="dark"] .asw-content.asw-break .asw-grade { color: #fbbf24; }

/* Estados específicos para recreos y almuerzos */
.asw-list li.break.now { 
  background: var(--bg-card, #ffffff) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
}

.asw-list li.break.prev { 
  opacity: 0.5;
  filter: saturate(0.4);
  background: var(--bg-tertiary, #f1f5f9) !important;
}

.asw-list li.break.prev .asw-time { 
  background: var(--secondary, #64748b) !important; 
}

/* Estilo adicional para el modal con horario completo */
.asw-in-modal .asw-list li.break { 
  background: var(--bg-tertiary, #f1f5f9) !important;
  border-left: 4px solid var(--warning, #f59e0b) !important;
}

.asw-in-modal .asw-list li.break.now { 
  background: var(--bg-card) !important;
  border-left: 4px solid var(--warning, #f59e0b) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* Botón de expansión "Ver más" */
.asw-expand-btn {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 0.75rem !important;
  background: none !important;
  border: none !important;
  margin: 0.5rem 0 !important;
}

.asw-expand-content {
  width: 100%;
  display: flex;
  justify-content: center;
}

.asw-expand-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  color: var(--text-primary, #1e293b);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

[data-theme="dark"] .asw-expand-button {
  color: var(--text-primary, #f8fafc);
  background: var(--bg-tertiary, #334155);
}

.asw-expand-button:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.asw-expand-button:active {
  transform: translateY(0);
}

.asw-expand-button i {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* En el modal */
.asw-in-modal .asw-expand-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.asw-in-modal .asw-expand-button {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.asw-in-modal .asw-expand-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

@media (max-width:1150px){
  .active-schedule-widget { width:100%; margin-top:1rem; }
}
@media (max-width:600px){
  .active-schedule-widget { font-size:0.70rem; }
  .asw-time { min-width:60px; font-size:0.65rem; }
}

/* Scrollbar estilizado (WebKit) */
.asw-list::-webkit-scrollbar, .asw-modal-body::-webkit-scrollbar { width:6px; }
.asw-list::-webkit-scrollbar-track, .asw-modal-body::-webkit-scrollbar-track { background:transparent; }
.asw-list::-webkit-scrollbar-thumb, .asw-modal-body::-webkit-scrollbar-thumb { background: var(--border-hover, #cbd5e1); border-radius:10px; }
.asw-list { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
.asw-modal-body { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }
