/* Gallery Styles */
.gallery-header {
    background: linear-gradient(135deg, #323275 0%, #4646a5 100%); /* Enhanced gradient background */
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
    margin-top: 70px; /* Add space for fixed navbar */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.gallery-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/images/textures/aluminum-texture.jpg');
    opacity: 0.05;
    z-index: 0;
}

.gallery-header::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
}

.gallery-header .container {
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 0;
    padding-bottom: 0;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
    line-height: 1.1;
}

.section-divider {
    width: 40%;
    max-width: 500px;
    min-width: 250px;
    height: 6px;
    background: linear-gradient(to right, #323275, #8a88ff, #323275);
    margin: -30px auto 15px;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(138, 136, 255, 0.5);
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform: translateY(-25px);
}

.section-divider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
    z-index: 2;
}

.section-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shimmer 3s infinite ease-in-out;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

.section-subtitle {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 20px auto 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
    position: relative;
    top: 10px;
}

/* Filter Buttons */
.gallery-filter {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    z-index: 10;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 10px 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Improved animation for filter buttons container */
[data-aos="fade-up"].filter-buttons {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.6s ease;
}

[data-aos="fade-up"].filter-buttons.aos-animate {
    transform: translateY(0);
    opacity: 1;
}

.filter-btn {
    background-color: white;
    border: 2px solid #e9ecef;
    color: #323275;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none !important;
    outline: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(50, 50, 117, 0.08);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.filter-btn:hover {
    background-color: #f9f9fb;
    border-color: #d0d4db;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.07);
}

.filter-btn:hover::before {
    width: 300px;
    height: 300px;
}

.filter-btn.active {
    background: linear-gradient(135deg, #323275 0%, #4646a5 100%);
    color: white;
    border-color: #323275;
    box-shadow: 0 6px 15px rgba(50, 50, 117, 0.25);
    transform: translateY(-1px);
}

/* Gallery Grid */
.gallery-grid {
    padding: 2rem 0;
    min-height: 500px;
}

.gallery-item {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background-color: #f8f9fa;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.gallery-item-inner {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
}

.gallery-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

/* Ensure no underlines on any links */
a.gallery-item-link,
a.gallery-item-link:hover,
a.gallery-item-link:focus,
a.gallery-item-link:active {
    text-decoration: none !important;
    border-bottom: none !important;
    outline: none !important;
}

/* Fix for gallery items */
.gallery-item a,
.gallery-item a:hover,
.gallery-item a:focus,
.gallery-item a:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Fix for underlines in gallery items */
.gallery-item-link, .gallery-item-link:hover, .gallery-item-link:focus, .gallery-item-link:active,
.gallery-title, .gallery-title:hover, .gallery-category, .gallery-category:hover {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Ensure filter buttons are visible */
.filter-btn {
    color: #323275 !important;
}

.filter-btn.active {
    background-color: #323275 !important;
    color: white !important;
}

/* Ensure gallery header text is visible */
.gallery-header {
    background-color: #323275;
}

/* Only apply these styles to the gallery section, not to other sections */
.gallery-header .section-title, 
.gallery-header .section-subtitle {
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.gallery-item-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
    outline: none;
}

.gallery-caption {
    padding: 12px 15px;
    background-color: white;
    border-top: 1px solid #f1f3f5;
}

.gallery-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none !important;
}

.gallery-category {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 4px;
}

/* Loading Indicator */
#loading-indicator {
    padding: 3rem 0;
}

/* Animation for items appearing */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Photoswipe custom styles */
.pswp__img {
    object-fit: contain;
}

.pswp__counter {
    color: white;
    font-size: 14px;
}

.pswp__caption__center {
    text-align: center;
    max-width: 500px;
    font-size: 14px;
    color: white;
}

/* Placeholder styles */
.placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: placeholderShimmer 1.5s infinite;
}

@keyframes placeholderShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
