/* ==========================================================================
   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;
}

*, *::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: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  flex-direction: column;
}

.header-badge {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 0.25rem;
}

.header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.course-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease-in-out;
  min-height: 44px;
}

.nav-tab:hover, .nav-tab:focus {
  background-color: #334155;
  color: #ffffff;
  text-decoration: none;
}

.nav-tab.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.main-content {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.provisional-banner {
  background-color: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 5px solid #d97706;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #78350f;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: #92400e;
}

.banner-text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #854d0e;
}

.portal-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.portal-hero h1 {
  font-size: 2rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}
.portal-hero p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.course-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  border-color: #bfdbfe;
}

.card-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 9999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-schedule-info {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-border-light);
  line-height: 1.6;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  min-height: 44px;
  text-decoration: none;
}

.btn-primary {
  background-color: #1e3a8a;
  color: #ffffff;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #1e40af;
  color: #ffffff;
  text-decoration: none;
}

.btn-secondary {
  background-color: #ffffff;
  color: #1e293b;
  border-color: var(--color-border);
}
.btn-secondary:hover, .btn-secondary:focus {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  text-decoration: none;
}

.btn-accent {
  background-color: #0284c7;
  color: #ffffff;
}
.btn-accent:hover, .btn-accent:focus {
  background-color: #0369a1;
  color: #ffffff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-outline:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  text-decoration: none;
}

.controls-card {
  background: 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 2px 0 rgb(0 0 0 / 0.05);
}

.controls-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.date-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.date-filter-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.date-input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: #0f172a;
  min-height: 44px;
}

.date-input:focus {
  outline: 2px solid #2563eb;
  border-color: #2563eb;
}

.actions-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.status-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  margin-top: 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.schedule-header {
  margin-bottom: 1.25rem;
}
.schedule-header h2 {
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.schedule-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.day-section {
  margin-bottom: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  overflow: hidden;
}

.day-section-header {
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}

.day-section-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: #334155;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  color: #93c5fd;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.875rem;
}

.schedule-table th, .schedule-table td {
  padding: 0.625rem 0.5rem;
  border: 1px solid var(--color-border-light);
}

.schedule-table thead th {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.schedule-table thead tr:first-child th {
  background-color: #f1f5f9;
  border-bottom: 2px solid var(--color-border);
}

.schedule-table tbody tr:nth-child(even) {
  background-color: #fafbfd;
}

.schedule-table tbody tr:hover {
  background-color: #f1f5f9;
}

.schedule-table .date-col {
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  white-space: nowrap;
  padding-left: 1rem;
}

.schedule-table .sess-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-right: 0.4rem;
}

.schedule-table .inactive-row {
  opacity: 0.45;
  background-color: #f8fafc;
}

.schedule-table .holiday-tag {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.8rem;
}

.mod-pill {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  text-align: center;
  min-width: 55px;
}

.mod-CYA { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.mod-OFA { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-GTJ { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.mod-PNG { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.mod-RCB { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.mod-ITK { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.mod-IKL { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.mod-DJK { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.mod-COB { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.mod-GEF { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-GIL { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.mod-GTH { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.mod-SML { background: #fef08a; color: #854d0e; border-color: #fde047; }
.mod-SOJ { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.mod-YFI { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.mod-IPW { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; }
.mod-OGV { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.mod-TUO { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.mod-GEL { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mod-GII { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.mod-LOD { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.mod-TRO { background: #e0f2fe; color: #075985; border-color: #bae6fd; }

.mobile-cards {
  display: none;
  padding: 1rem;
  flex-direction: column;
  gap: 1rem;
}

.mobile-session-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.mobile-session-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-date-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.mobile-slots-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
}

.mobile-slot-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.legend-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 2rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.legend-card h3 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.legend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.legend-table th, .legend-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border-light);
  text-align: left;
}

.legend-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

.legend-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #ffffff;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.empty-state p {
  font-size: 1.1rem;
  color: #475569;
  margin-bottom: 1rem;
}

.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 1.5rem;
  margin-top: auto;
  font-size: 0.875rem;
  text-align: center;
}
.site-footer a {
  color: #93c5fd;
}

@media (max-width: 767px) {
  .table-container { display: none; }
  .mobile-cards { display: flex; }
  .controls-grid { flex-direction: column; align-items: stretch; }
  .date-filter-group { flex-direction: column; align-items: stretch; }
  .actions-group { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .course-nav { width: 100%; }
  .nav-tab { flex: 1; text-align: center; justify-content: center; }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 8pt !important;
  }
  .skip-link, .site-header, .course-nav, .controls-card, .actions-group, .schedule-header, .site-footer, .btn, .mobile-cards {
    display: none !important;
  }
  .main-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .print-header {
    display: block !important;
    margin-bottom: 3mm;
    border-bottom: 1.5pt solid #1e3a8a;
    padding-bottom: 2mm;
  }
  .print-header-title {
    font-size: 12pt !important;
    font-weight: bold;
    color: #1e3a8a !important;
  }
  .print-header-sub {
    font-size: 9pt !important;
    color: #333333 !important;
  }
  .provisional-banner {
    background: #ffffff !important;
    border: 0.75pt solid #999999 !important;
    border-left: 3.5pt solid #d97706 !important;
    color: #000000 !important;
    padding: 2mm 3mm !important;
    margin-bottom: 3mm !important;
    font-size: 7pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .day-section {
    border: 0.5pt solid #555555 !important;
    margin-bottom: 4mm !important;
    break-inside: auto;
    page-break-inside: auto;
  }
  .day-section-header {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border-bottom: 0.5pt solid #555555 !important;
    padding: 1.5mm 3mm !important;
    break-after: avoid;
    page-break-after: avoid;
  }
  .day-section-title {
    color: #000000 !important;
    font-size: 9pt !important;
  }
  .day-section-badge {
    background: #cbd5e1 !important;
    color: #000000 !important;
    font-size: 7.5pt !important;
  }
  .table-container {
    display: block !important;
    overflow: visible !important;
  }
  .schedule-table {
    font-size: 7pt !important;
    border-collapse: collapse !important;
    width: 100% !important;
  }
  .schedule-table thead {
    display: table-header-group !important;
  }
  .schedule-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .schedule-table th, .schedule-table td {
    border: 0.5pt solid #888888 !important;
    padding: 0.8mm 1.2mm !important;
    color: #000000 !important;
  }
  .schedule-table thead th {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
  }
  .mod-pill {
    background: #ffffff !important;
    color: #000000 !important;
    border: 0.5pt solid #333333 !important;
    font-size: 7pt !important;
    font-weight: bold !important;
    padding: 0.2mm 0.8mm !important;
  }
  .legend-card {
    border: 0.5pt solid #777777 !important;
    padding: 2mm 3mm !important;
    margin-top: 3mm !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .legend-card h3 {
    font-size: 8.5pt !important;
    margin-bottom: 1.5mm !important;
  }
  .legend-table th, .legend-table td {
    font-size: 7pt !important;
    padding: 0.8mm 1.2mm !important;
  }
}
