/* =================================
   Variables (Paleta IDE Oscura)
================================= */
:root {
    /* Paleta de Colores Dark IDE */
    --primary-color: #61DAFB;
    /* Azul cian (React) */
    --accent-color: #FFCB6B;
    /* Naranja/Ámbar (Palabras clave) */
    --link-color: #C3E88D;
    /* Verde (Strings/Enlaces) */
    --comment-color: #858585;
    /* Gris (Comentarios) */
    --keyword-color: #c792ea;
    /* Morado (Keywords) */

    /* Fondos */
    --bg-dark: #1E1E1E;
    /* Fondo principal (VS Code Dark) */
    --bg-medium: #252526;
    /* Fondo de contenedores/cards */
    --bg-light: #2D2D2D;
    /* Fondo de secciones secundarias */

    /* Textos */
    --text-light: #CCCCCC;
    /* Texto general claro */
    --text-dark: #FFFFFF;
    /* Texto principal blanco */
    --text-muted: #858585;
    /* Texto secundario gris */

    /* Bordes y Sombras (Sutiles) */
    --border-color: #3F3F40;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);

    /* Tipografía */
    --font-family-body: 'Open Sans', sans-serif;
    --font-family-heading: 'Manrope', sans-serif;
    --font-family-mono: 'Space Mono', monospace;

    --container-width: 1140px;
}

/* =================================
   Reseteo y Fuentes
================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* @import está en el HTML */

body {
    font-family: var(--font-family-body);
    line-height: 1.7;
    color: var(--text-light);
    background-color: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-family-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--text-dark);
}

p {
    margin-bottom: 1em;
    color: var(--text-light);
}

p strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* =================================
   Clases Reutilizables y Tema IDE
================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Clases de resaltado tipo IDE */
.keyword {
    color: var(--keyword-color);
    font-weight: 600;
}

.string {
    color: var(--link-color);
}

.comment {
    color: var(--comment-color);
    font-style: italic;
}


/* =================================
   TÍTULOS DE SECCIÓN (CENTRADOS)
================================= */
.section-title {
    font-size: 3rem;
    /* Título grande */
    color: var(--text-dark);
    line-height: 1.2;
    text-align: center;
    /* ¡CENTRADO! */
    margin-bottom: 2.5rem;
    /* Espacio debajo */

    /* Estilos de Título Animado */
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    position: relative;
    /* Para el cursor */

    /* Centra el bloque del título animado */
    left: 50%;
    transform: translateX(-50%);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    text-align: center;
    /* Centrado */
    margin-bottom: 3rem;
    max-width: 600px;
    /* Ancho máximo para el subtítulo */
    margin-left: auto;
    margin-right: auto;
}

/* Animación de Títulos */
.section-title.type-animation span:first-child {
    visibility: hidden;
}

