/* Importar una fuente moderna */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Variables CSS para una gestión más fácil del diseño */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #5548c8;
    --background-color: #f4f7f9;
    --text-color: #333;
    --light-text-color: #777;
    --card-bg: #fff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-radius: 10px;
}

/* Estilo para el canvas del fondo */
#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Envía el canvas al fondo */
    background: var(--background-color); /* Color de fondo del canvas */
}

/* Envuelve el resto del contenido en un div con esta clase para que quede por encima del canvas */
.content {
    position: relative;
    z-index: 0;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden; /* Evita el scroll horizontal */
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Estilos de Tipografía */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--light-text-color);
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Encabezado y Navegación */
#main-header {
    background: var(--card-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    box-shadow: var(--shadow);
    z-index: 100;
    transition: background 0.3s ease;
}

#main-header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    transition: color 0.3s;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 600;
    position: relative;
}

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

.nav-link:hover::after {
    width: 100%;
}

/* Sección de Presentación (Hero) */
.hero-section {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 4rem 2rem;
    flex-wrap: wrap;
    text-align: center;
}

.presentacion-texto {
    animation: slideInLeft 1s ease-out;
    max-width: 600px;
    text-align: left;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--light-text-color);
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
}

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

.sub-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.description {
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.presentacion-img {
    animation: fadeIn 2s ease-out;
}

.profile-pic {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 5px solid var(--card-bg);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.2);
}

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

.secondary-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.2);
}

/* Estilos para las Secciones */
.section {
    padding: 6rem 0;
}

/* Proyectos */
.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Aumento el minmax para que intenten estar en una fila */
    gap: 2rem;
}

@media (max-width: 768px) {
    .proyectos-grid {
        grid-template-columns: 1fr; /* Vuelve a una columna en pantallas más pequeñas */
    }
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-card a {
    color: inherit;
    display: block;
}

.project-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 2px solid var(--background-color);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    color: var(--text-color);
}

.card-content p {
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.view-link {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

/* Experiencia (Timeline) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Estilo predeterminado (móvil primero) */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 31px;
    margin-left: -1px;
}

.timeline-item {
    padding: 1rem 1rem 1rem 5rem;
    position: relative;
    width: 100%;
    animation: fadeIn 1s forwards;
    opacity: 0;
}

.timeline-item .timeline-dot {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 1.5rem;
    left: 24px;
    z-index: 1;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: left;
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.timeline-content .company {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Habilidades */
.habilidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    text-align: center;
}

.skill-card {
    background: var(--card-bg);
    padding: 2rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

/* Estilo específico para C++ porque no me gustaba el default*/
.skill-card .fa-c {
    font-size: 3rem;
}
.skill-card .fa-plus {
    font-size: 1.5rem;
    position: relative;
    top: -0.5rem;
    left: -0.2rem;
}

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

.skill-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Contacto */
.contacto-flex {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    flex-wrap: wrap;
}

.contact-form {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contacto-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--text-color);
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    color: var(--light-text-color);
    border-top: 1px solid #ddd;
}

/* Estilos para el ícono de menú de hamburguesa */
.nav-toggle {
    display: none; /* Oculto en pantallas grandes */
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Media query para convertir a dos columnas en pantallas grandes */
@media (min-width: 993px) {
    .timeline::after {
        left: 50%;
    }

    .timeline-item {
        width: 50%;
        padding: 1rem 4rem;
    }
    
    .timeline-item:nth-child(odd) {
        left: 0;
        text-align: right;
    }
    
    .timeline-item:nth-child(even) {
        left: 50%;
        text-align: left;
    }
    
    .timeline-item:nth-child(odd) .timeline-dot {
        right: -7.5px;
        left: auto;
    }
    
    .timeline-item:nth-child(even) .timeline-dot {
        left: -7.5px;
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        text-align: left;
    }
}

/* Estilos para móviles más pequeños (max-width: 768px) */
@media (max-width: 768px) {
    .nav-toggle {
        display: block; /* Muestra el ícono de hamburguesa */
    }

    .nav-links {
        /* Estilos para el menú desplegable en móviles */
        flex-direction: column;
        background: var(--card-bg);
        position: absolute;
        top: 80px; 
        left: 0;
        width: 100%;
        height: 0; 
        overflow: hidden;
        transition: all 0.3s ease-in-out;
        box-shadow: var(--shadow);
        opacity: 0;
        transform: translateY(-20px);
    }

    .nav-links.active {
        height: 250px; /* Altura para mostrar todos los enlaces */
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links li {
        text-align: center;
        padding: 1rem 0;
        border-bottom: 1px solid var(--background-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .nav-link::after {
        display: none; 
    }

    .main-title {
        font-size: 2.5rem;
    }

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

    .presentacion-img {
        display: none;
    }

    .contacto-flex {
        flex-direction: column;
        gap: 2rem;
    }

    .contact-form {
        width: 100%;
    }
}

