/* Estilos personalizados para GeoReport AI */

/* Fuentes personalizadas */
body {
  font-family: 'Inter', sans-serif;
}

.font-outfit {
  font-family: 'Outfit', sans-serif;
}

.font-serif {
  font-family: 'Playfair Display', Georgia, Cambria, "Times New Roman", Times, serif;
}

/* Efecto de papel físico para la Memoria Descriptiva */
#report-paper {
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
  line-height: 1.8;
  font-size: 13.5px;
  background-color: #ffffff;
}

#report-paper:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Renderizado del Markdown en el papel */
#report-content h1, 
#report-content h2, 
#report-content h3 {
  font-family: 'Playfair Display', serif;
  color: #0f172a; /* slate-900 */
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

#report-content h3 {
  font-size: 1.15rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

#report-content h3:first-of-type {
  text-align: center;
  font-size: 1.35rem;
  border-bottom: none;
  text-transform: uppercase;
  margin-bottom: 2rem;
  margin-top: 0;
  letter-spacing: 0.05em;
}

#report-content p {
  margin-bottom: 1rem;
  text-align: justify;
}

/* Tablas dentro del reporte de papel */
#report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 11px;
  font-family: 'Inter', sans-serif; /* Usamos sans-serif para números y datos para mayor claridad */
}

#report-content th, 
#report-content td {
  border: 1px solid #cbd5e1; /* slate-300 */
  padding: 6px 10px;
  text-align: left;
}

#report-content th {
  background-color: #f8fafc; /* slate-50 */
  font-weight: 600;
  color: #334155; /* slate-700 */
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}

#report-content tr:nth-child(even) {
  background-color: #f8fafc/50;
}

/* Animaciones y Clases Auxiliares */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin 3s linear infinite;
}

/* Transiciones de Vistas (SPA) */
.transition-view {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* Toast Notifications */
.toast {
  animation: slideIn 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Barra de Scroll Fina */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   PLANTILLA PDF PROFESIONAL (oculta en UI, usada para exportar)
   ============================================================ */

#pdf-template {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 816px; /* Ancho Letter en 96dpi */
  background: #ffffff;
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.7;
}

#pdf-template .pdf-page {
  width: 816px;
  min-height: 1056px;
  padding: 60px 70px;
  box-sizing: border-box;
  background: #fff;
  position: relative;
}

/* Encabezado / Membrete */
#pdf-template .pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #1a472a;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

#pdf-template .pdf-header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#pdf-template .pdf-header-brand .brand-name {
  font-family: 'Arial', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #1a472a;
  letter-spacing: -0.5px;
  line-height: 1;
}

#pdf-template .pdf-header-brand .brand-name span {
  color: #2d6a4f;
}

#pdf-template .pdf-header-brand .brand-sub {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  color: #4a7c59;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

#pdf-template .pdf-header-meta {
  text-align: right;
  font-family: 'Arial', sans-serif;
  font-size: 9.5px;
  color: #555;
  line-height: 1.6;
}

#pdf-template .pdf-header-meta .meta-label {
  font-weight: 600;
  color: #333;
}

/* Título del documento */
#pdf-template .pdf-doc-title {
  text-align: center;
  margin-bottom: 18px;
}

#pdf-template .pdf-doc-title h1 {
  font-family: 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #0f2717;
  border-top: 1px solid #c5d8c8;
  border-bottom: 1px solid #c5d8c8;
  padding: 8px 0;
  display: inline-block;
  width: 100%;
  margin: 0;
}

#pdf-template .pdf-doc-title p {
  font-size: 10.5px;
  color: #555;
  margin: 4px 0 0;
  font-style: italic;
}

/* Cuadro de datos del proyecto */
#pdf-template .pdf-project-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  background: #f4f9f5;
  border: 1px solid #c5d8c8;
  border-left: 4px solid #2d6a4f;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 11px;
}

#pdf-template .pdf-project-box .field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#pdf-template .pdf-project-box .field-label {
  font-family: 'Arial', sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2d6a4f;
}

#pdf-template .pdf-project-box .field-value {
  font-size: 11.5px;
  color: #111;
  font-weight: 500;
}

