/**
 * Washington Home Improvements - Gallery Page Styles
 * Modern filterable gallery with lightbox and animations
 */

/* ========================================
   HERO SECTION
   ======================================== */

.gallery-hero-section {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
    overflow: hidden;
    padding: calc(var(--space-3xl) * 1.5) 0;
}

.gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(255, 145, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(135, 206, 235, 0.15) 0%, transparent 50%);
    animation: overlayFloat 10s ease-in-out infinite;
}

@keyframes overlayFloat {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
}

.gallery-hero-inner {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-badge-gallery {
    display: inline-block;
    background: linear-gradient(135deg, #ff9100, #ff7c00);
    color: white;
    padding: var(--space-xs) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
    box-shadow: 0 4px 12px rgba(255, 145, 0, 0.4);
}

.gallery-hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    color: white;
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.gallery-hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: #87CEEB;
    line-height: 1.6;
}

/* ========================================
   GALLERY MAIN SECTION
   ======================================== */

.gallery-main-section {
    padding: calc(var(--space-3xl) * 2) 0;
    background: #f8f9fa;
}

/* ========================================
   CATEGORY SECTIONS
   ======================================== */

.gallery-categories {
    /* Container for all category sections */
}

.gallery-category-section {
    margin-bottom: calc(var(--space-3xl) * 1.5);
}

.gallery-category-section:last-child {
    margin-bottom: 0;
}

.gallery-category-heading {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: #1a2332;
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 3px solid #ff9100;
    padding-bottom: var(--space-md);
}

.category-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

/* ========================================
   GALLERY GRID
   ======================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item-inner {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item-inner:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(255, 145, 0, 0.25);
}

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

.gallery-item-inner:hover .gallery-image {
    transform: scale(1.05);
}

/* Hover Overlay */
.gallery-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 145, 0, 0.85), rgba(255, 124, 0, 0.85));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item-inner:hover .gallery-hover-overlay {
    opacity: 1;
}

.gallery-zoom-icon {
    font-size: 3rem;
    color: white;
    animation: zoomPulse 1.5s ease-in-out infinite;
}

@keyframes zoomPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Gallery Placeholder for items without images */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1rem;
    font-weight: 600;
    color: #a0aec0;
}

/* Gallery Overlay - Hidden */
.gallery-overlay {
    display: none;
}

/* ========================================
   LOAD MORE SECTION
   ======================================== */

.gallery-load-more {
    text-align: center;
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 2px solid #e2e8f0;
}

.gallery-count {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 600;
}

.gallery-count span {
    color: #ff9100;
    font-weight: 700;
}

/* ========================================
   LIGHTBOX MODAL
   ======================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.gallery-lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: zoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 145, 0, 0.9);
    border-color: #ff9100;
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-nav:hover {
    background: rgba(255, 145, 0, 0.9);
    border-color: #ff9100;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========================================
   CTA SECTION
   ======================================== */

.gallery-cta-section {
    padding: calc(var(--space-3xl) * 2) 0;
    background: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
    position: relative;
    overflow: hidden;
}

.gallery-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 145, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(135, 206, 235, 0.1) 0%, transparent 50%);
}

.gallery-cta-inner {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.gallery-cta-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    color: white;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, #ffffff 0%, #87CEEB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-cta-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: #87CEEB;
    margin-bottom: var(--space-2xl);
    line-height: 1.6;
}

.gallery-cta-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.btn-outline-light {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline-light:hover {
    background: white;
    color: #1a2332;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 968px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .gallery-category-heading {
        font-size: clamp(1.5rem, 3vw, 2rem);
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

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

    .lightbox-prev {
        left: 20px;
    }

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

@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .gallery-category-section {
        margin-bottom: var(--space-2xl);
    }

    .gallery-category-heading {
        font-size: 1.5rem;
        gap: var(--space-sm);
    }

    .category-icon {
        font-size: 1.25rem;
    }

    .gallery-zoom-icon {
        font-size: 2.5rem;
    }

    .gallery-cta-actions {
        flex-direction: column;
    }

    .gallery-cta-actions .btn {
        width: 100%;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

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

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

/* Stagger animation delays for gallery items */
.gallery-item:nth-child(1) { animation-delay: 0s; }
.gallery-item:nth-child(2) { animation-delay: 0.05s; }
.gallery-item:nth-child(3) { animation-delay: 0.1s; }
.gallery-item:nth-child(4) { animation-delay: 0.15s; }
.gallery-item:nth-child(5) { animation-delay: 0.2s; }
.gallery-item:nth-child(6) { animation-delay: 0.25s; }
.gallery-item:nth-child(7) { animation-delay: 0.3s; }
.gallery-item:nth-child(8) { animation-delay: 0.35s; }
.gallery-item:nth-child(9) { animation-delay: 0.4s; }
.gallery-item:nth-child(10) { animation-delay: 0.45s; }
.gallery-item:nth-child(11) { animation-delay: 0.5s; }
.gallery-item:nth-child(12) { animation-delay: 0.55s; }
