/* Base Styles */
:root {
    --primary-color: #007bff; /* Azul vibrante */
    --secondary-color: #6c757d; /* Gris oscuro */
    --accent-color: #28a745; /* Verde para destacar */
    --text-color: #333;
    --bg-light: #f8f9fa; /* Fondo claro */
    --bg-dark: #343a40; /* Fondo oscuro para el footer */
    --border-color: #dee2e6;
    --hover-effect-duration: 0.3s; /* Duración para efectos hover */
}

body {
    font-family: 'Open Sans', sans-serif; /* Fuente más legible */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-light); /* Fondo general más simple, partículas o video en el hero */
    overflow-x: hidden; /* Previene scroll horizontal por animaciones */
}

/* Animaciones al cargar la página */
.fade-in {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Para animaciones al scroll (estado inicial) */
.hidden-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hidden-section.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-item.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Retrasos para elementos dentro de secciones (se maneja en JS con staggered delay) */
/* .hidden-section .fade-in-item:nth-child(1) { transition-delay: 0.1s; } */
/* .hidden-section .fade-in-item:nth-child(2) { transition-delay: 0.2s; } */
/* .hidden-section .fade-in-item:nth-child(3) { transition-delay: 0.3s; } */


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Hero Section */
.hero {
    background-color: var(--primary-color); /* Color de respaldo para el hero */
    color: white;
    text-align: center;
    padding: 100px 20px;
    position: relative;
    overflow: hidden; /* Necesario para contener el video/partículas */
    min-height: 600px; /* Altura mínima para el hero */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Partículas JS del Hero */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: var(--primary-color); /* Fondo de las partículas */
    background-image: url(''); /* Si quieres una imagen de fondo para las partículas */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
}


/* Video de fondo (descomentar en HTML y aquí si lo usas) */
#hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1; /* Para que esté detrás del contenido */
    transform: translate(-50%, -50%); /* Centra el video */
    background-size: cover;
    opacity: 0.8; /* Ajusta la opacidad del video si es muy brillante */
}

/* Overlay para el video o partículas */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Oscurece el video/partículas */
    z-index: 2; /* Encima del video/partículas, debajo del contenido */
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 3; /* Asegura que el contenido esté encima de todo */
    padding-top: 50px; /* Ajuste para espacio superior */
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); /* Sombra para resaltar */
}

.hero h1 {
    margin: 10px 0;
    font-size: 3.2em; /* Tamaño de fuente más grande */
    font-family: 'Montserrat', sans-serif; /* Nueva tipografía */
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Sombra para el texto */
}

.hero .tagline {
    font-size: 1.3em;
    margin-bottom: 40px;
    font-weight: 400;
}

.social-links a {
    color: white;
    font-size: 2.2em; /* Iconos más grandes */
    margin: 0 18px;
    transition: transform var(--hover-effect-duration) ease, color var(--hover-effect-duration) ease;
}

.social-links a:hover {
    transform: translateY(-8px) scale(1.1); /* Animación más pronunciada */
    color: #ffd700; /* Color dorado al pasar el mouse */
}

/* Navigation Bar */
.navbar {
    background-color: var(--bg-dark);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* Sombra más pronunciada */
}

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.navbar ul li {
    margin: 0 20px;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600; /* Más grueso */
    padding: 8px 15px; /* Más espacio */
    border-radius: 5px;
    transition: all var(--hover-effect-duration) ease;
}

.navbar ul li a:hover {
    color: var(--primary-color);
    background-color: white; /* Cambia el fondo al pasar el mouse */
    transform: translateY(-2px);
}

/* Sections */
.section-padding {
    padding: 80px 0; /* Más padding para más espacio */
    border-bottom: 1px solid var(--border-color);
}

.section-padding:last-child {
    border-bottom: none;
}

h2 {
    text-align: center;
    font-size: 3em; /* Títulos más grandes */
    margin-bottom: 50px;
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif; /* Nueva tipografía */
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

h2::after { /* Línea decorativa bajo los títulos */
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 14px 30px; /* Más padding */
    border-radius: 50px; /* Botones más redondeados (píldora) */
    text-decoration: none;
    font-weight: bold;
    transition: all var(--hover-effect-duration) ease;
    margin-top: 25px;
    text-transform: uppercase; /* Texto en mayúsculas */
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-left: 15px;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Project Cards */
.projects-grid { /* Contenedor para la cuadrícula */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 2 o 3 columnas, responsivo */
    gap: 30px; /* Espacio entre las tarjetas */
}

.project-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Sombra más suave y extendida */
    padding: 30px;
    transition: transform var(--hover-effect-duration) ease, box-shadow var(--hover-effect-duration) ease;
    display: flex; /* Para mejor alineación del contenido */
    flex-direction: column;
    justify-content: space-between; /* Empuja el botón al final si lo hay */
}

.project-card:hover {
    transform: translateY(-10px); /* Elevación al pasar el mouse */
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
}

.project-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 2em; /* Títulos de proyecto más grandes */
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.project-meta {
    font-size: 0.95em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.project-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Bordes más redondeados */
    margin-bottom: 20px;
    display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Skills Section */
.skills-category {
    margin-bottom: 35px;
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.skills-category h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.skills-category ul, .soft-skills ul, .languages ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* Espacio entre los elementos de la lista */
}

.skills-category li, .soft-skills li, .languages li {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 25px; /* Más redondeado */
    font-size: 0.95em;
    white-space: nowrap;
    transition: background-color var(--hover-effect-duration) ease, transform var(--hover-effect-duration) ease;
}

.skills-category li:hover, .soft-skills li:hover, .languages li:hover {
    background-color: var(--accent-color); /* Cambia de color al pasar el mouse */
    transform: scale(1.05);
}

/* Experience & Education */
.job-entry, .education-entry {
    background-color: white;
    border-left: 6px solid var(--primary-color); /* Borde más grueso */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Sombra más pronunciada */
    margin-bottom: 35px;
    padding: 30px;
    transition: transform var(--hover-effect-duration) ease, box-shadow var(--hover-effect-duration) ease;
}

.job-entry:hover, .education-entry:hover {
    transform: translateX(10px); /* Animación de deslizamiento al pasar el mouse */
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.job-entry h3, .education-entry h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.8em;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.company-name, .institution {
    font-weight: 600; /* Más grueso */
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.dates {
    font-style: italic;
    color: #555;
    margin-bottom: 18px;
    font-size: 0.95em;
}

.job-entry ul {
    list-style: disc;
    margin-left: 25px; /* Más indentación */
    padding: 0;
}

.job-entry li {
    margin-bottom: 10px;
}

/* Contact Section */
#contact ul {
    list-style: none;
    padding: 0;
    display: flex; /* Para organizar los elementos de contacto */
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px; /* Espacio entre los elementos */
}

#contact ul li {
    margin-bottom: 10px;
    font-size: 1.1em;
}

#contact ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color var(--hover-effect-duration) ease;
}

#contact ul li a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: white;
    text-align: center;
    padding: 40px 20px; /* Más padding */
    margin-top: 60px; /* Más espacio arriba */
    font-size: 0.95em;
}

