/* ============================================
   GALERÍA DE PROYECTOS
   ============================================ */

/* Hero de Galería */
.gallery-hero {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    padding: 8rem 0 4rem;
    text-align: center;
    border-bottom: 2px solid #333;
}

.gallery-title {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 1rem;
    font-weight: 700;
}

.gallery-subtitle {
    font-size: 1.3rem;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
}

/* Filtros */
.gallery-filters {
    background: #1a1a1a;
    padding: 2rem 0;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 2rem;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 2px solid #333;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--white);
}

/* Grid de Galería */
.gallery-section {
    padding: 4rem 0;
    background: #0d0d0d;
    min-height: 60vh;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 168, 232, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.gallery-overlay p {
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Filtro - Ocultar elementos */
.gallery-item.hidden {
    display: none;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: var(--white);
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 168, 232, 0.8);
    color: var(--white);
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Botón Volver */
.back-section {
    padding: 3rem 0;
    background: #1a1a1a;
    text-align: center;
}

.btn-back {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 168, 232, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 0.8rem 1rem;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}
