/* ==========================================================================
   ESTILOS GENERALES Y SISTEMA DE DISEÑO - HORARIOS SEMIPRESENCIALES 2026-2027
   ========================================================================== */

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-text-main: #0f172a;
  --color-text-muted: #475569;
  --color-border: #cbd5e1;
  --color-border-light: #e2e8f0;
  
  --color-primary: #1e3a8a;
  --color-primary-hover: #1e40af;
  --color-primary-light: #eff6ff;
  --color-primary-border: #bfdbfe;
  
  --color-accent: #0284c7;
  --color-accent-light: #f0f9ff;
  
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fef3c7;
  --color-warning-text: #92400e;
  
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

html {
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-main);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

a:hover, a:focus {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: var(--color-primary);
  color: #ffffff;
  padding: 8px 16px;
  z-index: 1000;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
  font-weight: 600;
}
.skip-link:focus {
  top: 10px;
  outline: 3px solid #f59e0b;
}

.site-header {
  background-color: #0f172a;
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .header-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-brand {
  display: flex;
  flex-direction: column;
}

.header-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #93c5fd;
  text-transform: uppercase;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.course-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-tab {
  padding: 0.5rem 1rem;
  background-color: #1e293b;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-tab:hover {
  background-color: #334155;
  color: #ffffff;
  text-decoration: none;
}

.nav-tab.active {
  background-color: var(--color-primary-hover);
  color: #ffffff;
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  width: 100%;
}

.schedule-header {
  margin-bottom: 1.25rem;
}

.schedule-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.schedule-meta {
  color: var(--color-text-muted);
  font-size: 0.925rem;
}

.provisional-banner {
  background-color: var(--color-warning-bg);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-warning-text);
  font-weight: 700;
  font-size: 0.925rem;
  margin-bottom: 0.25rem;
}

.banner-text {
  color: #78350f;
  font-size: 0.875rem;
  line-height: 1.4;
}

.controls-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 900px) {
  .controls-grid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.date-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.date-filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-main);
}

.date-input {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text-main);
  background-color: #ffffff;
}

.actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* BOTONES DE SALTO RÁPIDO A TURNOS */
.quick-group-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-light);
}

.quick-nav-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-jump:hover {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(30, 58, 138, 0.2);
}

.btn-jump-modules {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.btn-jump-modules:hover {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 2px 5px rgba(21, 128, 61, 0.25);
}

/* BOTÓN FLOTANTE PARA SUBIR A LA BARRA PRINCIPAL */
.floating-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: #1e3a8a;
  color: #ffffff !important;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.floating-scroll-top:hover {
  background-color: #0284c7;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.45);
  text-decoration: none;
}

.floating-scroll-top svg {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .floating-scroll-top {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    font-size: 0.8rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
}

.btn-accent {
  background-color: var(--color-accent);
  color: #ffffff;
}
.btn-accent:hover {
  background-color: #0369a1;
  color: #ffffff;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-outline:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-main);
  text-decoration: none;
}

.status-summary {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.day-section {
  margin-bottom: 2rem;
  scroll-margin-top: 20px;
}

.day-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.day-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.day-section-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
}

.table-container {
  overflow-x: auto;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.875rem;
}

.schedule-table caption {
  display: none;
}

.schedule-table th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border-bottom: 2px solid var(--color-border);
  border-right: 1px solid var(--color-border-light);
  white-space: nowrap;
}

.schedule-table th:last-child {
  border-right: none;
}

.schedule-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--color-border-light);
  border-right: 1px solid var(--color-border-light);
}

.schedule-table td:last-child {
  border-right: none;
}

.schedule-table tr:hover {
  background-color: #f8fafc;
}

.schedule-table tr.highlight-row {
  background-color: #fef08a !important;
}

.schedule-table tr.inactive-row {
  opacity: 0.5;
  background-color: #f8fafc;
}

.date-col {
  text-align: left;
  padding-left: 0.75rem !important;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
}

.sess-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  background-color: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  margin-right: 0.35rem;
}

.holiday-tag {
  color: #94a3b8;
  font-size: 0.75rem;
  font-style: italic;
}

.mod-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  background-color: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.mod-CYA { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.mod-OFA { background: #dcfce7; color: #166534; border-color: #86efac; }
.mod-GTJ { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-PNG { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
.mod-RCB { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.mod-ITK { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.mod-IKL { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.mod-DJK { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

.mod-COB { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.mod-GEF { background: #dcfce7; color: #166534; border-color: #86efac; }
.mod-GIL { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-GTH { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }
.mod-SML { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.mod-SOJ { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.mod-YFI { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.mod-IPW { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

.mod-GEL { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.mod-GII { background: #dcfce7; color: #166534; border-color: #86efac; }
.mod-LOD { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-TRO { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }

.legend-card {
  scroll-margin-top: 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.legend-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.legend-table th {
  background-color: #f8fafc;
  color: #475569;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.legend-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
}

.legend-table tr:hover {
  background-color: #f8fafc;
}

.portal-hero {
  text-align: center;
  margin: 1.5rem 0 2rem 0;
}

.portal-hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.portal-hero p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  transition: all 0.2s;
}

.course-card:hover {
  border-color: var(--color-primary-border);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08);
}

.card-badge {
  align-self: flex-start;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-primary-border);
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.card-desc {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.card-schedule-info {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.825rem;
  color: #334155;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  .table-container {
    display: none;
  }
  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .mobile-session-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
  }
  .mobile-session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
  }
  .mobile-date-text {
    font-weight: 600;
    font-size: 0.875rem;
  }
  .mobile-slots-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .mobile-slot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
  }
  .mobile-slot-time {
    color: var(--color-text-muted);
    font-family: monospace;
  }
}

.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 1.25rem;
  font-size: 0.825rem;
  margin-top: auto;
}

@media print {
  body {
    background-color: #ffffff;
    color: #000000;
  }
  .site-header, .controls-card, .provisional-banner, .site-footer, .skip-link, .quick-group-nav, .floating-scroll-top {
    display: none !important;
  }
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #000000;
    padding-bottom: 0.5rem;
  }
  .print-header-title {
    font-size: 1.3rem;
    font-weight: 800;
  }
  .print-header-sub {
    font-size: 0.9rem;
    color: #444444;
  }
  .main-content {
    max-width: 100%;
    padding: 0;
  }
  .table-container {
    display: block !important;
    border: 1px solid #000000;
    box-shadow: none;
  }
  .mobile-cards {
    display: none !important;
  }
  .schedule-table th, .schedule-table td {
    border-color: #000000 !important;
    font-size: 8pt;
    padding: 3px;
  }
  .mod-pill {
    border: 1px solid #000000 !important;
    background: transparent !important;
    color: #000000 !important;
  }
  .day-section {
    page-break-inside: avoid;
  }
  .legend-card {
    page-break-inside: avoid;
    border: 1px solid #000000;
  }
}
