/* ===================================================
   Control Productions - Gallery & Lightbox CSS
   ================================================== */

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===================================================
   EVENTS GRID
   ================================================== */

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.event-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    background-color: rgba(230, 52, 98, 0.1);
}

.event-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.event-card-content {
    padding: 1.5rem;
}

.event-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.event-card-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-spinner {
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    padding: 4rem 0;
}

.no-events {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    padding: 4rem 0;
}

/* ===================================================
   LIGHTBOX MODAL
   ================================================== */

.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 3rem;
    cursor: pointer;
    z-index: 10002;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

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

.lightbox-media-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.lightbox-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 600px;
}

.lightbox-media {
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
}

.lightbox-media iframe {
    width: 80vw;
    height: 45vw;
    max-width: 1200px;
    max-height: 675px;
    border-radius: 10px;
    border: none;
}

.lightbox-counter {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(230, 52, 98, 0.8);
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    right: 2rem;
}

.lightbox-next {
    left: 2rem;
}

/* ===================================================
   RESPONSIVE - GALLERY
   ================================================== */

@media (max-width: 768px) {
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .event-card-image {
        height: 200px;
    }

    .lightbox-media iframe {
        width: 90vw;
        height: 50.625vw;
    }

    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        right: 1rem;
    }

    .lightbox-next {
        left: 1rem;
    }

    .lightbox-title {
        font-size: 1.5rem;
    }

    .lightbox-description {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .events-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-close {
        top: 0.5rem;
        left: 0.5rem;
        font-size: 2.5rem;
    }

    .lightbox-content {
        padding: 1rem;
    }

    .lightbox-title {
        font-size: 1.3rem;
    }
}

/* ===================================================
   MASONRY GALLERY VIEW
   ================================================== */

.event-gallery-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    z-index: 9999;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-gallery-view.active {
    display: block;
    opacity: 1;
}

.gallery-header {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.98) 0%, rgba(26, 26, 26, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-bottom: 2px solid rgba(230, 52, 98, 0.3);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

/* Desktop layout - back button on the right */
@media (min-width: 769px) {
    .gallery-header-content {
        align-items: center;
    }

    .gallery-back-btn {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
}

.gallery-back-btn {
    background: linear-gradient(135deg, #E63462 0%, #ff4d7a 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-back-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(230, 52, 98, 0.4);
}

.gallery-event-info {
    text-align: center;
}

.gallery-event-info h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #E63462;
    margin-bottom: 0.5rem;
}

.gallery-event-info p {
    font-size: 1.1rem;
    color: #999;
    max-width: 600px;
}

/* Masonry Grid */
.masonry-grid {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    column-count: 4;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s ease;
}

.masonry-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.masonry-item:hover {
    transform: translateY(-5px) scale(1.02);
}

.masonry-item img,
.masonry-item video {
    width: 100%;
    display: block;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.masonry-item:hover img,
.masonry-item:hover video {
    filter: brightness(0.8);
}

/* Video/YouTube indicator */
.masonry-item[data-type="video"]::after,
.masonry-item[data-type="youtube"]::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #E63462;
    opacity: 0.9;
    pointer-events: none;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

.masonry-item[data-type="video"]:hover::after,
.masonry-item[data-type="youtube"]:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3) rotate(360deg);
    color: #ff4d7a;
}

/* New Single Item Lightbox */
.single-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.single-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.single-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.single-lightbox img,
.single-lightbox video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
}

.single-lightbox iframe {
    width: 80vw;
    height: 45vw;
    max-width: 1200px;
    max-height: 675px;
    border-radius: 10px;
    border: none;
}

.single-lightbox-close {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: rgba(230, 52, 98, 0.8);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.single-lightbox-close:hover {
    background-color: #E63462;
    transform: rotate(90deg) scale(1.1);
}

.single-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(230, 52, 98, 0.8);
    border: none;
    color: white;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.single-lightbox-nav:hover {
    background-color: #E63462;
    transform: translateY(-50%) scale(1.1) rotate(360deg);
}

.single-lightbox-prev {
    right: 2rem;
}

.single-lightbox-next {
    left: 2rem;
}

/* Responsive Masonry */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 1rem;
        padding: 0 1rem;
    }

    .gallery-header {
        padding: 1.5rem 1rem;
    }

    .gallery-header-content {
        gap: 1rem;
    }

    .gallery-event-info h2 {
        font-size: 1.5rem;
    }

    .gallery-event-info p {
        font-size: 1rem;
    }

    .single-lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .single-lightbox-prev {
        right: 1rem;
    }

    .single-lightbox-next {
        left: 1rem;
    }

    .single-lightbox-close {
        top: 1rem;
        left: 1rem;
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .masonry-grid {
        column-count: 2; /* Keep 2 columns even on small phones */
        column-gap: 0.5rem;
    }

    .masonry-item[data-type="video"]::after,
    .masonry-item[data-type="youtube"]::after {
        font-size: 2.5rem;
    }

    .gallery-event-info h2 {
        font-size: 1.3rem;
    }

    .gallery-event-info p {
        font-size: 0.9rem;
    }
}
