/* ====== ANIMACIONES ====== */
@keyframes flyFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px); /* 🔹 Viene desde la izquierda */
    }
    to {
        opacity: 1;
        transform: translateX(0); /* 🔹 Llega a su posición original */
    }
}

@keyframes flyFromBottom {
    from {
        opacity: 0;
        transform: translateY(50px); /* 🔹 Viene desde abajo */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* 🔹 Llega a su posición original */
    }
}

/* ====== ESTADOS INICIALES (Antes de la animación) ====== */
.project-main,
.project-card {
    opacity: 0; /* 🔹 Ocultos al inicio */
}

/* ====== CUANDO ENTRAN EN PANTALLA (Clase agregada con JS) ====== */
.project-main.visible {
    animation: flyFromLeft 1s ease-out forwards;
}

.project-card.visible {
    animation: flyFromBottom 1s ease-out forwards;
}




/* ====== SECCIÓN DE PROYECTOS ====== */
.projects-section {
    text-align: center;
    padding: 80px 5%;
    margin-top: -50px;
    background-color: white; /* 🔹 Fondo en blanco */
}

/* ====== TÍTULO DE LA SECCIÓN ====== */
.section-title {
    font-size: 32px;
    font-weight: bold;
    color: #002b5c;
    margin-bottom: 30px;
    text-align: left;
    margin-left: 5%;
}

/* ====== CONTENEDOR PRINCIPAL ====== */
.projects-container {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* ====== PROYECTO PRINCIPAL (IZQUIERDA) ====== */
.project-main {
    flex: 3;
    background: white;
    border-radius: 10px;
    text-align: center;
    max-width: 800px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 🔹 Contenedor de imagen */
.project-main .image-container {
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 🔹 Imagen con efecto zoom-in */
.project-main .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ✅ Se mantiene dentro del contenedor */
    transition: transform 0.5s ease-in-out;
}

/* 🔹 Aplicar Zoom-In solo cuando el usuario pasa el mouse */
.project-main .image-container:hover img {
    transform: scale(1.1);
}


/* 🔹 Ajuste del texto debajo de la imagen */
.project-main .project-info {
    padding: 15px 10px;
    text-align: left; /* 🔹 Asegura alineación a la izquierda */
    width: 100%;
}

.project-main .project-info h3 {
    font-size: 18px;
    color: #002b5c;
    margin-top: 0px;
    margin-left: 25px;
}


/* ====== CONTENEDOR DE PROYECTOS SECUNDARIOS (DERECHA) ====== */
.projects-list {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-height: 700px; /* 🔹 Aumentamos la altura */
    overflow-y: auto;
    padding-right: 20px;
}

/* Personalizar Scrollbar en Webkit */
.projects-list::-webkit-scrollbar {
    width: 6px;
}

.projects-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.projects-list::-webkit-scrollbar-track {
    background: white;
}

/* ====== TARJETAS DE PROYECTO SECUNDARIAS ====== */
.project-card {
    background: white;
    border-radius: 10px;
    text-align: left; /* 🔹 Asegura que todo el contenido se alinee a la izquierda */
    max-width: 360px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 🔹 Contenedor de imagen */
.project-card .image-container {
    width: 100%;
    height: 230px;
    overflow: hidden;
    border-radius: 10px;
    position: relative;
}

/* 🔹 Imágenes dentro de los proyectos secundarios */
.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.5s ease-in-out;
}

/* 🔹 Efecto Zoom-in dentro del contenedor sin crecer el tamaño */
.project-card:hover .image-container img {
    transform: scale(1.1);
}

/* ====== ALINEACIÓN DEL TEXTO ====== */
.project-info {
    text-align: left; /* 🔹 Asegura que todo el contenido se alinee a la izquierda */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 🔹 Título del proyecto */
.project-title {
    font-size: 18px;
    font-weight: bold;
    color: #002b5c;
    text-align: left;
    margin-bottom: 5px; /* 🔹 Espacio entre título y "Read more" */
    margin-top: -10px;
    margin-left: 10px;
}

/* 🔹 Asegura espacio entre título y "Read more" */
.project-readmore {
    margin-top: -10px;
}


.read-more-p {
    text-decoration: none;
    font-size: 16px;
    font-weight: normal;
    color: #002b5c;
    display: inline-block;
    position: relative; /* Para posicionar la línea */
    font-weight: 300;
    margin-bottom: 30px;
    margin-left: 25px;
    font-family: 'MiFuenteSPD1', sans-serif;
    opacity: 0; /* 🔹 Ocultar antes de la animación */
    animation: fadeUp 1s ease-out 1.3s forwards;
}

/* Flecha roja */
.read-more-p::after {
    content: " →";
    color: red;  /* Solo la flecha en rojo */
}

/* Línea debajo del enlace */
.read-more-p::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px; /* Ubica la línea justo debajo */
    width: 0%; /* Inicia invisible */
    height: 1px;
    background-color: red; /* La línea es blanca */
    transition: width 0.3s ease-in-out; /* Suaviza la animación */
}

/* Aparece lentamente al hacer hover */
.read-more-p:hover::before {
    width: 100%; /* Se expande de 0 a 100% */
}

/* Estilos para los indicadores de scroll */
.scroll-indicators {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 0;
}



/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 1024px) {
    .projects-section {
        padding: 40px 20px;
    }

    .section-title {
        text-align: center;
        margin-left: 0;
        margin-bottom: 30px;
    }

    .projects-container {
        flex-direction: column;
        gap: 30px;
    }

    /* Proyecto Principal */
    .project-main {
        max-width: 100%;
        margin: 0 auto 20px;
    }

    .project-main .image-container {
        width: 90%;
        height: 400px;
        margin: 0 auto;
    }

    /* Lista de proyectos secundarios */
    .projects-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 10px 20px;
        max-height: none;
        width: 100%;
        grid-template-columns: unset; /* Eliminar grid */
        -webkit-overflow-scrolling: touch;
    }

    .projects-list::-webkit-scrollbar {
        display: none; /* Ocultar scrollbar pero mantener funcionalidad */
    }

    .project-card {
        flex: 0 0 300px;
        min-width: 300px; /* Asegurar ancho mínimo */
        max-width: 300px; /* Asegurar ancho máximo */
        scroll-snap-align: start;
        margin-right: 10px;
    }

    .project-card:last-child {
        margin-right: 20px; /* Espacio al final para indicar más contenido */
    }
}

@media (max-width: 767px) {
    .projects-section {
        padding: 30px 15px;
    }

    .project-main {
        height: auto; /* Cambiar de 90vh a auto */
        margin-bottom: 30px;
    }

    .project-main .image-container {
        height: 300px; /* Altura fija en lugar de porcentaje */
    }

    .projects-list {
        gap: 15px;
        padding: 10px 15px;
    }

    .project-card {
        flex: 0 0 85%;
        min-width: 85%; /* Asegurar ancho mínimo */
        max-width: 85%; /* Asegurar ancho máximo */
    }

    .project-card .image-container {
        height: 180px;
    }

    .project-title h4 {
        font-size: 16px;
    }

    .read-more-p {
        font-size: 14px;
        margin-left: 15px;
    }
}

/* Estilos para los indicadores de scroll */
.scroll-indicators {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .scroll-indicators {
        display: flex;
    }

    .scroll-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.2);
        transition: background-color 0.3s ease;
    }

    .scroll-dot.active {
        background: rgba(0, 0, 0, 0.6);
    }
}


