/* Importar fuente */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');

/* Variables de colores basadas en bio.css */
:root {
  --rosa: #ffd6e8;
  --azul-pastel: #baeaff;
  --azul-claro: #c2f0fc;
  --texto: #3a3a3a;
  --fondo: #fdf6f9;
  --blanco: #ffffff;
  --dorado: #ffd700;
  --dorado-oscuro: #daa520;
  --gris: #c0c0c0;
  --gris-oscuro: #808080;
  --bronce: #cd7f32;
  --bronce-claro: #deb887;
  --sombra: rgba(0,0,0,0.1);
  --sombra-dorada: rgba(255, 215, 0, 0.3);
  --sombra-gris: rgba(128, 128, 128, 0.2);
  --sombra-bronce: rgba(205, 127, 50, 0.25);
}

/* Fondo animado de estrellas (copiado de bio.css) */
.stars {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}
.stars::before, .stars::after {
  content: "";
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
  background-image:
    radial-gradient(white 1px, transparent 1px),
    radial-gradient(#ffe3f7 1.5px, transparent 1.5px),
    radial-gradient(#b2eaff 1px, transparent 1px);
  background-size: 80px 80px, 120px 120px, 200px 200px;
  background-position: 0 0, 40px 60px, 100px 120px;
  opacity: 0.7;
  animation: stars-move 60s linear infinite;
}
.stars::after {
  background-size: 160px 160px, 240px 240px, 400px 400px;
  background-position: 80px 40px, 60px 100px, 200px 80px;
  opacity: 0.4;
  animation-duration: 90s;
}

@keyframes stars-move {
  0% { transform: translateY(0); }
  100% { transform: translateY(40px); }
}

/* Efecto de brillo para los emojis decorativos */
.sparkle {
  animation: sparkle 1.5s infinite alternate;
  filter: drop-shadow(0 0 6px #fff7);
}
@keyframes sparkle {
  0% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.7; transform: scale(1.2) rotate(10deg); }
  100% { opacity: 1; transform: scale(1) rotate(-10deg); }
}

/* Estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Header */
.certificados-header {
  background: linear-gradient(120deg, #ffd1dc, #c2f0fc);
  padding: 2rem;
  text-align: center;
  color: var(--texto);
  box-shadow: 0 4px 20px rgba(255, 209, 220, 0.15);
  position: relative;
  z-index: 2;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
}

.certificados-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.tagline {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* Navegación del header */
.header-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-nav a {
  background: rgba(255, 255, 255, 0.9);
  color: var(--texto);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-nav a:hover {
  background: var(--rosa);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Contenedor principal */
.certificados-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

/* Secciones */
.certificados-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px var(--sombra);
  color: var(--texto);
}

.section-title.oro {
  background: linear-gradient(135deg, var(--dorado), var(--dorado-oscuro));
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  box-shadow: 0 6px 20px var(--sombra-dorada);
}

/* Grid de certificados */
.certificados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem;
}

/* Tarjetas de certificados */
.certificado-card {
  background: var(--blanco);
  border-radius: 20px;
  padding: 0;
  text-align: center;
  box-shadow: 0 8px 24px var(--sombra);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.certificado-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gris);
  border-radius: 20px 20px 0 0;
  z-index: 2;
}

.certificado-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

/* Contenedor de la imagen del certificado */
.certificado-preview {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.certificado-imagen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.certificado-card:hover .certificado-imagen {
  transform: scale(1.05);
}

/* Overlay con información */
.certificado-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg, 
    transparent 0%, 
    rgba(0,0,0,0.3) 70%, 
    rgba(0,0,0,0.7) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.certificado-card:hover .certificado-overlay {
  opacity: 1;
}

/* Botón ver completo */
.btn-ver-completo {
  background: rgba(255, 255, 255, 0.9);
  color: var(--texto);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-ver-completo:hover {
  background: white;
  transform: scale(1.05);
}

/* Información del certificado */
.certificado-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Estilos específicos por tipo */

/* Títulos de Oro */
.titulo-oro {
  border: 3px solid var(--dorado);
  background: linear-gradient(135deg, #fff9e6, #fffbf0);
}

.titulo-oro::before {
  background: linear-gradient(90deg, var(--dorado), var(--dorado-oscuro));
}

.titulo-oro:hover {
  box-shadow: 0 12px 32px var(--sombra-dorada);
}

/* Títulos normales */
.titulo {
  border: 3px solid var(--gris);
  background: linear-gradient(135deg, #f8f8f8, #ffffff);
}

.titulo::before {
  background: linear-gradient(90deg, var(--gris), var(--gris-oscuro));
}

.titulo:hover {
  box-shadow: 0 12px 32px var(--sombra-gris);
}
/* Diplomados */
.diplomado {
  border: 3px solid #8b7355;
  background: linear-gradient(135deg, #f5f0ea, #faf8f5);
}

.diplomado::before {
  background: linear-gradient(90deg, #8b7355, #a0826d);
}

.diplomado:hover {
  box-shadow: 0 12px 32px rgba(139, 115, 85, 0.2);
}

.section-title.diplomado {
  background: linear-gradient(135deg, #8b7355, #a0826d);
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
  box-shadow: 0 6px 20px rgba(139, 115, 85, 0.2);
}
/* Certificados de Oro */
.certificado-oro {
  border: 3px solid var(--dorado);
  background: linear-gradient(135deg, #fff9e6, #fffbf0);
}

.certificado-oro::before {
  background: linear-gradient(90deg, var(--dorado), var(--dorado-oscuro));
}

.certificado-oro:hover {
  box-shadow: 0 12px 32px var(--sombra-dorada);
}

/* Certificados normales (bronce) */
.certificado {
  border: 3px solid var(--bronce);
  background: linear-gradient(135deg, #faf7f3, #ffffff);
}

.certificado::before {
  background: linear-gradient(90deg, var(--bronce), var(--bronce-claro));
}

.certificado:hover {
  box-shadow: 0 12px 32px var(--sombra-bronce);
}

/* Contenido de las tarjetas */
.certificado-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.certificado-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--texto);
  line-height: 1.3;
}

.institucion {
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.3rem;
}

.fecha {
  font-size: 0.9rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 0;
}

/* Modal para ver certificado completo */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 1001;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.modal-imagen {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 20px 20px 0 0;
}

.modal-info {
  padding: 1.5rem;
  text-align: center;
  background: white;
}

.modal-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--texto);
}

.modal-info p {
  margin: 0.3rem 0;
  font-size: 1.1rem;
  color: #666;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: #aaa;
  font-size: 0.9rem;
  background: linear-gradient(90deg, #ffd1dc22 0%, #c2f0fc22 100%);
  border-radius: 20px 20px 0 0;
  margin-top: 3rem;
  z-index: 2;
  position: relative;
}

/* Responsive */
@media (max-width: 768px) {
  .certificados-header h1 {
    font-size: 2rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .header-nav {
    gap: 0.5rem;
  }
  
  .header-nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }
  
  .certificados-grid {
    grid-template-columns: 1fr;
    padding: 0;
  }
  
  .certificado-preview {
    height: 180px;
  }
  
  .certificado-info {
    padding: 1.2rem;
  }
  
  .certificado-info h3 {
    font-size: 1.2rem;
  }
  
  .certificado-icon {
    font-size: 2rem;
  }
  
  .btn-ver-completo {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .certificados-container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }
  
  .certificados-header {
    padding: 1.5rem;
  }
  
  .certificados-header h1 {
    font-size: 1.8rem;
  }
  
  .certificado-preview {
    height: 150px;
  }
  
  .certificado-info {
    padding: 1rem;
  }
  
  .section-title {
    font-size: 1.4rem;
    padding: 0.8rem;
  }
  
  .certificado-info h3 {
    font-size: 1.1rem;
  }
  
  .institucion {
    font-size: 0.9rem;
  }
  
  .fecha {
    font-size: 0.8rem;
  }
  
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .modal-imagen {
    max-height: 60vh;
  }
  
  .modal-info {
    padding: 1rem;
  }
  
  .modal-info h3 {
    font-size: 1.2rem;
  }
  
  .modal-info p {
    font-size: 0.9rem;
  }
}