/* ==========================================
   TEXCO Gallery Design System
   ========================================== */

:root {
    --primary: #422772;
    --primary-soft: #321d54;
    --primary-light: #563b8a;
    --secondary: #E52579;
    --accent: #88C1EF;
    --text-main: #212121;
    --text-muted: #2d3748;
    --border-color: #e2e8f0;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background-color: #ffffff !important;
}

/* Gallery Hero Section */
.gallery-hero {
    padding: 15px 5% 5px;
    text-align: left;
    background: #ffffff !important;
    position: relative;
    overflow: hidden;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    animation: slideUp 0.8s backwards;
}

.text-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    display: inline-block;
}

.gallery-subtitle {
    font-size: 1rem !important;
    color: var(--text-muted);
    margin: 0 0 2.8rem;
    white-space: nowrap !important;
    max-width: none !important;
    line-height: 1.6;
    animation: slideUp 0.8s 0.2s backwards;
}

/* Main Container */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5% 4rem;
    position: relative;
    z-index: 1;
}

/* Creative Filters */
.gallery-filters {
    display: flex;
    justify-content: center !important;
    gap: 12px;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
    animation: slideUp 0.8s 0.3s backwards;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(66, 39, 114, 0.22);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: #422772 !important; /* Solid brand purple, no gradients! */
    color: white !important;
    border-color: #422772 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 39, 114, 0.2) !important;
    font-weight: 700 !important;
}

/* Masonry / Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    position: relative;
    min-height: 400px;
}

.gallery-item {
    background: #ffffff !important;
    border: 1px solid rgba(66, 39, 114, 0.22) !important;
    border-radius: 20px !important;
    padding: 1.2rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
    text-align: center !important;
}

.gallery-item:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 10px 25px rgba(66, 39, 114, 0.1) !important;
    border-color: rgba(66, 39, 114, 0.35) !important;
    background: #ffffff !important;
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    position: absolute;
    width: 0; height: 0;
    overflow: hidden;
    margin: 0; padding: 0; border: none;
}

/* Zoom Effect */
.gallery-img-wrapper {
    width: 100% !important;
    height: 180px !important;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(66, 39, 114, 0.04) 0%, rgba(136, 193, 239, 0.08) 100%) !important;
    border: 1.5px dashed rgba(66, 39, 114, 0.18) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--transition);
}

.gallery-item:hover .gallery-img-wrapper {
    background: linear-gradient(135deg, rgba(66, 39, 114, 0.08) 0%, rgba(136, 193, 239, 0.12) 100%) !important;
    border-color: rgba(66, 39, 114, 0.3) !important;
}

.gallery-item:hover .gallery-img-wrapper i {
    transform: scale(1.1);
    color: rgba(66, 39, 114, 0.4) !important;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(24, 3, 60, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 80%;
    max-height: 80%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
}

.lightbox-caption h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.lightbox-caption p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.lightbox-close {
    position: absolute;
    top: -40px; right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-close:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-hero {
        padding: 30px 5% 5px;
    }
    .gallery-title {
        font-size: 2.2rem;
    }
}