/* ==========================================================================
   1. VARIABLES GLOBALES & REINICIO
   ========================================================================== */
:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-yellow: #f2ff00;
    --accent-hover: #0284c7;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   2. HEADER / NAVBAR SUPERIOR
   ========================================================================== */
.header {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header-left {
    display: flex;
    gap: 0.75rem;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.icon-btn:hover {
    background: var(--accent-color);
    color: #0f172a;
    transform: translateY(-2px);
}

/* Nav Central Flotante */
.nav-central {
    display: flex;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.nav-icon-link {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: var(--transition);
}

.nav-icon-link:hover {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
}

/* Selector de Idioma */
.lang-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-flag {
    opacity: 0.5;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.lang-flag.active,
.lang-flag:hover {
    opacity: 1;
    transform: scale(1.1);
}

.flag-img {
    width: 26px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
}

/* ==========================================================================
   3. HERO SECTION (PÁGINA PRINCIPAL)
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 10% 4rem;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.highlight {
    color: var(--accent-color);
}

.hero-text h2 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1.2rem;
}

/* Badge Bilingüe */
.hero-badges {
    margin-bottom: 2rem;
}

.badge-bilingual {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-bilingual i {
    color: var(--accent-yellow);
}

/* Acciones e Iconos */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: #0f172a;
    padding: 0.75rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.social-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-icon-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.email-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.75rem 1.2rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.email-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* Imagen Hero */
.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.blob-frame {
    width: 320px;
    height: 320px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-yellow));
    padding: 6px;
    animation: morph 8s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
}

.blob-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

/* ==========================================================================
   4. SECCIONES COMUNES
   ========================================================================== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.section-title i {
    color: var(--accent-color);
}

/* ==========================================================================
   5. TARJETAS DE PROYECTOS
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: var(--shadow-lg);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.project-links a {
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-links a:hover {
    color: var(--accent-color);
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================================
   6. TIMELINE (ESTUDIOS & EXPERIENCIA)
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: calc(-2rem - 6px);
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.timeline-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ==========================================================================
   7. FOOTER & CONTACTO
   ========================================================================== */
.footer-container {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.footer-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.footer-container p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.footer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   8. RESPONSIVE / ADAPTACIÓN A MÓVILES
   ========================================================================== */
@media (max-width: 900px) {
    .hero-section {
        flex-direction: column-reverse;
        padding-top: 7rem;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .blob-frame {
        width: 240px;
        height: 240px;
    }

    .header {
        width: 95%;
        padding: 0.5rem 1rem;
    }

    .nav-central {
        gap: 0.5rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 600px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

    .header-left {
        display: none;
        /* Oculta redes sociales secundarias del header en móviles pequeños */
    }
}

/* Estilos para el bloque de foto e idiomas flotantes */
.hero-image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-languages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--card-bg);
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.lang-tag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
}

/* Tarjetas de la Sección Idiomas */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.lang-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.lang-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.lang-card-flag {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

.lang-card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}

.lang-card-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Badges especiales */
.badge-coming-soon {
    color: var(--accent-yellow);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.badge-in-process {
    color: rgb(68, 255, 65);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.dot-yellow {
    background: var(--accent-yellow) !important;
    box-shadow: 0 0 10px var(--accent-yellow) !important;
}

