:root {
    --bg-color: #F4F7F9;
    --text-color: #212529;
    --text-muted: #555555;
    --accent-color: #0077B6;
    --accent-hover: #005582;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --card-shadow-hover: rgba(0, 0, 0, 0.15);
    --border-color: #E9ECEF;
    --nav-bg: #0077B6;
    --nav-text: #ffffff;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #ffffff;
    --text-muted: #e2e8f0;
    --accent-color: #38bdf8;
    --accent-hover: #7dd3fc;
    --card-bg: #1e293b;
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.6);
    --border-color: #334155;
    --nav-bg: #020617;
    --nav-text: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    scroll-behavior: smooth;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

#contenido-principal {
    margin: 1rem;
    position: relative;
    overflow: hidden;
}

#contenido-principal>div,
#contenido-principal>section {
    position: relative;
    z-index: 1;
}

/* Footer - handled by portfolio-footer Web Component */
portfolio-footer {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* --- Navegación --- */
#nav {
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    height: 50px;
    margin-right: 2rem;
}

.nav-logo img {
    max-height: 50px;
    max-width: 150px;
    object-fit: contain;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

/* Contenedor de enlaces (para desktop, se mantiene normal) */
#menu-links {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

/* Estilos para el botón de hamburguesa (Oculto por defecto en Desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 100;
    margin-left: auto;
}

#nav a {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    transition: background-color 0.3s;
}

#nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
    margin-left: 10px;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}



/* --- Sección Inicio --- */
#inicio {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0px 20px 40px 20px;
    background-color: transparent;
    min-height: 80vh;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#inicio h1 {
    font-size: 3.5rem;
    color: var(--text-color);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
}

#inicio h2 {
    font-size: 2rem;
    color: #0077B6;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

#inicio p {
    max-width: 700px;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* animación de rotación */
@keyframes girar {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* marco de la foto */
.contenedor-img {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 40px auto;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

/* Pseudo-elemento ::before para el Borde Giratorio (Azul Acento) */
.contenedor-img::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    z-index: -1;
    background: conic-gradient(from 0deg,
            #0077B6,
            /* Acento Principal */
            #0096C7,
            /* Acento Secundario */
            #0077B6);
    animation: girar 4s linear infinite;
}

/* Pseudo-elemento ::after para el Brillo (Azul Acento) */
.contenedor-img::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    z-index: -2;
    background: conic-gradient(from 0deg,
            #0077B6,
            #0096C7,
            #0077B6);
    animation: girar 4s linear infinite;
    filter: blur(10px);
    opacity: 0.6;
}

/* Estilos de la imagen */
#img-perfil {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: none;
    box-shadow: none;
    background-color: #fff;
}

.contenedor-img:hover {
    transform: scale(1.05);
}

.inicio-acciones-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
    width: 100%;
}

.acciones-principales {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary-main,
.btn-secondary-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary-main {
    background-color: #0077B6;
    color: white;
    border: 2px solid #0077B6;
}

.btn-primary-main:hover {
    background-color: #005582;
    border-color: #005582;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 119, 182, 0.3);
}

.btn-secondary-main {
    background-color: transparent;
    color: #0077B6;
    border: 2px solid #0077B6;
}

.btn-secondary-main:hover {
    background-color: rgba(0, 119, 182, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 119, 182, 0.15);
}

/* Grupo CV */
.acciones-cv-unified {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.acciones-cv-unified:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.btn-cv-view {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 50px;
    transition: background-color 0.2s;
}

.btn-cv-view:hover {
    background-color: #f5f5f5;
    color: #0077B6;
}

.btn-cv-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    color: #666;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.btn-cv-download:hover {
    background-color: #0077B6;
    color: white;
    border-color: #0077B6;
}

/* --- Sección Sobre mi --- */
#sobremi {
    margin: 80px auto;
    padding: 40px 50px;
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    font-family: "Inter", "Segoe UI", Roboto, sans-serif;

    color: var(--text-color);
    text-align: justify;
}

/* Título */
#sobremi h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 25px;
    position: relative;
}

[data-theme="dark"] #sobremi h2 {
    color: #ffffff;
}

/* Línea decorativa debajo del título */
#sobremi h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin-top: 8px;
    border-radius: 2px;
}

/* Párrafos */
#sobremi p {
    font-size: 1.05rem;
    margin-bottom: 20px;
}

/* Negritas */
#sobremi strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* Enlaces en Acerca de mí */
#sobremi a {
    color: #0DA5D8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#sobremi a:hover {
    color: #0F8FB6;
    text-decoration: underline;
}

