/* Enhanced Gallery Styles */

/* Gallery Hero Section */
.gallery-hero {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.95) 0%, rgba(0, 51, 102, 0.85) 100%), 
                url('images/kingstelEscape.jpg') center/cover no-repeat;
    padding: 80px 0 60px;
    text-align: center;
    color: var(--accent-white);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.gallery-hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.gallery-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Gallery Filters */
.gallery-filters-section {
    background: #f8f9fa;
    padding: 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--accent-white);
    border: 2px solid #e0e0e0;
    color: var(--text-dark);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn i {
    font-size: 1rem;
}

.filter-btn:hover {
    background: var(--primary-blue);
    color: var(--accent-white);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.2);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: var(--accent-white);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.3);
}

/* Gallery Main */
.gallery-main {
    padding: 60px 20px;
}

/* Gallery Grid - Masonry Style */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

/* Gallery Item */
.gallery-item {
    background: var(--accent-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 51, 102, 0.15);
}

.gallery-item-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 51, 102, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.gallery-zoom-btn {
    background: var(--secondary-gold);
    border: none;
    color: var(--primary-blue);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-zoom-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.gallery-item-caption {
    padding: 20px;
    background: var(--accent-white);
}

.gallery-item-caption h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 6px;
}

.gallery-item-caption p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Gallery Load More */
.gallery-load-more {
    text-align: center;
    padding: 20px 0;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--accent-white);
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
}

.btn-primary:hover {
    background: #004080;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 51, 102, 0.3);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: var(--accent-white);
    font-size: 1.1rem;
    text-align: center;
    max-width: 600px;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--accent-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--secondary-gold);
    color: var(--primary-blue);
    border-color: var(--secondary-gold);
    transform: scale(1.1);
}

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

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 60px 0 40px;
    }
    
    .gallery-hero-title {
        font-size: 2.2rem;
    }
    
    .gallery-hero-subtitle {
        font-size: 1rem;
    }
    
    .gallery-filters-section {
        padding: 20px 0;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .gallery-main {
        padding: 40px 16px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .gallery-hero-title {
        font-size: 1.8rem;
    }
    
    .gallery-hero-subtitle {
        font-size: 0.9rem;
    }
    
    .gallery-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .filter-btn i {
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .gallery-item-caption h3 {
        font-size: 1rem;
    }
    
    .gallery-item-caption p {
        font-size: 0.85rem;
    }
    
    .gallery-zoom-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .btn-primary {
        padding: 14px 30px;
        font-size: 0.9rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        display: none;
    }
}

/* Animation for filtered items */
.gallery-item.hidden {
    display: none;
}

.gallery-item.show {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.filter-btn:focus,
.gallery-zoom-btn:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 3px solid var(--secondary-gold);
    outline-offset: 3px;
}

/* Loading state */
.gallery-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 51, 102, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}