/* RESET GENERAL */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue-dark: #1a3a5a; /* Color del fondo del header en tu captura */
    --blue-main: #0d4a86;
    --bg-body: #f4f7f9;
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #5a6478;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
}

/* CONTENEDOR PRINCIPAL: 80% en PC, 100% en Móvil */
.portfolio-container {
    width: 80%;
    margin: 40px auto;
    background: transparent;
}

/* HEADER (Azul oscuro como en la captura) */
header {
    background-color: var(--blue-dark);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px 8px 0 0; /* Bordes redondeados arriba */
}

/* ── COMPONENTE: TITLES / TOOLTIPS PERSONALIZADOS ── */

/* El elemento padre debe tener posición relativa para sujetar el globo */
.custom-tooltip {
    position: relative;
    display: inline-flex; /* Alineación perfecta para los SVG y el botón */
    align-items: center;
    justify-content: center;
}

/* 1. La Burbuja de Texto */
.custom-tooltip::after {
    content: attr(data-title); /* Extrae el texto del atributo html */
    position: absolute;
    bottom: 140%; /* Se posiciona por encima del icono */
    left: 50%;
    transform: translateX(-50%) translateY(8px); /* Ligero desplazamiento inicial para el efecto */
    background-color: var(--text-dark); /* Color oscuro para contrastar con el fondo claro u oscuro */
    color: var(--white);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap; /* Evita que el texto salte de línea */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    /* Estado inicial: Invisible */
    opacity: 0;
    pointer-events: none; /* No estorba al ratón */
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 2. La Pequeña Flecha del Bocadillo */
.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-width: 6px;
    border-style: solid;
    border-color: var(--text-dark) transparent transparent transparent; /* Triángulo hacia abajo */
    
    /* Estado inicial: Invisible */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 3. Activación al pasar el ratón (Hover) */
.custom-tooltip:hover::after,
.custom-tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* Sube suavemente a su posición final */
}

/* Ajuste específico para el Botón CV (para que la burbuja no quede pegada) */
.btn-cv.custom-tooltip::after {
    bottom: 125%;
}
.btn-cv.custom-tooltip::before {
    bottom: 105%;
}

.sidebar-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.header-contact {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.header-contact svg {
    transition: transform 0.2s;
}

.header-contact a:hover svg,
.header-contact button:hover svg,
.btn-cv:hover {
    transform: scale(1.2);
}

.btn-cv {
    display: inline-block;
    padding: 10px 25px;
    background-color: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-cv:hover {
    background: white;
    color: var(--blue-dark);
}

#shareBtn{
    background: none; 
    border: none; 
    padding: 0; 
    cursor: pointer;
     display: none;
}

/* SECCIONES DEL CONTENIDO (Fondo blanco) */
main {
    background: var(--white);
    padding: 40px;
    border-radius: 0 0 8px 8px; /* Redondeado abajo */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

section {
    margin-bottom: 40px;
}

h2 {
    color: var(--blue-main);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* PROYECTOS */
.projects-list {
    list-style: none;
    margin-top: 20px;
}

.projects-list li {
    background: #f9fbff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 5px solid var(--blue-main);
}

.resumen {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 5px 0 10px 0;
}

.codigo, .vivo {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--blue-main);
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 30px;
    color: #00ff66;
    font-size: 0.9rem;
    background-color: #0a0a0a;
}


.viñeta {
    list-style: none;
    padding: 0;
    max-width: 600px; /* Para que no se estire demasiado en pantallas grandes */
    margin: 0 auto; /* Centra el bloque de la lista */
}

.viñeta li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    font-family: sans-serif;
    font-size: 14px;
}

.viñeta li::before {
    content: ">_ "; 
    color: #00ff66; /* Un verde terminal le quedaría genial, o mantén tu #333 */
    font-weight: bold;
    margin-right: 10px;
    font-family: 'Courier New', Courier, monospace; /* Opcional: le da un toque más "code" */
}

/* 1. Definimos la animación del parpadeo */
@keyframes parpadeo {
    0%, 100% {
        color: #00ff66; /* Verde encendido */
    }
    50% {
        color: transparent; /* Se apaga (invisible) */
    }
}

/* 2. Modificamos el comportamiento al hacer hover */
/* Cuando el usuario pasa el ratón por encima del li o del enlace... */
.viñeta li:hover::before {
    /* Aplicamos la animación: dura 0.8 segundos, es infinita y va a saltos (steps) como una consola real */
    animation: parpadeo 0.8s steps(2, start) infinite;
}

.viñeta a {
    background-color: transparent !important;
    text-decoration: none;
    color: #0066cc; /* Un azul más profesional */
}

.viñeta a:hover {
    text-decoration: underline;
    color: #003366;
}

/* ── RESPONSIVE (MÓVILES) ── */
@media (max-width: 850px) {
    .portfolio-container {
        width: 100%;
        margin: 0;
    }

    header, main {
        border-radius: 0;
    }

    main {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }
}