/* Declaración de fuentes Poppins */
@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('./public/fonts/poppins/Poppins-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
}

/* Variables de color */
:root {
  --color-primary: #2c3e50;
  --color-accent: #3498db;
  --color-text: #333;
  --color-text-light: #666;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-border: #e1e8ed;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

/* Reset y aplicación de fuente */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--color-text);
  line-height: 1.7;
  padding: var(--spacing-lg) var(--spacing-sm);
  min-height: 100vh;
}

/* Contenedor principal */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--color-bg);
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Header */
header {
  text-align: center;
  padding-bottom: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  border-bottom: 2px solid var(--color-border);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.5px;
}

.resumen-section {
  padding: 0;
  margin-bottom: var(--spacing-xl);
  background: transparent;
  border: none;
  box-shadow: none;
}

.resumen-section h2 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  font-size: 1.8rem;
  font-weight: 600;
  padding-bottom: var(--spacing-xs);
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

.resumen-section p {
  margin: 0;
  line-height: 1.8;
  color: var(--color-text);
  font-size: 1rem;
  text-align: left;
}

.resumen-section strong {
  color: var(--color-primary);
  font-weight: 600;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.5px;
}

header p {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-sm);
  font-size: 1rem;
}

header a {
  display: inline-block;
  margin: 0 var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  color: var(--color-accent);
  text-decoration: none;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

header a:hover {
  background-color: var(--color-accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Secciones */
section {
  margin-bottom: var(--spacing-xl);
}

section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

/* Articles */
article {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background-color: var(--color-bg-alt);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

article:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

article h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

article h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

article p {
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
  line-height: 1.7;
}

article p:last-child {
  margin-bottom: 0;
}

/* Listas */
ul {
  list-style: none;
  padding-left: 0;
}

section > ul > li {
  padding: var(--spacing-xs) 0;
  padding-left: var(--spacing-md);
  position: relative;
  color: var(--color-text);
}

section > ul > li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

article ul li {
  padding: 0.3rem 0;
  color: var(--color-text-light);
}

/* Enlaces */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #2980b9;
}

/* Strong */
strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* Certificaciones */
.certification-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--color-bg-alt);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
}

.certification-wrapper a {
  flex-shrink: 0;
  border: none;
  padding: 0;
  margin: 0;
}

.certification-wrapper a:hover {
  transform: scale(1.05);
  background-color: transparent;
}

.oracle_img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.oracle_img:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Footer */
footer {
  text-align: center;
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  border-top: 2px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: var(--spacing-sm) var(--spacing-xs);
  }

  .main-container {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  header h1 {
    font-size: 2rem;
  }

  section h2 {
    font-size: 1.5rem;
  }

  article h3 {
    font-size: 1.15rem;
  }

  header a {
    display: block;
    margin: var(--spacing-xs) 0;
  }

  .certification-wrapper {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   ESTILOS PARA IMPRESIÓN / PDF
   ============================================ */
@media print {
  /* Forzar colores exactos en PDF */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Resetear body para impresión */
  body {
    background: white !important;
    margin: 0;
    padding: 0;
  }

  /* Contenedor principal sin decoraciones */
  .main-container {
    max-width: 100%;
    margin: 0;
    padding: 1.5cm 2cm;
    box-shadow: none;
    border-radius: 0;
  }

  /* Resumen profesional en impresión */
  .resumen-section {
    background: transparent !important;
    border: none;
    padding: 0;
    margin-bottom: 1.5rem;
  }

  /* Evitar saltos de página dentro de secciones */
  section, article {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Asegurar que títulos no queden huérfanos */
  h1, h2, h3, h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Optimizar header para impresión */
  header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  /* Optimizar enlaces para impresión */
  a {
    text-decoration: none;
    color: var(--color-accent);
  }

  /* Mostrar URLs de enlaces importantes */
  header a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9px;
    color: var(--color-text-light);
  }

  /* Remover efectos hover */
  article:hover {
    transform: none;
    box-shadow: none;
  }

  header a:hover {
    transform: none;
    box-shadow: none;
  }

  /* Ajustar títulos de sección */
  section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  article h3 {
    font-size: 1.1rem;
  }

  article h4 {
    font-size: 1rem;
  }

  /* Footer al final de la página */
  footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    font-size: 9px;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    padding: 8px 0;
    background: white;
  }

  /* Ajustar imagen de certificación */
  .oracle_img {
    max-width: 70px;
    height: auto;
  }

  .certification-wrapper {
    page-break-inside: avoid;
  }

  /* Reducir espaciado para optimizar espacio */
  section {
    margin-bottom: 1.2rem;
  }

  article {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
  }

  /* Asegurar que no se corte contenido */
  .main-container {
    overflow: visible;
  }

  /* Optimizar listas */
  ul {
    margin-bottom: 0.5rem;
  }

  article ul li,
  section > ul > li {
    padding: 0.2rem 0;
  }

  /* Evitar que la última sección quede huérfana */
  section:last-of-type {
    page-break-inside: auto;
  }
}