﻿
/* ===== variables ===== */
:root{
  --bg-page: #011925;
  --card-bg: #f1f2f3;
  --accent-1: #023047;   /* azul oscuro */
  --accent-2: #219ebc;   /* azul claro */
  --text-dark: #003c5f;
  --muted: #c4dafa;
  --white: #ffffff;

  --max-width: 980px;    /* ancho por defecto (más contenido que 70% fijo) */
  --container-radius: 12px;
  --card-radius: 7px;
  --gap: 16px;

  --t-fast: 0.18s;
  --t-med: 0.28s;
}

/* ===== reset y base ===== */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }
ul, ol {
    list-style: none;

}

html, body { height: 100%; }

body{
  background: var(--bg-page);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-dark);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
}

/* enlaces: sin subrayado por defecto, pero accesible */
a { text-decoration: none; color: inherit; }

/* contenedor principal: ancho controlado por variable */
.page-container{
  margin: 40px auto;
  width: calc(100% - 48px);
  max-width: var(--max-width);
  background: var(--card-bg);
  border-radius: var(--container-radius);
  box-shadow: 0 0 15px 5px rgba(196,218,250,0.27);
  overflow: hidden;
}

/* ===== HERO ===== */
.hero-section{
  margin: 36px auto;
  width: 90%;
  padding: 18px;
  border-radius: var(--card-radius);
  background: linear-gradient(90deg, var(--accent-1) 15%, var(--accent-2) 85%);
  color: var(--white);
  box-shadow: 0 0 15px 5px rgba(1,25,37,0.67);
}

/* layout de hero: fila con imagen a la izquierda y tecnologias a la derecha */
.hero-row1{
  display: flex;
  align-items: flex-start; /* imagen y contenedor de tecnologías alineados arriba */
  gap: 18px;
  width: 100%;
}

/* foto: tamaño fijo y consistente */
.hero-image-container{
  flex: 0 0 160px; /* ancho fijo para mantener la proporción */
}
.hero-image{
  display: block;
  width: 100%;
  height: auto;
  max-width: 160px;
  border-radius: 7px;
  box-shadow: 1px 1px 3px rgba(241,242,243,0.85);
  object-fit: cover;
}