.section-title .cursor {
    font-family: var(--font-family-mono);
    color: var(--primary-color);
    font-weight: 400;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Fin Títulos de Sección */


.btn {
    display: inline-block;
    padding: 0.85rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-family: var(--font-family-heading);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-full {
    width: 100%;
}

.mt-large {
    margin-top: 3rem;
}

/* =================================
   Header & Nav (Tema Oscuro)
================================= */
.main-header {
    background-color: var(--bg-medium);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
    align-items: center;
}

.main-header.scrolled {
    box-shadow: var(--shadow-md);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo "Loading Dev" */
.nav-logo.text-logo {
    display: flex;
    align-items: baseline;
    font-family: var(--font-family-mono);
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
    text-decoration: none;
    height: 40px;
    padding-top: 5px;
}

.nav-logo .loading-text {
    color: var(--primary-color);
}

.nav-logo .loading-cursor {
    color: var(--text-light);
    margin-left: 2px;
    animation: blink 0.75s step-end infinite;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list a {
    color: var(--text-light);
    font-weight: 600;
    font-family: var(--font-family-heading);
    position: relative;
    padding-bottom: 5px;
}

.nav-list a:hover {
    color: var(--text-dark);
}

.nav-list a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    transition: width 0.3s ease;
}

.nav-list a:not(.btn):hover::after {
    width: 100%;
}

.nav-list .btn-primary {
    color: var(--bg-dark);
}

.nav-list .btn-primary:hover {
    color: var(--primary-color);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
}

/* =================================
   1. Hero (Tema Oscuro)
================================= */
.hero-section {
    position: relative;
    background-color: var(--bg-dark);
    padding: 8rem 0;
    text-align: left;
    overflow: hidden;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0;
    position: relative;
    z-index: 2;
}

.hero-intro {
    font-family: var(--font-family-mono);
    color: var(--link-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    max-width: 650px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-socials {
    display: flex;
    gap: 2rem;
}

.hero-socials a {
    font-size: 1.8rem;
    color: var(--text-muted);
}

.hero-socials a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* =================================
   2. Sobre Mí (Tema Oscuro)
================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 0.8fr 1.2fr;
        gap: 4rem;
    }
}

.about-image img {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* =================================
   3. Skills & Formación (Tema Oscuro)
================================= */
.skills-section h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Carrusel */
.skills-carousel-container {
    position: relative;
    overflow: hidden;
}

.skills-grid {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    margin-bottom: 4rem;
    scroll-behavior: smooth;
    padding: 1.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.skills-grid::-webkit-scrollbar {
    display: none;
}

/* Tarjetas de Skills */
.skill-category {
    background: var(--bg-medium);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
    flex: 0 0 240px;
    width: 240px;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.skill-category i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-category h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.skill-tag {
    background-color: var(--bg-light);
    color: var(--text-light);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: var(--font-family-mono);
}

/* Botones del Carrusel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: var(--bg-medium);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: var(--shadow-md);
}

.carousel-btn.prev-btn {
    left: 10px;
}

.carousel-btn.next-btn {
    right: 10px;
}

.carousel-btn:disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* Lista de Formación */
.formacion-list {
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.formacion-list li {
    background: var(--bg-medium);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.formacion-list i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.formacion-list p {
    margin-bottom: 0;
    color: var(--text-light);
}

.formacion-list strong {
    color: var(--text-dark);
}

/* =================================
   4. Proyectos (Tema Oscuro)
================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Tarjeta de Proyecto con POP-OUT INTELIGENTE */
.project-card {
    background: var(--bg-medium);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Configuración base */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    z-index: 1;
    transform-origin: center center;
    /* Por defecto crece desde el centro */
}

/* Efecto Hover Base */
.project-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
    /* Hacemos que crezca un 5% */
    border-color: var(--primary-color);
    z-index: 10;
    /* Se pone por encima de todo */
}

/* Modificadores de dirección (añadidos por JS) */
.project-card.is-on-left:hover {
    transform-origin: left center;
    /* Si está a la izquierda, crece hacia la derecha */
}

.project-card.is-on-right:hover {
    transform-origin: right center;
    /* Si está a la derecha, crece hacia la izquierda */
}

.project-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
    filter: saturate(0.8) brightness(0.9);
    transition: filter 0.3s ease;
}

.project-card:hover .project-image img {
    filter: saturate(1) brightness(1);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.project-content h3 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.project-content p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background-color: var(--accent-color);
    color: var(--bg-dark);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-family-mono);
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* =================================
   5. Valor Añadido (Tema Oscuro)
================================= */
.valor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .valor-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.valor-card {
    background: var(--bg-medium);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    transition: all 0.3s ease;
}

.valor-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.valor-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.valor-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.link-discreto {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-family-heading);
    color: var(--link-color);
}

.link-discreto:hover {
    color: var(--primary-color);
}

/* =================================
   6. Contacto (Tema Oscuro)
================================= */
.contact-social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Centrados */
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-direction: row;
    /* ¡¡FORZAMOS HORIZONTAL!! */
}

.contact-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centrar el icono */
    width: 55px;
    height: 55px;
    padding: 0;
    background-color: var(--bg-medium);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    /* Redondos */
    font-size: 1.5rem;
    /* Icono más grande */
    color: var(--text-light);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.contact-social-links a i {
    font-size: 1.2rem;
    margin-right: 0;
    /* Sin margen */
    transition: color 0.3s ease;
}

/* Efecto HOVER general */
.contact-social-links a:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border-color: transparent;
    color: white;
}

.contact-social-links a:hover i {
    color: white;
    /* Icono siempre blanco en hover */
}

/* Colores de Marca HOVER */
.contact-social-links a[aria-label="LinkedIn"]:hover {
    background-color: #0A66C2;
    /* Azul LinkedIn */
}

.contact-social-links a[aria-label="Enviar correo electrónico"]:hover {
    background-color: #D44638;
    /* Rojo Gmail/Email */
}

.contact-social-links a[aria-label="Contactar por WhatsApp"]:hover {
    background-color: #25D366;
    /* Verde WhatsApp */
}

.contact-social-links a[aria-label="GitHub"]:hover {
    background-color: #333;
    /* Gris oscuro GitHub */
}

/* Colores de icono por defecto (Visual Code) */
.contact-social-links a[aria-label="LinkedIn"] i {
    color: var(--primary-color);
    /* Cian */
}

.contact-social-links a[aria-label="Enviar correo electrónico"] i {
    color: var(--link-color);
    /* Verde */
}

.contact-social-links a[aria-label="Contactar por WhatsApp"] i {
    color: var(--accent-color);
    /* Ámbar/Naranja */
}

.contact-social-links a[aria-label="GitHub"] i {
    color: var(--keyword-color);
    /* Morado */
}

/* Formulario "Floating" Oscuro */
.contact-form-floating {
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group-floating {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1.25rem 1rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family-body);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-medium);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.form-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s ease-out;
    background-color: transparent;
    z-index: 10;
}

.form-input:focus+.form-label,
.form-input:not(:placeholder-shown)+.form-label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    font-weight: 600;
    color: var(--primary-color);
    background-color: var(--bg-medium);
    padding: 0 0.4rem;
    left: 0.8rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(97, 218, 251, 0.2);
}

.form-input[rows="5"] {
    resize: vertical;
    min-height: 150px;
}

.form-input[rows="5"]:focus+.form-label,
.form-input[rows="5"]:not(:placeholder-shown)+.form-label {
    top: 0.8rem;
    transform: translateY(-50%) scale(0.85);
}

.contact-form-floating .btn-full {
    width: 100%;
    max-width: 400px;
    align-self: center;
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* =================================
   Footer
================================= */
.main-footer {
    background-color: var(--bg-medium);
    color: var(--text-muted);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 4px solid var(--primary-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    font-size: 1.5rem;
    color: var(--text-light);
}

.footer-socials a:hover {
    color: var(--primary-color);
}

.main-footer .fa-heart {
    color: var(--primary-color) !important;
}

/* =================================
   Diseño Responsive (Móvil)
================================= */
@media (max-width: 768px) {
    .section-padding {
        padding: 4rem 0;
    }

    /* Menú Móvil */
    .nav-list {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        height: 100vh;
        background: var(--bg-medium);
        flex-direction: column;
        align-items: flex-start;
        padding: 6rem 2rem 2rem;
        gap: 2.5rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .nav-list.nav-open {
        transform: translateX(0);
    }

    .nav-list .btn {
        width: 100%;
        text-align: center;
    }

    .mobile-nav-toggle {
        display: block;
        z-index: 1001;
        color: var(--text-light);
    }

    .mobile-nav-toggle.is-open i:before {
        content: '\f00d';
    }

    /* Hero */
    .hero-section {
        padding: 4rem 0;
        text-align: center;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-content {
        max-width: 100%;
        margin: 0 auto;
    }

    .hero-socials {
        justify-content: center;
    }

    /* Grids */
    .about-grid,
    .valor-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Layout Asimétrico se vuelve simple en móvil */
    .section-grid-title {
        position: static;
        font-size: 2.5rem;
        text-align: center;
        white-space: normal;
    }

    .section-grid-content {
        padding-top: 0;
    }

    .contact-social-links {
        justify-content: center;
    }
}

/* =================================
   7. CURSOR PERSONALIZADO ("CHULO")
================================= */
body,
a,
button,
.project-card,
.skill-category,
.valor-card,
.nav-logo,
.carousel-btn {
    cursor: none;
}

.cursor-dot {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: top 0.05s ease-out, left 0.05s ease-out;
}

.cursor-outline {
    position: fixed;
    z-index: 9998;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: all 0.2s ease-out;
}

.cursor-outline.hover-effect {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(97, 218, 251, 0.1);
    border-color: var(--accent-color);
}

@media (max-width: 768px) {

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body,
    a,
    button,
    .project-card,
    .skill-category,
    .valor-card,
    .nav-logo,
    .carousel-btn {
        cursor: auto;
    }
}