/* ==========================================
   GALLERY PAGE STYLES - With Filters and Labels
   ========================================== */

/* Gallery Section */
.gallery-section {
    padding: 60px 0;
    min-height: 60vh;
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    background: var(--deep-navy);
    color: var(--cream);
    border: 2px solid var(--rust-red);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--rust-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--rust-red);
    border-color: var(--cream);
}

/* Gallery Grid - 3 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    border: 3px solid var(--rust-red);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.gallery-item[data-category="all"] {
    border-color: var(--mint-green); /* Different border for unfiltered images */
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--mint-green);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Category Label - Always visible */
.category-label {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--rust-red);
    color: var(--cream);
    padding: 6px 15px;
    border-radius: var(--border-radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: var(--shadow-md);
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.gallery-item[data-category="all"] .category-label {
    background: var(--mint-green);
    color: var(--deep-navy);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(36,72,85,0.95), rgba(36,72,85,0.7));
    color: var(--cream);
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: var(--cream);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.gallery-overlay p {
    color: var(--cream);
    opacity: 1;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.4;
}

/* Gallery Stats */
.gallery-stats {
    text-align: center;
    margin-top: 30px;
    color: var(--cream);
    font-size: 1.1rem;
}

.gallery-stats span {
    font-weight: 700;
    color: var(--mint-green);
    font-size: 1.3rem;
}

/* ==========================================
   ADMIN CONTROLS (Only visible to admin)
   ========================================== */

.admin-gallery-toggle {
    position: fixed;
    bottom: 120px;
    left: 30px;
    z-index: 9999;
    display: none;
}

.admin-mode-btn {
    background: var(--rust-red);
    color: var(--cream);
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-full);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-mode-btn:hover {
    background: var(--bright-red);
    transform: translateY(-3px);
}

.admin-mode-btn.admin-mode-active {
    background: var(--mint-green);
    color: var(--deep-navy);
}

.admin-image-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
    z-index: 20;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .admin-image-controls {
    opacity: 1;
}

.admin-edit-btn,
.admin-delete-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.admin-edit-btn {
    background: var(--mint-green);
    color: var(--deep-navy);
}

.admin-edit-btn:hover {
    background: var(--cream);
    transform: scale(1.1);
}

.admin-delete-btn {
    background: var(--bright-red);
    color: var(--cream);
}

.admin-delete-btn:hover {
    background: #ff0000;
    transform: scale(1.1);
}

/* ==========================================
   LIGHTBOX
   ========================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid var(--rust-red);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--cream);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--rust-red);
}

.lightbox-close:hover {
    background: var(--bright-red);
    transform: rotate(90deg);
}

#lightbox-caption {
    color: var(--cream);
    font-size: 1.2rem;
    margin-top: 20px;
    text-align: center;
    background: var(--deep-navy);
    padding: 12px 30px;
    border-radius: var(--border-radius-full);
    border: 2px solid var(--rust-red);
    max-width: 80%;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    background: var(--rust-red);
    color: var(--cream);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--bright-red);
    transform: scale(1.1);
    opacity: 1;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .gallery-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .category-label {
        font-size: 0.8rem;
        padding: 4px 12px;
    }
    
    .admin-gallery-toggle {
        bottom: 100px;
        left: 20px;
    }
    
    .admin-mode-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .gallery-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
    }
    
    .admin-image-controls {
        opacity: 1;
        background: rgba(0,0,0,0.5);
        padding: 15px;
        border-radius: var(--border-radius-lg);
    }
    
    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(36,72,85,0.9), rgba(36,72,85,0.7));
    }
    
    .category-label {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
}