/* Estilos específicos para la sección de proyectos */
.projects-section {
    width: 50vw;
    margin: auto;
    background: rgba(161, 162, 164, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    text-align: center;
    color: var(--text-primary);
    font-size: 2.5rem;
    margin-bottom: 4rem;
    font-weight: 700;
}

.projects-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    padding: 0 2rem;
}

.project-card {
    flex: 0 1 calc(33.333% - 2rem);
    min-width: 400px;
    max-width: 400px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-5px);
    outline: 3px solid var(--primary-color);
}

.project-image {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.project-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: initial;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 25, 40, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

/* Estilos del contenido con mejor contraste */
.project-overlay h4 {
    color: #FFFFFF;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-description {
    color: #F8FAFC;
    text-align: center;
    margin: 1rem 0;
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 500;
}

.project-tags {
    color: #60A5FA;
    font-size: 0.95rem;
    margin: 1rem 0;
    text-align: center;
    font-weight: 600;
}

.project-button {
    background: #2563EB;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.project-button:hover,
.project-button:focus {
    background: #1D4ED8;
    transform: translateY(-2px);
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
    text-decoration: none;
}

/* Soporte para preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {

    .project-card,
    .project-overlay,
    .project-button,
    .project-image img {
        transition: none;
    }

    .project-card:hover,
    .project-card:focus-within {
        transform: none;
    }

    .project-button:hover,
    .project-button:focus {
        transform: none;
    }
}

/* Indicador de interactividad visible */
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: border-color 0.3s ease;
    z-index: 1;
}

.project-card:hover::before,
.project-card:focus-within::before {
    border-color: var(--primary-color);
}

/* Media Queries */
@media screen and (max-width: 1400px) {
    .project-card {
        flex: 0 1 calc(50% - 2rem);
    }

}

@media screen and (max-width: 900px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 3rem;
    }

    .projects-container {
        gap: 2rem;
    }
}

@media screen and (max-width: 480px) {
    .projects-section {
        padding: 2rem 1rem;
    }

    .projects-container {
        padding: 0 1rem;
    }

    .project-card {
        flex: 1 1 100%;
        max-width: 400px;
    }

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

    .project-image {
        height: 200px;
    }

    .project-overlay h4 {
        font-size: 1.25rem;
    }

    .project-description {
        font-size: 0.95rem;
    }

    .project-tags {
        font-size: 0.85rem;
    }
}

/* Aseguramos que el overlay no interfiera con el click */
.project-overlay {
    pointer-events: none;
}

.project-overlay>* {
    pointer-events: auto;
}