/* contenedor de tecnologías: justo a la derecha y alineado a la derecha */
.hero-technologies-container {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--accent-2) 15%, var(--accent-1) 85%);
  
  /* FUERZA EL ANCHO AQUÍ */
  width: 320px; 
  min-width: 0;      /* Importante para fieldset */
  max-width: 320px; 
  box-sizing: border-box; 

  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  overflow: visible; 
}
.tech-caption {
  position: absolute;
  bottom: -25px; /* Ajustado para caer dentro del padding del wrapper */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.slider-wrapper {
  width: 100%;
  overflow: hidden; /* Corta los iconos laterales */
  position: relative;
  padding-bottom: 30px; /* Espacio vital para que el nombre no se corte al aparecer */
  margin-bottom: -30px; /* Compensa el espacio para mantener el diseño del hero */
}

/* lista de iconos: distribución horizontal, pero se adaptan */
.hero-technologies-list {
  display: flex;
  gap: 24px; 
  width: max-content;
  /* animation: scroll-infinite 20s linear infinite; */
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero-technologies-list:hover {
  animation-play-state: paused;
}

@keyframes scroll-infinite {
  to {
    transform: translateX(var(--scroll-distance));
  }
}


/* item individual: icono con caption emergente */
.technology-item {
  position: relative; /* Necesario para posicionar el caption respecto al icono */
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.technology-item img{
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  aspect-ratio: 1 / 1; 
  object-fit: contain;
}

/* caption por hover */
.tech-caption{
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.72);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
.technology-item:hover .tech-caption {
  opacity: 1;
}
.technology-item:hover {
  transform: scale(1.1);
}
/* Si quieres iconos más grandes en pantallas amplias */
@media (min-width: 1200px){
  .technology-item img{ width: 56px; height: 56px; }
}

/* ===== Navegación (mantengo estilo que te gustó) ===== */
.site-navigation{
  background: var(--card-bg);
  padding: 6px 0;
  display: flex;
  justify-content: center;
}

.nav-links{
  display: flex;
  gap: 8px;
  align-items: center;
  width: 85%;
  max-width: 900px;
  background: var(--accent-1);
  margin: 0 auto;
  padding: 6px;
  border-radius: 7px;
  list-style: none;
}

/* enlaces nav */
.nav-links li { list-style: none; }
.nav-links a{
  display: inline-block;
  padding: 8px 10px;
  color: var(--white);
  font-weight: 600;
  border-radius: 7px;
  transition: transform var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.nav-links a:hover{
  transform: translateY(-2px) scale(1.05);
  background: #e8e8e8;
  color: var(--accent-1);
  box-shadow: 0 0 5px 1px rgba(0,81,135,0.16);
}

/* ===== Secciones (limpio y simplifico márgenes) ===== */
.section{
  width: 90%;
  margin: 18px auto;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: 2px 5px 15px rgba(2,48,71,0.35);
  padding: 12px;
}
legend{
  font-weight: bold;
}

.section > h2{
  font-weight: 700;
  margin: 18px;
}

/* artículos dentro de secciones */
.section article{
  margin: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--muted);
}

/* botones-enlaces de proyectos / certificaciones */
.proyecto-item .links a,
.certificaciones-item ul li a,
.cursos ul li a{
  display: inline-block;
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  color: #005187;
  font-weight: 700;
  transition: transform var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.proyecto-item .links a:hover,
.certificaciones-item ul li a:hover,
.cursos ul li a:hover{
  background: #005187;
  color: var(--card-bg);
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.12);
}

/* iframe responsivo */
.iframe-container{
  margin: 20px auto;
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 10px 2px rgba(1,25,37,0.27);
}
.iframe-container iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* pequeñas tarjetas: experiencia, educacion, etc. */
.certificaciones-item,
.experiencia-item,
.educacion-item{
  margin: 16px;
  padding: 14px;
  border-radius: 7px;
  border-style: none;
  box-shadow: 0 0 5px 2px rgba(196,218,250,0.67);
}

/* cursos: quito paddings redundantes */
.cursos ul{ list-style: none; padding: 0 12px 18px; margin: 0; }
.cursos ul li{ margin: 8px 0; }

/* ===== Footer ===== */
.site-footer{
  background: var(--accent-1);
  color: var(--white);
  padding: 28px 0 18px;
}
.contact-container{ width: 85%; margin: 0 auto; text-align:center; }
.site-footer h2{ color: var(--accent-2); display:inline-block; padding-bottom:6px; border-bottom:2px solid var(--accent-2); }

/* iconos de contacto */
.contact-list{ display:flex; justify-content:center; gap:24px; flex-wrap:wrap; list-style:none; padding: 16px 0; margin: 0; }
.contact-item a{ display:flex; flex-direction:column; align-items:center; padding: 8px 12px; border-radius:7px; color: var(--white); transition: transform var(--t-fast), background var(--t-fast); }
.contact-item a:hover{ transform: translateY(-4px); background: var(--accent-2); box-shadow: 0 6px 10px rgba(0,0,0,0.12); }
.contact-icon{ width: 36px; height: 36px; margin-bottom: 6px; filter: invert(100%); }

/* --- ESTILOS DEL INTERRUPTOR DE LENGUAJE --- */

.language-switcher {
    text-align: right;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end; /* Alinea todo a la derecha */
    align-items: center;
    gap: 8px; /* Espacio entre el texto "Lenguaje" y los botones */
    
    /* Usa un color neutro o el color de texto oscuro */
    color: var(--text-dark); 
    background-color: var(--card-bg); /* Mismo fondo de la tarjeta */
    border-top-left-radius: var(--container-radius);
    border-top-right-radius: var(--container-radius);
}

.switcher-label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--accent-1); /* Color azul oscuro de acento */
}

.lang-buttons-group {
    display: inline-flex;
    border: 1px solid var(--accent-1);
    border-radius: var(--card-radius); /* Bordes redondeados para el grupo */
    overflow: hidden; /* Asegura que el borde se vea limpio */
}

.lang-btn {
    /* Reset de estilos */
    background: var(--card-bg); 
    border: none; /* Quitamos el borde individual */
    color: var(--accent-1); 
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    transition: background-color var(--t-fast), color var(--t-fast);
}

/* Separa los botones, excepto el último */
.lang-btn:not(:last-child) {
    border-right: 1px solid var(--accent-1);
}

.lang-btn:hover {
    background-color: var(--muted); /* Sutil fondo al pasar el mouse */
}

.lang-btn.active {
    background-color: var(--accent-1); /* Relleno total si está activo */
    color: var(--white);
    pointer-events: none; /* No permitir clic si ya está activo */
}

/* --- Estilos para las imágenes de los proyectos --- */

/* Asegura que cualquier imagen dentro del contenedor de la tarjeta 
   no exceda el ancho del mismo, manteniendo la proporción. */
.proyecto-item img {
    
    max-width: 95%; 
    
    height: auto; 
    
    display: block; 
    margin: 10px auto;
    
    border-radius: 7px;
    box-shadow: 0 0 10px 2px rgba(196,218,250,0.27);
}

/* Si quieres añadir un pequeño margen vertical entre las imágenes: */
.proyecto-imagen {
    margin-bottom: 20px;
}

.ver-mas-proyectos {  
    text-align: center;  
    margin: 30px 0;  
}  
  
.ver-mas-proyectos a {  
    display: inline-block;  
    padding: 12px 24px;  
    background: var(--accent-2);  
    color: var(--white);  
    text-decoration: none;  
    border-radius: var(--card-radius);  
    transition: background var(--t-fast);  
}  
  
.ver-mas-proyectos a:hover {  
    background: var(--accent-1);  
}  
  
.back-nav {  
    text-align: center;  
    margin: 40px 0;  
}  
  
.back-nav a {  
    color: var(--accent-1);  
    text-decoration: none;  
    font-weight: 600;  
}

/* Contenedor de etiquetas */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 15px 0; /* Espaciado entre título y descripción */
}