/* Resumen geométrico */
#pdf-template .pdf-geometry-summary {
  display: flex;
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid #c5d8c8;
  border-radius: 4px;
  overflow: hidden;
}

#pdf-template .pdf-geometry-summary .geo-item {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  background: #f4f9f5;
  border-right: 1px solid #c5d8c8;
}

#pdf-template .pdf-geometry-summary .geo-item:last-child {
  border-right: none;
}

#pdf-template .pdf-geometry-summary .geo-label {
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4a7c59;
  display: block;
  margin-bottom: 3px;
}

#pdf-template .pdf-geometry-summary .geo-value {
  font-family: 'Arial', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0f2717;
}

/* Sección del cuerpo */
#pdf-template .pdf-section {
  margin-bottom: 18px;
}

#pdf-template .pdf-section-title {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a472a;
  border-bottom: 1.5px solid #2d6a4f;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

/* Memoria descriptiva renderizada */
#pdf-template .pdf-report-body h1,
#pdf-template .pdf-report-body h2,
#pdf-template .pdf-report-body h3 {
  font-family: 'Arial', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a472a;
  border-bottom: 1px solid #c5d8c8;
  padding-bottom: 3px;
  margin: 14px 0 6px;
}

#pdf-template .pdf-report-body p {
  text-align: justify;
  margin-bottom: 8px;
  font-size: 12.5px;
}

#pdf-template .pdf-report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 10px;
  font-family: 'Arial', sans-serif;
}

#pdf-template .pdf-report-body th {
  background: #1a472a;
  color: #ffffff;
  padding: 5px 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 8.5px;
  text-align: center;
  border: 1px solid #1a472a;
}

#pdf-template .pdf-report-body td {
  padding: 4px 8px;
  border: 1px solid #c5d8c8;
  text-align: center;
  font-size: 10px;
}

#pdf-template .pdf-report-body tr:nth-child(even) td {
  background: #f4f9f5;
}

#pdf-template .pdf-report-body strong {
  font-weight: 700;
}

/* Tablas de datos */
#pdf-template .pdf-data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  margin-bottom: 16px;
}

#pdf-template .pdf-data-table thead th {
  background: #1a472a;
  color: #fff;
  padding: 6px 8px;
  text-align: center;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #155127;
}

#pdf-template .pdf-data-table tbody td {
  padding: 5px 8px;
  border: 1px solid #c5d8c8;
  text-align: center;
}

#pdf-template .pdf-data-table tbody td:first-child {
  font-weight: 700;
  background: #f4f9f5;
  text-align: left;
}

#pdf-template .pdf-data-table tbody tr:nth-child(even) td {
  background: #f9fbfa;
}

#pdf-template .pdf-data-table tbody tr.closing-row td {
  background: #e8f5e9;
  font-style: italic;
  color: #2d6a4f;
}

/* Bloque de firma */
#pdf-template .pdf-signature-block {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

#pdf-template .pdf-signature {
  width: 260px;
  text-align: center;
}

#pdf-template .pdf-signature .sig-line {
  border-top: 1px solid #333;
  margin-bottom: 5px;
}

#pdf-template .pdf-signature .sig-name {
  font-weight: 700;
  font-size: 11px;
  color: #111;
}

#pdf-template .pdf-signature .sig-title {
  font-size: 10px;
  color: #555;
  font-style: italic;
  margin-top: 2px;
}

#pdf-template .pdf-signature .sig-badge {
  display: inline-block;
  margin-top: 4px;
  font-family: 'Arial', sans-serif;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2d6a4f;
  background: #f4f9f5;
  border: 1px solid #c5d8c8;
  padding: 2px 8px;
  border-radius: 2px;
}

/* Pie de página */
#pdf-template .pdf-footer {
  margin-top: 28px;
  border-top: 1px solid #c5d8c8;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Arial', sans-serif;
  font-size: 8.5px;
  color: #888;
}

#pdf-template .pdf-footer .footer-left {
  color: #4a7c59;
  font-weight: 600;
  font-size: 9px;
}

#pdf-template .pdf-footer .footer-center {
  font-style: italic;
}

#pdf-template .pdf-footer .footer-right {
  color: #888;
}
