
:root {
  --bg-color: #f9fbf9;
  --text-color: #111811;
  --link-hover: #3b663b;
  --accent-color: #5d895d;
  --navbar-bg-color:#eaf1ea;
  --cookies-bg-color:#d4e6d4;
}

body {
  font-family: Manrope, "Noto Sans", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
}
body.dark {
  --bg-color: #111811;
  --text-color: #f9fbf9;
  --link-hover: #9ae49a;
  --accent-color: #5d895d;
  --navbar-bg-color:#345f34; 
  --cookies-bg-color:#212e21;
}
header {
  position: relative; 
  z-index: 10; 
  background-color: var(--navbar-bg-color);
  border:var(--navbar-bg-color);
}
footer {
  background-color: var(--navbar-bg-color);
  color: var(--text-color);
}
.modal.hidden {
  display: none;
}

@keyframes fadeInBg {
  from {
    background: rgba(0, 0, 0, 0);
  }
  to {
    background: rgba(0, 0, 0, 0.6);
  }
}
/* TARJETAS: limitar altura y mantener proporción */
.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* separa imagen, texto y botones */
  max-width: 300px;  /* ancho máximo de la tarjeta */
  height: 100%;      /* opcional, según contenedor */
  overflow: hidden;  /* evita que algo sobresalga */
}

/* Imagen dentro de la tarjeta */
.project-card img {
  width: 100%;
  max-height: 180px; /* limita altura */
  object-fit: cover; /* recorta la imagen si es necesario */
  border-radius: 0.5rem;
}

/* Botones dentro de la tarjeta */
.card-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem; /* un poco más amplio */
}


/* TARJETAS */
.grid .bg-cover {
  width: 100%;
  aspect-ratio: 3 / 2; /* altura relativa al ancho */
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


/* Hover efecto */
.grid .bg-cover:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}
.project-card img {
  margin-bottom: 0.75rem; /* espacio debajo de la imagen */
}

.project-card h4 {
  margin-bottom: 0.5rem; /* espacio debajo del título */
}

.project-card p {
  margin-bottom: 0.75rem; /* espacio debajo del texto */
}



/* Botones verdes (más pequeños que antes) */
.btn-green {
  background-color: var(--link-hover);
  color: var(--bg-color);
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;      
}

.btn-green:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
  transform: translateY(-2px);
}

/* Centrado de botones en tarjetas y modal */
#modalLinks {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
/* Botones dentro del modal: un poco más grandes */
#modalLinks .btn-green {
  padding: 0.75rem 1.5rem; /* más grandes que en las cards */
  font-size: 1rem;
}

.card-links .btn-green {
  flex: 1 1 auto; /* Permite que los botones se ajusten */
  min-width: 100px; /* Tamaño mínimo de botón */
  max-width: 140px; /* Tamaño máximo opcional */
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.modal-content {
  background: var(--bg-color);
  border-radius: 0.75rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  padding: 1.5rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  position: relative;
  animation: slideIn 0.3s ease forwards;
  overflow-y: auto;
}
.modal-links {
  margin-top: 1rem;
  display: flex;
  gap: 10px;
}
.modal-links .btn {
  padding: 8px 12px;
  border-radius: 5px;
  background: #333;
  color: var(--navbar-bg-color);
  text-decoration: none;
}
.modal-links .btn:hover {
  background: var(--modal-text);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === OVERLAY MODAL === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 2rem;
}

/* === CONTENIDO DEL MODAL === */
.modal-content {
  background: var(--bg-color);
  border-radius: 12px;
  max-width: 600px;      /* controla ancho máximo */
  width: 90%;            /* ancho relativo en pantallas pequeñas */
  max-height: 80vh;      /* limita altura para scroll */
  padding: 2rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  position: relative;
  overflow-y: auto;      /* permite scroll interno */
}

/* === BOTÓN DE CERRAR === */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-color);
  color: var(--text-color);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}
.modal-close:hover {
  background: var(--link-hover);
}