/* Estilo individual de la etiqueta */
.tag {
    background-color: #ffffff;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    transition: all 0.3s ease;
    cursor: default;
}

/* Efecto sutil al pasar el mouse */
.tag:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

/* Opcional: Colores temáticos por categoría principal */
/* --- COLORES TEMÁTICOS (SOPORTA MULTI-CATEGORÍA) --- */

/* Si el proyecto incluye 'engineering' en cualquier posición */
[data-category~="engineering"] .tag { 
    border-left: 3px solid #3b82f6; /* Azul */
} 

/* Si el proyecto incluye 'analysis' en cualquier posición */
[data-category~="analysis"] .tag { 
    border-left: 3px solid #f59e0b; /* Naranja/Oro */
} 

/* Si el proyecto incluye 'science' en cualquier posición */
[data-category~="science"] .tag { 
    border-left: 3px solid #10b981; /* Verde */
}

/* Prioridad: Si es híbrido (como el de Netflix), puedes decidir cuál color domina 
   o dejar que las reglas CSS se apliquen en orden */
[data-category~="analysis"][data-category~="engineering"] .tag {
    border-left: 3px solid #8b5cf6; /* Morado para proyectos híbridos (opcional) */
}

[data-category~="engineering"] .tag:hover { background-color: #eff6ff; }
[data-category~="analysis"] .tag:hover { background-color: #fffbeb; }
[data-category~="science"] .tag:hover { background-color: #ecfdf5; }
/* --- ESTILOS DEL FILTRO DE CATEGORÍAS --- */

.filter-container {
    width: 90%;
    margin: 20px auto 10px auto; /* Alineado con las secciones */
    display: flex;
    align-items: center;
    justify-content: flex-start; /* O flex-end si prefieres a la derecha */
    gap: 12px;
    padding: 0 12px;
}

.filter-container label {
    font-weight: 700;
    font-size: 0.95em;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.styled-select {
    padding: 8px 32px 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-1);
    background-color: var(--white);
    border: 2px solid var(--accent-1);
    border-radius: var(--card-radius);
    cursor: pointer;
    outline: none;
    transition: all var(--t-fast);
    
    /* Personalización de la flecha del select */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23023047' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C2.185 5.355 2.403 5 2.808 5h9.384c.405 0 .623.355.357.658l-4.796 5.482a.503.503 0 0 1-.746 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
}

.styled-select:hover {
    border-color: var(--accent-2);
    box-shadow: 0 0 8px rgba(33, 158, 188, 0.2);
}

.styled-select:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(33, 158, 188, 0.15);
}

/* Animación para cuando los proyectos aparecen/desaparecen */
.proyecto-item {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in {
    animation: fadeInProject 0.5s ease forwards;
}

@keyframes fadeInProject {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajuste responsivo para móviles */
@media (max-width: 640px) {
    .filter-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .styled-select {
        width: 100%;
    }
}
/* ===== responsive ===== */
@media (max-width: 900px){
  .hero-row1{ flex-direction: row; align-items: center; gap: 12px; }
  .hero-image-container{ flex: 0 0 120px; }
  .hero-technologies-container{ min-width: 180px; margin-left: 12px; }
  .nav-links{ width: calc(100% - 32px); flex-wrap: wrap; justify-content:center; }
  .page-container { margin: 20px auto; }
}

@media (max-width: 640px){
  /* en móviles, apilo imagen encima de tecnologías */
  .hero-row1{ flex-direction: column; align-items: center; gap: 12px; }
  .hero-image-container{ order: 0; }
  .hero-technologies-container{ order: 1; width: 100%; justify-content: center; margin-left: 0; padding: 10px; }
  .technology-item img{ width: 42px; height: 42px; }
  .hero-section{ padding: 14px; }
  .section{ width: 95%; }
}


