/* ========================
   ESTILOS GLOBALES
========================= */
body {
    font-family: 'Arial', sans-serif;
    background-color: #2c3e50;
    background-image: linear-gradient(to bottom, #243B55, #141E30);
    margin: 0;
    padding: 0;
    padding-top: 140px;
    /* Ajusta el espacio para que el contenido no quede debajo del header */
}

/* ========================
   HEADER
========================= */
header {
    background-color: #141E30;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.header-left,
.header-placeholder {
    width: 100px;
    /* Ancho de la foto */
    flex-shrink: 0;
}

.foto-header {
    width: 100%;
    /* La imagen ocupa el ancho del contenedor */
    border-radius: 50%;
}

.header-center {
    flex: 1;
    text-align: center;
    min-width: 200px;
}

header h1 {
    font-size: 32px;
    margin: 0;
}

header p {
    font-size: 18px;
    margin: 0;
}

/* ========================
   NAVEGACIÓN E IDIOMAS
========================= */
nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.idiomas {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    margin-bottom: 7px;
}

.idiomas a {
    padding: 8px 15px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    color: white;
    background-color: #0073e6;
    /* Azul profesional */
    border-radius: 5px;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.idiomas a:hover {
    background-color: #005bb5;
    transform: scale(1.05);
}

/* ========================
   SECCIONES GENERALES
========================= */
section {
    margin: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

/* ========================
   SECCIÓN SOBRE MÍ
========================= */
#sobre-mi p {
    text-align: justify;
    text-justify: inter-word;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s ease, transform 1s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Estados opcionales para fade-out / fade-in en Sobre Mí */
#sobre-mi p.fade-out {
    opacity: 0;
    transform: translateY(5px);
}

#sobre-mi p.preload {
    opacity: 0;
    transform: translateY(5px);
}

/* ========================
   ESTUDIOS
========================= */
#estudios {
    margin: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

.estudio {
    background: #ecf0f1;
    padding: 5px;
    border-radius: 5px;
    margin-bottom: 15px;
    transition: transform 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.estudio:hover {
    transform: scale(1.02);
    padding: 20px;
}

/* ========================
   EXPERIENCIA LABORAL
========================= */
#experiencia .experiencia {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    transition: transform 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    /* Oculta el contenido extra hasta que se expanda */
}

#experiencia .experiencia:hover {
    transform: scale(1.06);
    padding: 15px;
}

#experiencia .experiencia h3 {
    margin-top: 0;
    font-size: 20px;
}

#experiencia .experiencia ul li {
    margin-bottom: 10px;
}

#experiencia .experiencia ul {
    list-style: disc;
    margin-left: 20px;
}

/* Información adicional (más-info) dentro de cada experiencia,
   oculta por defecto y expandible al hover */
#experiencia .more-info {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease;
}

#experiencia .experiencia:hover .more-info {
    max-height: 1500px;
    /* Altura máxima ajustable */
    opacity: 1;
    margin-top: 10px;
    /* Espacio entre contenido visible y extra */
}

#experiencia .more-info li {
    margin-bottom: 10px;
}

/* ========================
   PROYECTOS
========================= */
/* ESTILOS PARA PROYECTOS */
#proyectos .proyecto {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#proyectos .proyecto:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

#proyectos h2 {
    font-size: 2rem;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 40px;
    font-weight: 700;
}


#proyectos .proyecto h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

#proyectos .proyecto p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
}


#proyectos .proyecto:not(:last-child) {
    border-bottom: 1px solid #ddd;
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.tech-chip {
    display: inline-block;
    background-color: #e0f0ff;
    color: #0073e6;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 50px;
    margin: 5px 5px 0 0;
}


#proyectos .titulo-imagen {
    text-align: center;
}

.btn-container {
    text-align: center;
}

.btn-proyecto {
    display: inline-block;
    background: linear-gradient(135deg, #0073e6, #005bb5);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 20px;
}

#proyectos .btn-proyecto:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.open-modal,
.btn-proyecto {
    font-size: 1rem;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 8px;
    background-image: linear-gradient(135deg, #0066cc, #003d99);
}


/* Estilos para el botón en la tarjeta de proyecto */
.open-modal {
    display: inline-block;
    background: linear-gradient(135deg, #0073e6, #005bb5);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 20px;
    border: none;
    cursor: pointer;
}

.open-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Modal overlay */
.modal {
    display: none;
    /* Se muestra solo cuando está activo */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    /* Fondo semitransparente */
    align-items: center;
    justify-content: center;
}

.btn-container {
    text-align: center;
    /* Centra todo el contenido del contenedor */
}

/* Contenedor del contenido del modal */
.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

.modal-content img {
    transition: all 0.3s ease-in-out;
    filter: grayscale(15%);
    transition: transform 0.4s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    display: block;
    max-width: 70%;
    /* La imagen no excederá el 90% del ancho del modal */
    width: 800px;
    /* Puedes ajustar este valor a un tamaño fijo deseado */
    height: auto;
    /* Mantiene la proporción original */
    margin: 15px auto;
    /* Centra la imagen y añade margen superior/inferior */
}

.modal-content img:hover {
    filter: grayscale(0%);
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}


/* Botón para cerrar el modal */
.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}


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



/* ========================
   HaBILIDADES
========================= */

#habilidades {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.habilidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.categoria-habilidad {
    background-color: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.categoria-habilidad:hover {
    transform: translateY(-5px);
}

.categoria-habilidad h3 {
    color: #005f73;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.categoria-habilidad ul {
    list-style-type: "✔️ ";
    padding-left: 1.2rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ========================
   CV
========================= */
/* Sección para descargar el CV */
#cv {
    margin: 40px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#cv h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

#cv p {
    font-size: 16px;
    margin-bottom: 20px;
}

#cv .btn-cv {
    display: inline-block;
    text-decoration: none;
    font-weight: bold;
    color: white;
    background-color: #0073e6;
    /* Azul profesional */
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s ease-in-out;
}

#cv .btn-cv:hover {
    background-color: #005bb5;
    /* Azul más oscuro */
}