/* Botón Leer Más (mobile only) */
.btn-leer-mas {
    display: none;
    margin: 20px auto 0;
    padding: 12px 24px;
    background-color: #0DA5D8;
    color: var(--nav-text);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
}

.btn-leer-mas:hover {
    background-color: #0F8FB6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 165, 216, 0.3);
}

/* Responsive */
@media (max-width: 768px) {

    #nav {
        padding: 0.5rem 0.5rem;
        overflow: visible;
    }

    .nav-logo {
        margin-right: 0.5rem;
        height: 45px;
    }

    .nav-logo img {
        max-height: 45px;
        max-width: 100px;
    }

    .nav-right {
        position: static;
    }

    /* 1. Mostrar el botón de hamburguesa */
    .menu-toggle {
        display: block;
    }

    /* 2. Ocultar los enlaces por defecto */
    #menu-links {
        display: none !important;
        flex-direction: column;

        /* Posiciona el menú desplegable debajo del botón */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--nav-bg);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        margin-top: 0;
    }

    /* 3. Estilo de los enlaces en el menú desplegado */
    #menu-links a {
        padding: 1rem;
        text-align: center;
        width: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    #menu-links a:last-child {
        border-bottom: none;
    }

    /* 4. Clase activa de JavaScript: mostrar el menú */
    #menu-links.is-open {
        display: flex !important;
    }


    #sobremi {
        padding: 30px 25px;
        margin: 40px 15px;
    }

    #sobremi h2 {
        font-size: 1.7rem;
    }

    #sobremi p {
        font-size: 1rem;
    }

    /* Ocultar últimos dos párrafos en móvil por defecto */
    #sobremi.collapsed p:nth-child(n+4) {
        display: none;
    }

    /* Mostrar botón Leer Más solo en móvil */
    .btn-leer-mas {
        display: block;
    }

    /* Cuando se expande, mostrar todos los párrafos */
    #sobremi.expanded p {
        display: block;
    }

    #experiencia {
        padding: 20px 0;
        margin: 20px 10px;
    }

    #experiencia h2 {
        font-size: 1.8rem;
        padding-left: 40px;
        margin-bottom: 30px;
    }

    #experiencia::before {
        left: 15px;
        top: 80px;
    }

    .experiencia-item {
        margin-left: 40px !important;
        margin-right: 0 !important;
        padding: 1rem;
    }

    .experiencia-item::before {
        left: -33px;
        top: 20px;
        width: 12px;
        height: 12px;
        border-width: 3px;
    }

    #org {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .org-fecha {
        align-self: flex-start;
    }

    #coleccion-proyectos {
        padding: 0 !important;
    }

    .rol-descripcion,
    .proyecto-descripcion {
        text-align: left;
    }
}

/* --- Sección Formación --- */
#formacion {
    padding: 60px 0 20px;
    margin: 40px auto;
}

#formacion h2 {
    text-align: left;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--text-color);
    padding-left: 50px;
}

.formacion-item {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    margin-left: 65px;
    margin-right: 3rem;
    box-shadow: var(--card-shadow);
    gap: 30px;
    transition: all 0.3s ease;
}

.formacion-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #0077B6;
}

.formacion-logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #eee;
}

.formacion-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.formacion-info {
    flex-grow: 1;
}

@media (max-width: 768px) {
    #formacion {
        padding: 40px 0 10px;
        margin: 20px 10px;
    }

    #formacion h2 {
        font-size: 1.8rem;
        padding-left: 15px;
        margin-bottom: 30px;
    }

    .formacion-item {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0 !important;
        margin-right: 0 !important;
        gap: 15px;
        padding: 1.25rem;
    }

    .formacion-logo {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    #certificaciones {
        padding: 40px 0 10px;
        margin: 20px 10px;
    }

    #certificaciones h2 {
        font-size: 1.8rem;
        padding-left: 15px;
        margin-bottom: 30px;
    }

    .certificado-info-container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
}

/* --- Sección Certificaciones (Nuevo Diseño) --- */
#certificaciones {
    padding: 60px 0 20px;
    margin: 40px auto;
}

#certificaciones h2 {
    text-align: left;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--text-color);
    padding-left: 50px;
}

.certificado-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 0 65px 1.5rem 65px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.certificado-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #0077B6;
}

.certificado-info-container {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.certificado-imagen {
    margin: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificado-imagen img {
    width: 100%;
    height: auto;
    display: block;
}

.certificado-imagen:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Ocultar el figcaption que solo es para el modal */
.certificado-imagen figcaption {
    display: none;
}

/* --- Sección Experiencia Laboral (Timeline Style) --- */
#experiencia {
    position: relative;
    padding: 60px 0;
    margin: 40px auto;
}

#experiencia h2 {
    text-align: left;
    margin-bottom: 50px;
    font-size: 2.2rem;
    color: var(--text-color);
    padding-left: 50px;
}

