/* Gallery-specific styles */

.gallery-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/Kigali.png') no-repeat center center/cover;
    color: white;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 60px;
}

.gallery-hero-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: white;
}

.gallery-hero-content p {
    font-size: 1.3em;
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Controls */
.gallery-controls {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: static;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.controls-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
}

.year-selector {
    display: flex;
    gap: 10px;
}

.year-btn {
    padding: 8px 16px;
    border: 2px solid #ff4500;
    background: transparent;
    color: #ff4500;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.year-btn.active,
.year-btn:hover {
    background: #ff4500;
    color: white;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 15px;
    border: none;
    background: #f0f4f8;
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn.active,
.filter-btn:hover {
    background: rgb(0, 218, 255);
    color: white;
    transform: translateY(-2px);
}

.view-toggle {
    display: flex;
    gap: 5px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: rgb(0, 218, 255);
    color: white;
}

/* Gallery Main */
.gallery-main {
    min-height: 100vh;
    background: #f8fafc;
    padding: 40px 20px; /* Normal padding since controls are no longer fixed */
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    transition: all 0.3s ease;
}

.gallery-grid.masonry {
    columns: 4;
    column-gap: 20px;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item.loading {
    background: #e2e8f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Media Types */
.item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.item-video {
    width: 100%;
    height: 200px;
    object-fit: cover;
    position: relative;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.item-article {
    padding: 20px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.item-social {
    padding: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    min-height: 180px;
}

/* Item Content */
.item-content {
    padding: 15px;
}

.item-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2d3748;
    line-height: 1.3;
}

.item-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.item-type {
    background: rgb(0, 218, 255);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.lightbox-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-content iframe {
    width: 90vw;
    height: 70vh;
    border: none;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-info {
    position: absolute;
    top: 20px;
    left: 20px;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.lightbox-info:hover {
    opacity: 0.95;
}

.lightbox-title {
    font-size: 16px;
    margin-bottom: 6px;
    color: white;
    font-weight: 600;
}

.lightbox-description {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    opacity: 0.9;
}

.lightbox-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    opacity: 0.8;
}

/* Loading States */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gallery-controls {
        padding: 15px 0;
    }
    
    .controls-container {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }
    
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .gallery-main {
        padding: 20px 10px; /* Normal padding for mobile */
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
    
    .lightbox-info {
        max-width: calc(100vw - 20px);
        padding: 12px;
        top: auto;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
    
    .lightbox-title {
        font-size: 14px;
    }
    
    .lightbox-description {
        font-size: 11px;
    }
    
    .lightbox-content iframe {
        width: 95vw;
        height: 60vh;
    }
}

.loading-placeholder i {
    font-size: 48px;
    margin-bottom: 20px;
    color: rgb(0, 218, 255);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgb(0, 218, 255);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #ff4500;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-hero {
        height: 40vh;
        margin-top: 70px;
    }
    
    .gallery-hero-content h1 {
        font-size: 2em;
    }
    
    .controls-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-grid.masonry {
        columns: 1;
    }
    
    .lightbox-content iframe {
        width: 95vw;
        height: 60vh;
    }
    
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .gallery-grid.masonry {
        columns: 3;
    }
}

@media (max-width: 968px) and (min-width: 481px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid.masonry {
        columns: 2;
    }
}

/* Print styles */
@media print {
    .gallery-controls,
    .lightbox-overlay,
    .back-to-top {
        display: none !important;
    }
}