/* ========================
   MEDIA QUERIES (RESPONSIVE)
========================= */
@media only screen and (max-width: 768px) {

    /* Ajustes globales para sections */
    section {
        margin: 10px;
        padding: 10px;
    }

    /* Mantener el header en horizontal, pero compacto */
    header {
        flex-direction: row;
        /* Se mantiene en fila */
        align-items: center;
        justify-content: space-between;
        padding: 5px 10px;
        /* Menos padding para un aspecto más compacto */
    }

    /* Reducir el tamaño de la foto */
    .header-left {
        width: 50px;
        /* Reducido de 100px a 50px */
    }

    /* Ajustar la sección central del header */
    .header-center {
        min-width: 270px;
        /* Reducido un poco si es necesario */
    }

    .header-center h1 {
        font-size: 20px;
        /* Reducido de 32px */
        margin: 0;
    }

    .header-center p {
        font-size: 11px;
        /* Reducido de 18px */
        margin: 0;
    }

    nav ul li a {
        font-size: 9px;
        /* Ajusta este tamaño para que el menú se vea más claro */
    }

    /* Ajustar navegación si es necesario */
    nav ul {
        flex-direction: row;
        /* Se mantiene horizontal */
        gap: 5px;
        /* Espaciado reducido */
    }

    /* Opcional: ajustar los botones de idiomas */
    .idiomas a {
        padding: 5px 10px;
        /* Reducido */
        font-size: 9px;
        /* Menor tamaño de fuente */
    }

    /* Secciones que deben ocupar el 100% del ancho disponible */
    #experiencia,
    #sobre-mi,
    #proyectos,
    #habilidades,
    #contacto {
        width: 95%;
        box-sizing: border-box;
        margin: 10px;
        padding: 10px;
    }

    #estudios {
        width: 95%;
        box-sizing: border-box;
        margin: 10px;
        padding: 10px;
    }

    /* Ajusta el texto en .more-info para móviles */
    #experiencia .more-info,
    #experiencia .more-info p {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }
}


/* download button */

.button-download {
    --text: #fff;
    --primary: #4F29F0;
    --check: #05C3B2;
    --background: #fff;
    --border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 0;
    outline: none;
    padding: 0 30px;
    height: 60px;
    background: var(--primary);
    border-radius: var(--border-radius);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(65, 72, 86, 0.05);
    transition: transform 0.1s linear;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.button-download .icons {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 3px 0 0 15px;
}

.button-download .icons .arrow {
    height: 14px;
    width: 16px;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--text);
    fill: none;
    transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px));
    transform-origin: var(--transOrigin, bottom right);
}

.button-download .icons .line {
    margin-top: 2px;
    height: 8px;
    width: 18px;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--text);
    fill: none;
    stroke-dashoffset: var(--sd, 0);
    stroke-dasharray: 16 32;
    --sd: 0;
    transform: rotate(var(--r, 0deg)) translate(var(--x, 0px), var(--y, 0px));
}

.button-download .icons .check {
    position: absolute;
    height: 13px;
    width: 17px;
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke: var(--check);
    fill: none;
    stroke-dashoffset: var(--sd, 32);
    stroke-dasharray: 18 36;
    --sd: 32;
    transform: translateY(-2px);
}

.button-download>.text {
    display: block;
    position: relative;
    overflow: hidden;
    font: 400 16px "Varela Round", sans-serif;
    letter-spacing: 0.7px;
}

.button-download>.text>span {
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.button-download>.text>span::before {
    content: attr(data-text);
    display: block;
    position: absolute;
    left: 0;
    bottom: 100%;
}

.button-download:active {
    transform: scale(0.97);
}

.button-download.active>.text>span {
    transform: translateY(100%);
    transition: transform 0.3s ease 1.9s, opacity 0.3s ease 1.9s;
}