/* === TARJETAS DENTRO DEL MODAL (opcional) === */
.modal-content .project-card {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  max-width: 100%;  /* nunca exceda ancho del modal */
}
/* === BOTONES DENTRO DEL MODAL === */
.modal-content .btn {
  background-color: var(--accent-color);
  color: var(--bg-color);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  line-height: 1.2;
  text-align: center;

  margin: 0.5rem 0.25rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: normal;
}
.modal-images {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-images img {
  width: 100%;
  max-height: 12rem;
  object-fit: cover;
  border-radius: 0.5rem;
}
/* Solo cuando se activa la miniatura */
.thumb {
  width: 100px;       /* tamaño de miniatura */
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.8;
}

.thumb.active {
  border: 2px solid var(--accent-color);  /* resaltar la activa */
  opacity: 1;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.modal-description {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.modal-details {
  font-size: 0.9rem;
  color: var(--modal-text);
  white-space: pre-line;
}

/* Proyecto - tarjeta */
.project-card {
  background: var(--navbar-bg-color);              
  border: 1px solid var(--navbar-bg-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}



.project-card img {
  border-radius: 0.5rem;
  object-fit: cover;
  aspect-ratio: 3 / 2;
  transition: transform 0.3s ease;
}

.project-card h4 {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  transition: color 0.3s ease;
}

.project-card p {
  color: var(--modal-text);
  font-size: 0.8rem;
  margin: 0;
  transition: color 0.3s ease;
}


.project-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 10px 15px rgba(93, 137, 93, 0.3);
  transform: translateY(-6px);
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card:hover h4 {
  color: var(--link-hover);
}

.project-card:hover p {
  color: var(--link-hover);
}

.modal-main-image img {
  width: 100%;
  max-height: 20rem;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.modal-extra-images {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}



/* === ANIMACIÓN DE ENTRADA === */

@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animacion-entrada {
  animation: fadeSlideUp 0.8s ease-out forwards;
}

.layout-container, header, main, footer {
  position: relative;
  z-index: 5; /* cualquier valor positivo */
}

/*Vectores animados*/
/* Contenedor del fondo animado */
.background-anim {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Formas base */
.background-anim .shape {
  position: absolute;
  opacity: 0.5;
}


/* === NUEVAS FIGURAS VERDES Y AMARILLA === */

/* Shape 9: óvalo verde claro */
.shape9 {
  top: 15%;
  left: 25%;
  width: 180px;
  height: 100px;
  border-radius: 50%;
  background-color: rgba(120, 255, 120, 0.4);
  animation: float9 30s linear infinite;
}

/* Shape 10: triángulo verde medio */
.shape10 {
  top: 50%;
  left: 10%;
  width: 140px;
  height: 140px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background-color: rgba(0, 200, 0, 0.4);
  animation: float10 35s linear infinite;
}

/* Shape 11: círculo verde oscuro */
.shape11 {
  top: 65%;
  left: 70%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background-color: rgba(0, 120, 0, 0.4);
  animation: float11 40s linear infinite;
}

/* Shape 12: pentágono amarillo suave */
.shape12 {
  top: 30%;
  left: 80%;
  width: 130px;
  height: 130px;
  clip-path: polygon(50% 0%, 95% 35%, 77% 90%, 23% 90%, 5% 35%);
  background-color: rgba(255, 230, 100, 0.4);
  animation: float12 38s linear infinite;
}

/* Animaciones únicas */
@keyframes float9 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(30px,-20px) rotate(45deg); }
  50%  { transform: translate(-20px,-40px) rotate(90deg); }
  75%  { transform: translate(20px,-30px) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}

@keyframes float10 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-40px,-30px) rotate(60deg); }
  50%  { transform: translate(50px,-50px) rotate(120deg); }
  75%  { transform: translate(-30px,-20px) rotate(240deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}

@keyframes float11 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(20px,-50px) rotate(45deg); }
  50%  { transform: translate(-30px,-60px) rotate(90deg); }
  75%  { transform: translate(40px,-30px) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}

@keyframes float12 {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-30px,-20px) rotate(30deg); }
  50%  { transform: translate(40px,-40px) rotate(60deg); }
  75%  { transform: translate(-20px,-30px) rotate(180deg); }
  100% { transform: translate(0,0) rotate(360deg); }
}



/* Menú desktop y móvil */
header nav a,
#navLinks a {
  position: relative;
  padding-bottom: 2px;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
  
}

/* Línea animada */
header nav a::after,
#navLinks a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color); 
  transition: width 0.3s ease;
}

/* Hover */
header nav a:hover,
#navLinks a:hover {
  color: var(--link-hover);
}

header nav a:hover::after{
  width: 100%;
}
#navLinks a.projects::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent-color);
  width: 0;
  transition: width 0.3s;
}

#navLinks a.projects:hover::after {
  width: 70px;
}
#navLinks a.aboutme::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent-color);
  width: 0;
  transition: width 0.3s;
}

#navLinks a.aboutme:hover::after {
  width: 80px;
}
#navLinks a.home::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent-color);
  width: 0;
  transition: width 0.3s;
}

#navLinks a.home:hover::after {
  width: 50px;
}
/* Estado inicial: menú móvil oculto */
#navLinks {
  display: none; /* oculto por defecto */
  flex-direction: column;
  gap: 12px;
  padding: 1rem 2rem;
  background: var(--navbar-bg-color);
}

/* Cuando se activa toggle */
#navLinks.show {
  display: flex; /* se muestra con flex */
}


.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;  /* cambia a left:20px si lo quieres en la izquierda */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5d895d;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000; /* asegura que quede por encima de todo */
}


.theme-toggle:hover {
  transform: scale(1.1);
}

/* --- Animaciones sol/luna --- */
.theme-toggle svg {
  position: absolute;
  width: 24px;
  height: 24px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.theme-toggle .sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle .moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

body.dark .theme-toggle {
  background: #333;
}

body.dark .theme-toggle .sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
body.dark .theme-toggle .moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.lang-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px; /* 👉 esquina opuesta al darkToggle */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color, #5d895d);
  color: white;
  font-weight: bold;
  font-family: sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
}

.lang-toggle:hover {
  transform: scale(1.1);
}

/* --- Animación textos EN ↔ ES --- */
.lang {
  position: absolute;
  font-size: 14px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.lang.en {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.lang.es {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

/* Cuando esté en español */
body.lang-es .lang-toggle {
  background: #333;
}
body.lang-es .lang.en {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
body.lang-es .lang.es {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
#cookie-banner {
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.lang-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent-color, #5d895d);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform 0.2s ease, background 0.3s ease;
}

.lang-toggle:hover {
  transform: scale(1.1);
}

.lang-toggle .lang {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.lang.en {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.lang.es {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
