/* ==================== VARIABLES ==================== */
:root {
    --primary-color: #007bff;
    --secondary-color: #00bbff;
    --dark-bg: #0a0a0a;
    --dark-card: #1a1a1a;
    --text-light: #ffffff;
    --text-gray: #b0b0b0;
    --accent-gradient: linear-gradient(135deg, #007bff 0%, #00bbff 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--dark-bg);
    color: var(--text-light);
    overflow-x: hidden;
}

/* ==================== HEADER ==================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

header.abajo {
    box-shadow: 0 5px 30px rgba(0, 123, 255, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-links.not-active {
    display: flex;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 5% 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(0, 123, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 187, 255, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1400px;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content h2 {
    font-size: 2rem;
    color: var(--text-gray);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-light);
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    color: var(--dark-bg);
    transform: translateY(-3px);
}

.hero-image {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: -2rem;
}

.image-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.image-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.3; 
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.5; 
    }
}

.image-container img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid rgba(0, 123, 255, 0.3);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

.social-links {
    display: flex;
    gap: 1rem;
    z-index: 10;
}

/* Botones sociales para DESKTOP */
.social-links-desktop {
    position: absolute;
    bottom: 4rem;
    left: 5%;
    display: flex;
}

/* Botones sociales para MÓVIL */
.social-links-mobile {
    display: none;
    position: relative;
    justify-content: center;
    margin-top: 1.5rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    transform: translateY(-5px);
}

/* ==================== SECTIONS ==================== */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h1,
.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title .highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title p {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* ==================== NUEVA SECCIÓN SOBRE MÍ ==================== */
.about {
    padding: 6rem 5%;
    background: var(--dark-card);
    position: relative;
}

.container_content-sobreMi {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.container_texto-sobreMi {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.title_sobreMi {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.texto_sobreMi {
    color: var(--text-gray);
    line-height: 1.8;
    font-size: 1.05rem;
}

.container_image-sobreMi {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image_sobreMi {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.image_sobreMi:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 123, 255, 0.4);
}

/* ==================== NUEVA SECCIÓN HABILIDADES ==================== */
.skills {
    padding: 6rem 5%;
    position: relative;
}

.puntos1-habilidades,
.puntos2-habilidades {
    position: absolute;
    width: 100px;
    opacity: 0.1;
    border-radius: 10px;
}

.puntos1-habilidades {
    top: 10%;
    left: 5%;
}

.puntos2-habilidades {
    bottom: 10%;
    right: 5%;
}

.cards_container--habilidades {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.cards--habilidades {
    background: var(--dark-card);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    text-align: center;
}

.cards--habilidades:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.2);
}

.cards--habilidades img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.cards--habilidades:hover img {
    transform: scale(1.1);
}

.cards--habilidades p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
}

.icon-excel {
    width: 50px;
    height: 50px;
    filter: invert(34%) sepia(56%) saturate(632%) hue-rotate(95deg) brightness(93%) contrast(87%);
    transition: transform 0.3s ease;
}

.icon-office {
    width: 50px;
    height: 50px;
    filter: invert(24%) sepia(91%) saturate(6355%) hue-rotate(10deg) brightness(94%) contrast(106%);
    transition: transform 0.3s ease;
}

.icon-github {
    width: 50px;
    height: 50px;
    filter: invert(44%) sepia(91%) saturate(1243%) hue-rotate(224deg) brightness(96%) contrast(93%);
}

/* ==================== PROJECTS SECTION ==================== */
.projects {
    padding: 6rem 5%;
    background: var(--dark-card);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.2);
}

.project-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.2), rgba(0, 187, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.project-card:hover .project-image::before {
    left: 100%;
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 5px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    flex: 1;
    padding: 0.8rem;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link-demo {
    background: var(--accent-gradient);
    color: var(--text-light);
}

.link-demo:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

.link-code {
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.link-code:hover {
    background: var(--secondary-color);
    color: var(--dark-bg);
}

/* ==================== CONTACT SECTION ==================== */
.contact {
    padding: 6rem 5%;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--dark-card);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-light);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* ==================== FOOTER ==================== */
footer {
    padding: 2rem 5%;
    background: var(--dark-card);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: var(--text-gray);
}

/* ==================== SCROLL TO TOP ==================== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    cursor: pointer;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
}

/* ==================== CARRUSEL DE PROYECTOS ==================== */
.card-carousel {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    /* Agregamos un fondo oscuro por si la imagen no ocupa todo el ancho */
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%); 
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    /* Centramos la imagen perfectamente en el contenedor */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    /* CAMBIO CLAVE: Muestra la imagen completa sin deformar ni recortar texto */
    object-fit: contain; 
    object-position: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 123, 255, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1rem;
}

.carousel-btn:hover {
    background: rgba(0, 187, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: rgba(0, 123, 255, 1);
    width: 12px;
    height: 12px;
}

.project-card .project-image {
    display: none;
}

.project-card:has(.card-carousel) .project-image {
    display: none;
}

.carousel-slide.mobile-screenshot img {
    object-fit: contain;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.carousel-slide.mobile-view {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 187, 255, 0.1));
}

.carousel-slide.mobile-view img {
    width: auto;
    height: 100%;
    max-width: 50%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

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

    .image-container {
        width: 300px;
        height: 300px;
    }
    
    .social-links-desktop {
        display: none !important;
    }

    .social-links-mobile {
        display: flex !important;
    }

    .container_content-sobreMi {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 8rem 5% 2rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-container {
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        display: block;
        visibility: visible;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        display: block;
        visibility: visible;
    }

    .hero-content p {
        margin-bottom: 1.5rem;
        font-size: 1rem;
        display: block;
        visibility: visible;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 1rem;
        margin-bottom: 0;
    }

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

    .social-links-desktop {
        display: none !important;
    }

    .social-links-mobile {
        display: flex !important;
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .hero-image {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 0;
    }

    .image-container {
        width: 250px;
        height: 250px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .section-title h1,
    .section-title h2 {
        font-size: 2rem;
    }

    .cards_container--habilidades {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .image-container {
        width: 220px;
        height: 220px;
    }
}