/* La línea vertical del timeline ajustable al ancho global */
#experiencia::before {
    content: '';
    position: absolute;
    left: 35px;
    top: 165px;
    bottom: 50px;
    width: 3px;
    background: linear-gradient(to bottom, #0077B6, #90E0EF);
    border-radius: 3px;
}

.experiencia-item {
    position: relative;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 2.5rem;
    margin-left: 65px;
    /* Espacio para la línea */
    margin-right: 3rem;
    /* Restaurado el margen derecho original */
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* El punto (indicador) del timeline */
.experiencia-item::before {
    content: '';
    position: absolute;
    left: -42px;
    /* Centrado con la línea (25px total offset) */
    top: 20px;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border: 4px solid var(--card-bg);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2);
    transition: all 0.3s ease;
}

.experiencia-item:hover {
    background-color: var(--card-bg);
    transform: translateX(5px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent-color);
}

.experiencia-item:hover::before {
    background: #0096C7;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(0, 119, 182, 0.2);
}

#org {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.org-nombre {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0077B6;
    margin: 0;
}

.org-fecha {
    font-size: 0.9rem;
    background: #e1f5fe;
    color: #0077B6;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 600;
}

.rol {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.rol-descripcion {
    text-align: justify;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* --- Sección Proyectos --- */
#proyectos {
    padding: 20px 0;
}

#proyectos h2 {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
    font-size: 2.5rem;
}

#filtros {
    text-align: center;
    margin-bottom: 30px;
}

.proyecto-descripcion {
    text-align: justify;
}

#busqueda {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--card-bg);
    color: var(--text-color);
    width: 80%;
    max-width: 400px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#busqueda:focus {
    border-color: #0077B6;
    box-shadow: 0 0 0 0.2rem rgba(0, 119, 182, 0.25);
}

#coleccion-proyectos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
}

.proyecto {
    max-width: 450px;
    justify-self: center;
    width: 100%;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    height: 100%;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.proyecto:hover {
    background-color: var(--card-bg);
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    margin-bottom: -8px;
}

/* Área de contacto extendida para evitar parpadeo (jitter) al elevarse */
.proyecto::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -20px;
    z-index: -1;
    pointer-events: none;
}

.proyecto:hover::after {
    pointer-events: all;
}

.proyecto strong,
.proyecto p,
.btn-ver-mas {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.proyecto-logo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin: 0 0 15px 0;
}

.proyecto strong {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 10px;
    min-height: 2.5rem;
    display: block;
    padding-top: 0;
}

.btn-ver-mas {
    padding: 10px 20px;
    margin-bottom: 1.5rem;
    text-decoration: none;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease;
}

.btn-ver-mas:hover {
    background-color: var(--accent-hover);
}

[data-theme="dark"] .btn-ver-mas:hover {
    background-color: #0284c7; /* A visually pleasing deeper blue for dark mode hover */
}

/* --- Stack Tecnologico --- */
#stack {
    background-color: var(--card-bg);
    padding: 30px 20px;
    border-radius: 12px;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: var(--card-shadow);
}

#stack h2 {
    color: var(--text-color);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-align: center;
}

#stack ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

#stack li {
    color: var(--text-color);
    background-color: var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    /* Colores individuales eliminados para un look profesional y uniforme */
}

#stack li:hover {
    background-color: #0077B6;
    color: white;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 119, 182, 0.3);
    cursor: pointer;
}

/* --- Botón Volver Arriba --- */
#btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #0077B6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, bottom 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#btn-back-to-top:hover {
    background-color: #005582;
    transform: translateY(-2px);
}

#btn-back-to-top svg {
    width: 24px;
    height: 24px;
}

/* --- Botones Flotantes de Redes Sociales --- */

#social-flotante {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.social-icon-flotante {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--text-color);
    border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
}

.social-icon-flotante svg {
    width: 20px;
    height: 20px;
    fill: var(--card-bg);
    transition: fill 0.3s;
}

.social-icon-flotante:hover {
    background-color: var(--accent-color);
    transform: translateX(-5px);
}

.social-icon-flotante:hover svg {
    fill: white;
}


/* Viejos estilos de CV removidos */

/* --- Side Navigation (Global) --- */
#side-nav {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    background: var(--nav-bg);
    opacity: 0.95;
    padding: 15px 10px;
    border-radius: 25px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
}

.side-link {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    overflow: hidden;
    padding: 0;
    position: relative;
    white-space: nowrap;
}

