/* Gallery Page Styling */

/* Gallery Section */
.gallery-section {
    background: #f8f9fa;
    min-height: 80vh;
}

/* Gallery Filters */
.gallery-filters {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 2px solid #e9ecef;
    color: #6c757d;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.filter-btn .count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    min-width: 20px;
    text-align: center;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.25);
}

/* Gallery Search */
.gallery-search {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    padding-right: 45px;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #0056b3;
}

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.25rem;
}

.view-btn {
    background: transparent;
    border: none;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.view-btn.active,
.view-btn:hover {
    background: #007bff;
    color: white;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-grid.masonry {
    display: block;
    column-count: 3;
    column-gap: 1.5rem;
}

.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item-image {
    position: relative;
    overflow: hidden;
}

.gallery-item-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.gallery-item-content {
    padding: 1.5rem;
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.4;
}

.gallery-item-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Photo Modal */
.photo-viewer {
    position: relative;
}

.photo-container {
    position: relative;
    text-align: center;
    background: #000;
}

.photo-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.photo-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.photo-info {
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem 0;
}

.photo-details h4 {
    color: white;
    margin-bottom: 1rem;
}

.photo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.photo-meta .meta-item {
    color: #adb5bd;
    font-size: 0.9rem;
}

.photo-actions .btn {
    border-radius: 8px;
    font-weight: 500;
}

.photo-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.photo-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gallery Statistics */
.gallery-stats-section {
    background: #f8f9fa;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.stat-icon i {
    font-size: 2rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

/* No Results State */
.no-results-content {
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Load More Button */
#load-more-btn {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid.masonry {
        column-count: 2;
    }
}

@media (max-width: 991px) {
    .gallery-search {
        justify-content: stretch;
        margin-top: 1rem;
    }
    
    .search-box {
        max-width: none;
    }
    
    .filter-tabs {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-grid.masonry {
        column-count: 1;
    }
    
    .gallery-filters {
        padding: 1.5rem;
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        justify-content: space-between;
        text-align: left;
    }
    
    .gallery-search {
        flex-direction: column;
        gap: 1rem;
    }
    
    .photo-navigation {
        padding: 0 1rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .photo-info {
        padding: 1rem 0;
    }
    
    .photo-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item-image img {
        height: 200px;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
    }
    
    .stat-icon i {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Animation for loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth transitions for filter changes */
.gallery-grid.filtering .gallery-item {
    transition: all 0.3s ease;
}

.gallery-grid.filtering .gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}