/* --- Carrusel de Imágenes --- */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 600px; /* Ancho máximo del carrusel en la tarjeta */
    margin: 0 auto 20px auto; /* Centrar y espacio debajo */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer; /* Indica que es clickeable */
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain; /* Asegura que la imagen se vea completa */
    flex-shrink: 0; /* Evita que las imágenes se encojan */
}

.carousel-prev, .carousel-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    border: none;
    z-index: 10;
}

.carousel-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.carousel-prev:hover, .carousel-next:hover {
    background-color: rgba(0,0,0,0.8);
}

.carousel-dots {
    text-align: center;
    padding: 10px 0;
    background-color: rgba(0,0,0,0.1);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
    background-color: #717171;
}

/* --- Modal de Pantalla Completa --- */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed; /* Permanece en su lugar */
    z-index: 2000; /* Por encima de todo lo demás */
    left: 0;
    top: 0;
    width: 100%; /* Ancho completo */
    height: 100%; /* Alto completo */
    overflow: auto; /* Habilitar scroll si es necesario */
    background-color: rgba(0,0,0,0.9); /* Fondo negro semitransparente */
    justify-content: center;
    align-items: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    text-align: center; /* Para centrar la imagen */
}

#modal-image {
    width: auto;
    max-width: 100%;
    max-height: 100vh; /* Altura máxima para caber en la pantalla */
    object-fit: contain;
    display: block; /* Elimina espacio extra */
    margin: 0 auto; /* Centra la imagen */
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001; /* Asegura que el botón esté encima de la imagen */
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev-modal, .next-modal {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Ajusta el centrado vertical */
    color: white;
    font-weight: bold;
    font-size: 30px; /* Más grandes para el modal */
    transition: 0.6s ease;
    user-select: none;
    background-color: rgba(0,0,0,0.5);
    border: none;
    z-index: 2001;
}

.prev-modal {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.next-modal {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev-modal:hover, .next-modal:hover {
    background-color: rgba(0,0,0,0.8);
}

/* Partículas JS del contenido (fondo blanco) */
#content-particles {
    position: relative;
    width: 100%;
    z-index: 0; /* Asegura que esté detrás del contenido */
    /* Aquí definimos el tamaño mínimo para que el canvas de partículas tenga altura */
    min-height: 100vh; /* Para que cubra al menos una pantalla completa */
}

/* Esto es importante: El main.container debe tener un fondo propio y z-index */
.content-wrapper {
    position: relative; /* Permite que el contenido se superponga a las partículas */
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco semitransparente sobre las partículas */
    padding-bottom: 1px; /* Pequeño ajuste para que el fondo se extienda bien */
}

#content-particles canvas {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    width: 100% !important; /* Asegura que ocupe todo el ancho */
    height: 100% !important; /* Asegura que ocupe toda la altura */
    z-index: -1; /* Detrás del contenido */
    pointer-events: none; /* Permite interacciones a través del canvas */
}


/* Responsive Design */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8em;
    }
    h2 {
        font-size: 2.5em;
    }
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 80px 20px;
        min-height: 500px;
    }
    .hero h1 {
        font-size: 2.2em;
    }

    .hero .tagline {
        font-size: 1.1em;
    }

    .social-links a {
        font-size: 1.8em;
        margin: 0 10px;
    }

    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .navbar ul li {
        margin: 10px 0;
    }

    h2 {
        font-size: 2em;
    }

    .section-padding {
        padding: 50px 0;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-bottom: 15px;
    }

    .project-card, .job-entry, .education-entry {
        padding: 25px;
    }
    .prev-modal, .next-modal {
        font-size: 18px;
        padding: 10px;
    }
    .close-modal {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 60px 15px;
        min-height: 400px;
    }

    .profile-pic {
        width: 100px;
        height: 100px;
    }

    .hero h1 {
        font-size: 1.8em;
    }

    .hero .tagline {
        font-size: 0.9em;
    }

    .social-links a {
        font-size: 1.5em;
        margin: 0 8px;
    }

    h2 {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .skills-category li {
        padding: 8px 15px;
        font-size: 0.85em;
    }

    .job-entry h3, .education-entry h3 {
        font-size: 1.4em;
    }

    .carousel-dots {
        display: none; /* Ocultar puntos en pantallas muy pequeñas si no hay espacio */
    }
}