/* ========================================
   GALLERY PAGE STYLES
======================================== */

/* ========================================
   GALLERY CONTROLS
======================================== */
.gallery-controls {
    background-color: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.view-btn {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.view-btn.active {
    background-color: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-dark);
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
    color: var(--white);
    border-color: transparent;
}

.search-sort {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.sort-select {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--white);
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* ========================================
   GALLERY STATS
======================================== */
.gallery-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.gallery-stats .stat-item {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
    color: var(--white);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.gallery-stats .stat-item:hover {
    transform: translateY(-5px);
}

.gallery-stats .stat-item i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

/* ========================================
   GALLERY GRID
======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* Masonry View */
.gallery-grid.masonry {
    column-count: 3;
    column-gap: 25px;
    grid-template-columns: none;
}

.gallery-grid.masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 25px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    color: var(--white);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.gallery-item-category {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--primary-red);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.gallery-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-item-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-item-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-red);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   LOAD MORE
======================================== */
.load-more-container {
    text-align: center;
    margin: 50px 0;
}

.load-more-btn {
    min-width: 250px;
}

/* ========================================
   PHOTO LIGHTBOX
======================================== */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.lightbox-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    display: flex;
    gap: 40px;
    align-items: center;
}

#lightboxImage {
    max-width: 70%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    flex: 1;
    color: var(--white);
}

.lightbox-info h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.lightbox-info p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    opacity: 0.9;
}

.lightbox-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    font-size: 1rem;
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lightbox-action-btn {
    padding: 12px 25px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lightbox-action-btn:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* ========================================
   VIDEO GALLERY
======================================== */
.video-gallery-section {
    background-color: var(--bg-light);
    padding: 80px 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 35px;
}

.video-card {
    background-color: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--white);
    transition: all 0.3s ease;
}

.video-card:hover .video-play-btn {
    transform: translate(-50%, -50%) scale(1.2);
    background-color: var(--primary-red);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.video-info {
    padding: 25px;
}

.video-info h3 {
    font-size: 1.3rem;
    color: var(--primary-black);
    margin-bottom: 12px;
    line-height: 1.4;
}

.video-info > p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.video-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 992px) {
    .gallery-grid.masonry {
        column-count: 2;
    }

    .lightbox-content {
        flex-direction: column;
        gap: 20px;
    }

    #lightboxImage {
        max-width: 100%;
        max-height: 50vh;
    }

    .lightbox-info {
        max-width: 100%;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-controls {
        padding: 20px;
    }

    .filter-buttons {
        justify-content: center;
    }

    .search-sort {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .gallery-grid.masonry {
        column-count: 1;
    }

    .gallery-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-nav.prev {
        left: 10px;
    }

    .lightbox-nav.next {
        right: 10px;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-info h3 {
        font-size: 1.5rem;
    }

    .lightbox-info p {
        font-size: 1rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        justify-content: center;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-stats {
        grid-template-columns: 1fr;
    }

    .gallery-stats .stat-item {
        padding: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .lightbox-container {
        padding: 60px 10px;
    }

    .lightbox-actions {
        flex-direction: column;
    }

    .lightbox-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for gallery items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
/* Additional Gallery Styles for PHP Version */

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    text-align: center;
    padding: 20px;
}

.btn-view-photo {
    background: #fff;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-view-photo:hover {
    background: #3498db;
    color: #fff;
    transform: scale(1.05);
}

.btn-view-photo i {
    font-size: 16px;
}

/* No images message styling */
.no-images-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-images-message i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

.no-images-message h3 {
    margin: 1rem 0 0.5rem;
    color: #333;
}

.no-images-message p {
    margin: 0;
}

/* Lightbox improvements */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    z-index: 10001;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 10002;
}

.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: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 10002;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#lightboxImage {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    color: #fff;
}

.lightbox-info h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.lightbox-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 15px 0;
    font-size: 14px;
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lightbox-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lightbox-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lightbox-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    #lightboxImage {
        max-height: 50vh;
    }
    
    .lightbox-info h3 {
        font-size: 18px;
    }
    
    .lightbox-meta {
        font-size: 12px;
    }
}