/* Carrusel de proyectos */
.carrusel-proyectos {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
    position: relative;
    width: 100%;
}

.carrusel-track {
    display: flex;
    overflow-x: hidden; /* Oculta el scroll */
    scroll-behavior: smooth;
    gap: 30px;
    padding: 10px 0;
    width: 100%;
}

/* Oculta la barra de scroll en navegadores modernos */
.carrusel-track::-webkit-scrollbar {
    display: none;
}
.carrusel-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carrusel-btn {
    background: #e0e7ef;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,41,59,0.10);
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.carrusel-btn:hover {
    background: #38bdf8;
    transform: scale(1.08);
}
.carrusel-btn img {
    width: 28px;
    height: 28px;
}
.carrusel-btn-izq {
    margin-right: -10px;
    z-index: 2;
}
.carrusel-btn-der {
    margin-left: -10px;
    z-index: 2;
}
.carrusel-proyectos {
    align-items: center;
    width: 100%;
}

.card-proyecto {
    background: #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(30,41,59,0.07);
    min-width: 300px;
    max-width: 320px;
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card-proyecto:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 6px 24px rgba(56,189,248,0.13);
}
.card-proyecto img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #cbd5e1;
}
.card-proyecto-info {
    padding: 20px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card-proyecto-info h3 {
    color: #2563eb;
    font-size: 1.1rem;
    margin-bottom: 6px;
    font-weight: 600;
}
.tecnologias {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.tecnologias span {
    background: #e0e7ef;
    color: #2563eb;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 500;
}
.card-proyecto-info p {
    color: #334155;
    font-size: 0.98rem;
    margin: 0;
}

.irGithub {
    margin-top: auto;
    align-self: flex-start;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 16px;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.irGithub:hover {
    color: #334155;
}

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

body {
    background-color: #f8fafc; /* Un gris más suave */
    font-family: 'Poppins', sans-serif;
    color: #1e293b;
    overflow-x: hidden;
}

.contenedor {
    display: flex;
    width: 100%;
}

/* --- BARRA LATERAL --- */
.BarraLateral {
    width: 350px; /* Reducido un poco para mejor equilibrio */
    height: 100vh;
    background-color: #0f172a; /* Azul noche más profundo */
    color: rgb(160, 18, 18);
    position: fixed;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 0;
    z-index: 1001;
}

.perfilContenedor {
    text-align: center;
    margin-bottom: 5px;
}

.FotoPerfil {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px;
    object-fit: cover;
}

/* Menú alineado a la izquierda */
.menuPrincipal ul {
    list-style: none;
}

.menuPrincipal ul li {
    margin: 5px 0;
}

.menuPrincipal ul li a {
    color: #94a3b8;
    text-decoration: none;
    display: block;
    padding: 5px 40px;
    font-size: 17px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.menuPrincipal ul li a:hover, 
.menuPrincipal ul li a.active {
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.1);
    border-left: 4px solid #38bdf8;
    padding-left: 45px; /* Pequeño desplazamiento al hacer hover */
}

/* Pie de barra lateral con iconos sociales */
.pieBarraLateral {
    text-align: center;
    padding: 0 20px;
}

.iconosSociales {
    display: flex;
    justify-content: left;
    gap: 15px;
    margin-bottom: 5px;
}

.iconosSociales a {
  text-decoration: none;
}

.descargaCV, .github, .linkedin, .contacto {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 5px;
    transition: 0.3s;
}

.iconoItem img {
    width: 32px;
    height: 32px;
    border-radius: 15px;
    filter: grayscale(100%) brightness(150%);
    transition: 0.3s;
}

.iconoItem:hover img {
    filter: grayscale(0%) brightness(100%);
    transform: translateY(-3px);
}

/* --- CONTENIDO PRINCIPAL --- */
.contenido {
    margin-left: 340px;
    width: calc(100% - 340px);
    min-height: 100vh;
}

/* Encabezado superior derecho */
.barraHerramientas {
    position: fixed;
    top: 0;
    right: 0;
    width: calc(100% - 320px);
    height: 70px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px;
    background-color: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.controles {
    display: flex;
    align-items: center;
    gap: 20px;
}

.iconoLuna {
    width: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.seleccionIdioma2 {
    background: #e2e8f0;
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

/* Secciones */
.seccion {
    padding: 90px 80px 60px; /* Más aire a los lados */
    min-height: 100vh;
    max-width: 1000px;
}

.seccion h1 {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 20px;
}

.seccion h1 span {
    color: #2563eb;
    display: block;
}

.etiqueta-cargo span {
    display: inline-block;
    background-color: #1e293b;
    color: #f1f5f9;
    padding: 6px 15px;
    border-radius: 6px;
    font-weight: 400;
    margin-bottom: 20px;
}

.descripcion-intro, .seccion p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 20px;
}

.seccion h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

.seccion h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: #38bdf8;
}

.card-formacion {
    background: #cacaca;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(30,41,59,0.07);
    padding: 22px 25px 24px 25px;
    max-width: 600px;
}

/* Tarjetas de habilidades técnicas */
.cards-habilidades {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.card-habilidad {
    background: #d9dddf;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(30,41,59,0.07);
    padding: 22px 28px 24px 28px;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 260px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-habilidad:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 6px 24px rgba(56,189,248,0.13);
}

.card-habilidad h3 {
    color: #475569;
    font-size: 1.2rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.card-habilidad ul {
    list-style: none;
    padding: 0;
}

.card-habilidad ul li {
    padding: 7px 0 7px 18px;
    position: relative;
    color: #334155;
    font-size: 1rem;
}

.card-habilidad ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #475569;
    font-size: 1rem;
}

.cards-intereses {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.card-interes {
    background: #d9dddf;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(30,41,59,0.07);
    padding: 22px 28px 24px 28px;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 260px;
    transition: transform 0.2s, box-shadow 0.2s;
    color: #334155;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.card-interes:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 6px 24px rgba(56,189,248,0.13);
}

.lista-blanda {
    list-style: none;
}

.lista-blanda li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.lista-blanda li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #38bdf8;
}

.diplomas-imagen {
    max-width: 800px;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(25, 34, 49, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* MODO OSCURO (Contenido) */
.contenido.dark-mode {
    background-color: #0f172a;
    color: white;
}

.contenido.dark-mode .barraHerramientas {
    background-color: rgba(15, 23, 42, 0.8);
}

.contenido.dark-mode .card-interes {
    background: #1e293b;
    color: #e2e8f0;
}

.contenido.dark-mode .descripcion-intro, 
.contenido.dark-mode .seccion p {
    color: #94a3b8;
}

.contenido.dark-mode .seccion h1 {
    color: white;
}

@media (max-width: 991px) {
    .BarraLateral {
        width: 280px;
    }

    .contenido {
        margin-left: 280px;
        width: calc(100% - 280px);
    }

    .barraHerramientas {
        width: calc(100% - 280px);
    }

    .seccion {
        padding: 15px 48px 56px;
    }

    .seccion h1 {
        font-size: 3rem;
    }
}

@media (max-width: 767px) {
    html {
        scroll-padding-top: 80px;
    }

    #diplomas,
    #mis-intereses {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 24px;
    }

    #diplomas h2,
    #mis-intereses h2 {
        margin-bottom: 16px;
    }

    .diplomas-imagen {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }

    .contenedor {
        flex-direction: column;
    }

    .BarraLateral {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 28px 20px 24px;
        gap: 24px;
    }

    .contenidoSuperior {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .perfilContenedor {
        margin-bottom: 0;
    }

    .FotoPerfil {
        width: 120px;
        height: 120px;
    }

    .menuPrincipal ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .menuPrincipal ul li {
        margin: 0;
    }

    .menuPrincipal ul li a {
        padding: 10px 14px;
        font-size: 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 10px;
        background-color: rgba(148, 163, 184, 0.08);
    }

    .menuPrincipal ul li a:hover,
    .menuPrincipal ul li a.active {
        padding-left: 14px;
        border-left: none;
        border-bottom-color: #38bdf8;
    }

    .pieBarraLateral {
        padding: 0;
    }

    .iconosSociales {
        justify-content: center;
        flex-wrap: wrap;
        gap: 18px;
    }

    .contenido {
        margin-left: 0;
        width: 100%;
    }

    .barraHerramientas {
        position: sticky;
        width: 100%;
        padding: 14px 20px;
        height: auto;
        justify-content: center;
    }

    .controles {
        width: 100%;
        justify-content: center;
    }

    .seccion {
        min-height: auto;
        max-width: 100%;
        padding: 15px 20px;
        scroll-margin-top: 80px;
    }

    .seccion h1 {
        font-size: 2.4rem;
    }

    .seccion h2 {
        font-size: 1.75rem;
        margin-bottom: 24px;
    }

    .descripcion-intro,
    .seccion p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .card-formacion,
    .card-habilidad {
        max-width: 100%;
    }

    .card-habilidad,
    .card-interes {
        min-width: 0;
        flex: 1 1 100%;
    }

    .cards-intereses {
        justify-content: center;
    }

    .card-interes {
        flex: 0 1 auto;
        width: auto;
        max-width: 280px;
    }

    .cards-habilidades {
        gap: 16px;
    }

    .carrusel-proyectos {
        gap: 0;
    }

    .carrusel-btn {
        display: none;
    }

    .carrusel-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 10px 2px 10px 0;
        gap: 16px;
    }

    .card-proyecto {
        min-width: calc(100vw - 56px);
        max-width: calc(100vw - 56px);
        flex: 0 0 calc(100vw - 56px);
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    #diplomas {
        padding: 18px 8px 24px;
    }

    #diplomas h2 {
        font-size: 1.4rem;
        line-height: 1.3;
    }

    .diplomas-imagen {
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }

    .BarraLateral {
        padding: 24px 16px 20px;
    }

    .menuPrincipal ul {
        gap: 8px;
    }

    .menuPrincipal ul li a {
        width: 100%;
        text-align: center;
    }

    .seccion {
        padding: 15px 16px;
    }

    .seccion h1 {
        font-size: 1.95rem;
    }

    .etiqueta-cargo span {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .card-formacion,
    .card-habilidad,
    .card-interes,
    .card-proyecto-info {
        padding-left: 16px;
        padding-right: 16px;
    }

    .card-proyecto {
        min-width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        flex-basis: calc(100vw - 32px);
    }

    .irGithub {
        width: 100%;
        text-align: center;
    }
}