/* Projects Section */
.projects-container {
    background: var(--light-blue);
    padding: clamp(0.5rem, 10vw, 8rem) clamp(1rem, 5vw, 2rem);
    text-align: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Projects Hero Section */
.projects-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
                url('./img/ada1.jpeg') center/cover;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    text-align: center;
    color: var(--white);
    opacity: 0;
    animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.6;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(2rem, 5vw, 4rem);
    margin-top: 4rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.3s; }
.stat-item:nth-child(2) { animation-delay: 0.5s; }
.stat-item:nth-child(3) { animation-delay: 0.7s; }

.stat-number {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.9;
    font-weight: 500;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .projects-hero {
        min-height: 70vh;
        padding: clamp(10rem, 15vw, 8rem) clamp(1rem, 5vw, 2rem);
    }

    .hero-stats {
        gap: 2rem;
    }

    .stat-item {
        flex: 1 1 150px;
        max-width: 200px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .stat-item:active {
        transform: scale(0.98);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .projects-hero {
        background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
                    url('../img/ada1.jpeg') center/cover;
    }

    .stat-number {
        color: var(--primary-blue);
    }
}

.projects-container h2 {
    color: var(--primary-blue);
    margin-bottom: clamp(2rem, 5vw, 3rem);
    font-size: clamp(2rem, 5vw, 2.5rem);
    opacity: 0;
    animation: fadeInScale 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: clamp(1.5rem, 4vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.project-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s var(--transition-smooth) forwards;
    transition: all var(--transition-smooth);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.project-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 122, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover .project-image img {
    transform: scale(1.1) rotate(2deg);
}

.project-btn {
    background: var(--white);
    color: var(--primary-blue);
    padding: 0.8rem 1.8rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-card:hover .project-btn {
    transform: translateY(0);
    opacity: 1;
}

.project-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 122, 255, 0.3);
}

.project-info {
    padding: clamp(1.2rem, 3vw, 1.8rem);
    text-align: left;
}

.project-info h3 {
    color: var(--primary-blue);
    margin-bottom: 0.8rem;
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    position: relative;
    padding-bottom: 0.5rem;
}

.project-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card:hover .project-info h3::after {
    transform: scaleX(1);
}

.project-info p {
    color: var(--dark-gray);
    margin-bottom: 1.2rem;
    line-height: 1.6;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.project-features {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-features span {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--dark-gray);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    opacity: 0.9;
}

.project-features i {
    color: var(--primary-blue);
    font-size: 1.1em;
}


/* Custom Properties */
:root {
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile and Tablet Optimizations */
@media (max-width: 768px) {
    .projects-container {
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-bottom: max(4rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .project-card {
        margin: 0 auto;
        max-width: 400px;
    }

    .project-overlay {
        opacity: 0;
        transform: translateY(100%);
        background: rgba(0, 122, 255, 0.9);
        align-items: center;
        justify-content: center;
        transition: opacity 0.5s, transform 0.5s;
    }

    /* Mostrar el overlay solo al presionar */
    .project-card:active .project-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .project-btn {
        transform: translateY(20px);
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Mostrar el botón dentro del overlay */
    .project-card:active .project-btn {
        transform: translateY(0);
        opacity: 1;
    }

    /* Evitar animaciones de hover en dispositivos táctiles */
    .project-card:hover {
        transform: none;
    }
}


/* Touch Device Optimizations */
@media (hover: none) {
    .project-card:hover {
        transform: none;
    }
    
    .project-info h3::after {
        transform: scaleX(1);
    }
    
    .project-btn:active {
        transform: scale(0.98);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .projects-container {
        background: var(--light-blue);
    }
    
    .project-card {
        background: var(--white);
    }
    
    .project-info p,
    .project-features span {
        color: var(--dark-gray);
    }
}