/*
 * print.css — Estilos de impresión Admisiones Univalle
 * Incluir UNA VEZ en el layout principal o en cada index.php:
 *   <link rel="stylesheet" href="v2/assets/css/print.css" media="print">
 *
 * El usuario simplemente presiona Ctrl+P o usa el botón del navegador.
 * No se requiere ningún otro cambio en PHP ni JS.
 */

@media print {

  /* ── 1. OCULTAR todo lo que no es contenido ──────────────────────── */
  header, footer, nav, aside,
  .navbar, .navbar-*, .topbar,

  /* Botones de acción */
  .btn, button,
  .keyboard-button,
  .styleButtonCalendar,
  .botonOferGen,
  .btn-print-univalle,
  .btn-print-univalle-oferta,
  .animated-button,

  /* Filtros y búsqueda de oferta */
  .boxFiltros,
  #buscaTuPrograma,
  .buscaTuPrograma,
  .sedesBox,
  #tfootTablaOferta,

  /* Íconos animados */
  .fa-bounce, .fa-arrow-down,

  /* Inputs ocultos de edición */
  input[type="hidden"],
  input[type="text"],
  input[type="password"],
  input[hidden],

  /* Editor CKEditor */
  .cke, .ck, [class*="ck-"],
  #btnEditar, .btn-edicion,

  /* Sección de inconvenientes, login, formularios */
  #formInconvenientes,
  #formConsulta,
  #divCitaciones,
  #containerPasosYRecomendaciones,
  #containerRecomendaciones,
  .form-check,
  #mensajeconsulta,

  /* Acordeón: ocultar solo los headers grises (botones de sección),
     NO ocultar el contenido expandido */
  .card-header.acordeon,
  .card-header.btn,

  /* Carrusel, banners, videos */
  .carousel, .carrusel,
  video, iframe,

  /* Columna de botones de acción en tablas (Info, Pago) */
  .tabla_oferta thead td:last-child,
  .tabla_oferta thead th:last-child,
  .tabla_oferta tbody td:last-child,
  .tabla_oferta tfoot,

  /* Botón de imprimir mismo (no debe aparecer impreso) */
  .no-print
  { display: none !important; }


  /* ── 2. EXPANDIR acordeones — mostrar todo el contenido ─────────── */
  .collapse {
    display: block !important;
    height: auto !important;
    visibility: visible !important;
  }
  .collapsing {
    display: block !important;
  }


  /* ── 3. PÁGINA y tipografía ──────────────────────────────────────── */
  @page {
    margin: 15mm 15mm 15mm 15mm;
    size: A4 portrait;
  }

  body {
    font-family: Arial, sans-serif !important;
    font-size: 11pt !important;
    color: #000 !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }


  /* ── 4. ENCABEZADO institucional ───── */
  .print-header {
    display: flex !important;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid #800020;
    padding-bottom: 10px;
    margin-bottom: 16px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-header img { height: 48px; width: auto; }
  .print-header-text h1 {
    font-size: 14pt; font-weight: 700; color: #800020; margin: 0; line-height: 1.2;
  }
  .print-header-text p { font-size: 9pt; color: #555; margin: 2px 0 0; }
  
  .print-titulo {
    font-size: 13pt; font-weight: 700; color: #800020;
    margin-bottom: 14px; padding-bottom: 4px; border-bottom: 1px solid #ddd;
  }


  /* ── 5. TABLAS DE OFERTA ─────────────────────────────────────────── */
  .tabla_oferta,
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
    page-break-inside: auto;
  }

  .tabla_oferta thead,
  table thead {
    background-color: #800020 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tabla_oferta thead td,
  .tabla_oferta thead th,
  table thead td,
  table thead th {
    background-color: #800020 !important;
    color: #fff !important;
    font-weight: 700;
    padding: 5px 6px;
    border: 1px solid #600018;
    text-align: center;
  }

  .tabla_oferta tbody tr:nth-child(even),
  table tbody tr:nth-child(even) {
    background-color: #f5f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tabla_oferta tbody td,
  table tbody td {
    padding: 4px 6px;
    border: 1px solid #ccc;
    vertical-align: middle;
  }

  /* Evitar que las filas se corten entre páginas */
  tr { page-break-inside: avoid; }


  /* ── 6. CONTENIDO GENERAL ────────────────────────────────────────── */
  .card { border: none !important; margin-bottom: 16px !important; }
  .card-body { padding: 0 !important; }

  h1, h2, h3, h4, h5, h6 {
    color: #800020 !important;
    page-break-after: avoid;
  }

  p { margin: 4px 0; }
  a { color: #000 !important; text-decoration: none !important; }

  /* Saltos de página controlados */
  .card { page-break-inside: avoid; }
  h3, h4 { page-break-after: avoid; }


  /* ── 7. PIE DE PÁGINA con URL y fecha ───────────────────────────── */
  body::after {
    content: "admisiones.univalle.edu.co";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #777;
    border-top: 1px solid #ccc;
    margin-top: 20px;
    padding-top: 6px;
  }

}