/* ==========================================
 * FILE: css/components/gallery.css
 * ✅ Gallery View Styles
 * ========================================== */

/* Gallery Header */
.gallery-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.gallery-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%23ffffff" fill-opacity="0.05"/><circle cx="50" cy="50" r="40" stroke="%23ffffff" stroke-opacity="0.1" fill="none"/></svg>');
    opacity: 0.5;
}

/* Filters Section */
.filters-section {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(248, 249, 250, 0.95) !important;
}

.filter-btn {
    transition: all 0.3s ease;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Gallery Cards */
.gallery-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.gallery-image {
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Event Type Badges */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-content .row {
    max-height: 80vh;
    overflow-y: auto;
}

.lightbox-content .col-lg-4 {
    max-height: 80vh;
    overflow-y: auto;
}

/* Event Details in Lightbox */
.detail-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item i {
    min-width: 30px;
    font-size: 1.1rem;
}

/* Card Footer */
.card-footer {
    padding: 1rem 1.25rem;
}

.card-footer .btn {
    transition: all 0.3s ease;
}

.card-footer .btn:hover {
    transform: scale(1.05);
}

/* Empty State */
.text-center i.fa-4x {
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 991px) {
    .lightbox-content .row {
        flex-direction: column;
    }

    .lightbox-content .col-lg-8,
    .lightbox-content .col-lg-4 {
        max-height: none;
    }

    .lightbox-content img {
        max-height: 50vh !important;
    }
}

@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: 2rem;
    }

    .gallery-header p {
        font-size: 1rem;
    }

    .filter-btn {
        font-size: 0.875rem;
        padding: 0.4rem 1rem;
    }

    .gallery-card {
        margin-bottom: 1.5rem;
    }

    .lightbox-overlay {
        padding: 1rem;
    }

    .lightbox-content {
        max-height: 95vh;
    }
}

/* Loading State */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Badge Colors Override */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Card Title Truncate */
.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 3em;
}

/* Card Text Truncate */
.card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover Effects for Interactive Elements */
button,
a,
.gallery-card {
    -webkit-tap-highlight-color: transparent;
}

/* Focus States for Accessibility */
.filter-btn:focus,
.view-event-btn:focus,
.lightbox-close:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Image Loading State */
.gallery-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.gallery-image[src] {
    animation: none;
    background: none;
}

/* Print Styles */
@media print {
    .filters-section,
    .gallery-header,
    .card-footer,
    .lightbox-close {
        display: none !important;
    }

    .gallery-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .filters-section {
        background-color: rgba(33, 37, 41, 0.95) !important;
    }

    .gallery-card {
        background-color: #212529;
        color: #f8f9fa;
    }

    .card-text,
    .detail-item {
        color: #adb5bd !important;
    }
}