.side-link span.initials {
    width: 40px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.side-link::after {
    content: attr(title);
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    transition: all 0.4s ease;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    padding-right: 0;
}

.side-link:hover {
    width: auto;
    padding-right: 20px;
    background: var(--primary-color, #0077B6);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.side-link:hover::after {
    opacity: 1;
    max-width: 200px;
    margin-left: 5px;
}

.side-link.active {
    background: var(--primary-color, #0077B6);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
    #side-nav {
        display: none;
    }
}

/* Colaborator Link High Contrast */
.link-colaborador {
    color: #d63384;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.link-colaborador:hover {
    color: #a61e4d;
    text-decoration: none;
}

@media (max-width: 600px) {
    .acciones-principales {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary-main,
    .btn-secondary-main {
        width: 100%;
        justify-content: center;
    }

    .acciones-cv-unified {
        width: 100%;
        justify-content: space-between;
    }

    .btn-cv-view {
        flex: 1;
    }
}

@media (max-width: 992px) {

    #social-flotante {
        display: none;
    }

    #btn-back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .certificado-item {
        grid-template-columns: 1fr;
        margin-left: 20px;
        margin-right: 20px;
        padding: 2rem;
        gap: 30px;
    }
}

@media (max-width: 576px) {
    .certificado-item {
        margin-left: 0;
        margin-right: 0;
        padding: 1.25rem;
    }
}



/* --- Filtros y Búsqueda --- */
#filtros {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    width: 100%;
}

.filtros-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.filtros-grupo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
}

.filtros-label {
    margin: 0;
    font-weight: 700;
    color: #444;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .filtros-label {
    color: #ffffff;
}

.filtros-categorias,
.filtros-lenguajes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filtro-btn,
.filtro-lang-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filtro-btn:hover,
.filtro-lang-btn:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-1px);
}

[data-theme="dark"] .filtro-btn:hover,
[data-theme="dark"] .filtro-lang-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #ffffff;
}

.filtro-btn.active,
.filtro-lang-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 119, 182, 0.2);
}

/* --- Tags en Tarjetas --- */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 15px 0;
    padding: 0 1.5rem;
    justify-content: center;
}

.tag {
    background: var(--card-bg);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
}

/* --- Archivos Extras (Documentación) --- */
#archivos-extras {
    padding: 40px 0;
    background-color: var(--bg-color);
    margin: 40px 0;
    border-radius: 12px;
}

#archivos-extras h2 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 2rem;
}

.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 280px);
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
}

.extra-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.extra-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.extra-icon {
    font-size: 2.5rem;
    color: var(--theme-primary, #0077B6);
    margin-bottom: 15px;
}

.extra-info h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 8px;
}

.extra-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.extra-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #f1f3f5;
}

.extra-card.disabled .extra-icon {
    color: #adb5bd;
}

/* Responsive */
@media (max-width: 768px) {
    #experiencia::before {
        left: 10px;
    }
}

/* --- Sección Stack Tecnológico --- */
#stack {
    padding: 60px 0;
    text-align: center;
}

#stack h2 {
    font-size: 2.22rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

#stack ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

#stack li {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

#stack li:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.2);
}



/* Animación de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* --- Estilos para enlaces de colaboradores --- */
.link-colaborador {
    color: #0077B6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link-colaborador:hover {
    color: #005582;
    text-decoration: underline;
}

/* --- Botón Volver a Proyectos --- */
.btn-volver-inicio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #0077B6;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.btn-volver-inicio:hover {
    color: #005582;
    transform: translateX(-5px);
}

/* --- Navegación entre Proyectos --- */
.nav-proyectos-contenedor {
    margin: 3rem auto 0;
    max-width: 900px;
    padding: 0 1.5rem 3rem 1.5rem;
}

.nav-proyectos {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: center;
}

.btn-nav-proyecto {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.8rem;
    background-color: #0077B6;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 12px;
    transition: 0.25s ease;
    font-size: 1rem;
    flex: 1;
    justify-content: center;
}

.btn-nav-proyecto:hover {
    background-color: #005582;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}

.btn-nav-proyecto.btn-anterior {
    flex-direction: row;
}

.btn-nav-proyecto.btn-siguiente {
    flex-direction: row-reverse;
}

.btn-nav-proyecto.disabled {
    opacity: 0;
    cursor: not-allowed;
    background-color: #ccc;
    pointer-events: none;
}

.btn-nav-proyecto i {
    font-size: 1.2rem;
}

@media (max-width: 650px) {
    .nav-proyectos {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-nav-proyecto {
        width: 100%;
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
    }

    #experiencia::before {
        left: 10px;
    }
}