.hidden {
    display: none !important;
}

.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 15px 0;
    gap: 15px;
    flex-wrap: wrap;
}

.gallery-toolbar h2 {
    margin: 0;
    color: #182659;
}

/* Constrains .menu-button width when placed in the toolbar header */
.toolbar-btn {
    width: auto !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
}

/* Upload Panel */
.upload-panel {
    background: #ffffff;
    border: 1px solid #a8b7ce;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.drop-zone {
    border: 2px dashed #a8b7ce;
    border-radius: 6px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    margin: 15px 0;
    background: #f8fafc;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.drop-zone.dragover {
    border-color: #eb8d00;
    background: #fff8ee;
}

.drop-zone span {
    color: #182659;
    font-weight: bold;
    text-decoration: underline;
}

.drop-zone small {
    display: block;
    color: #666666;
    margin-top: 5px;
}

.status-bar {
    background: #eef3fa;
    border-left: 4px solid #182659;
    color: #182659;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
}

.photo-card {
    background: #ffffff;
    border: 1px solid #d9e1ec;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
    transform: translateY(-2px);
    border-color: #eb8d00;
    box-shadow: 0 4px 10px rgba(24, 38, 89, 0.15);
}

.photo-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.photo-card .caption {
    padding: 8px 10px;
    font-size: 14px;
    text-align: center;
    color: #3B3B3B;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.lightbox img {
    max-width: 92vw;
    max-height: 82vh;
    border: 2px solid #eb8d00;
    border-radius: 4px;
}

.lightbox-caption {
    color: #ffffff;
    margin-top: 12px;
    font-size: 16px;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 36px;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #eb8d00;
}
.lightbox-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 85vw;
    max-height: 88vh;
}

.lightbox-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    text-align: center;
}

.lightbox-counter {
    color: #a8b7ce;
    font-size: 13px;
    margin-top: 4px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(24, 38, 89, 0.75);
    color: #ffffff;
    border: 1px solid #eb8d00;
    border-radius: 6px;
    width: 48px;
    height: 60px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    z-index: 10000;
}

.lightbox-nav:hover {
    background: #ffffff;
    color: #eb8d00;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 767px) {
    .lightbox-stage {
        max-width: 94vw;
    }

    .lightbox-nav {
        width: 40px;
        height: 48px;
        font-size: 22px;
        background: rgba(24, 38, 89, 0.85);
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}

/* Video thumbnail wrapper and play icon badge */
.media-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 210px;
    background: #000000;
    overflow: hidden;
}

.media-thumb-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.video-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(24, 38, 89, 0.85);
    border: 2px solid #eb8d00;
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.photo-card:hover .video-play-badge {
    background: #ffffff;
    color: #eb8d00;
}

/* Lightbox Video Player */
#lightboxVideo {
    max-width: 92vw;
    max-height: 78vh;
    border: 2px solid #eb8d00;
    border-radius: 4px;
    background: #000000;
}

.upload-progress-wrapper {
    width: 100%;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #a8b7ce;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #182659;
    border-right: 3px solid #eb8d00;
    transition: width 0.15s ease;
}

.photo-card {
    position: relative;
}

.admin-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.admin-action-btn {
    background: rgba(24, 38, 89, 0.88);
    color: #ffffff;
    border: 1px solid #eb8d00;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-action-btn:hover {
    background: #ffffff;
    color: #eb8d00;
}

.admin-action-btn.delete-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

/* ==========================================================================
   Responsive Thumbnails for Small Devices (Phones & Tablets)
   ========================================================================== */
@media (max-width: 767px) {
    .photo-grid {
        /* 2 columns on standard phones, auto-adjusting cleanly */
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .photo-card {
        border-radius: 4px;
    }

    /* Square aspect-ratio keeps thumbnails uniform across any phone width */
    .photo-card img,
    .media-thumb-wrapper {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .photo-card .caption {
        padding: 5px 6px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .video-play-badge {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    /* Compact admin buttons on small thumbnails */
    .admin-card-actions {
        top: 4px;
        right: 4px;
        gap: 4px;
    }

    .admin-action-btn {
        padding: 2px 6px;
        font-size: 11px;
    }
}

/* Optional: 3-column compact grid on slightly wider mobile/small tablet screens */
@media (min-width: 480px) and (max-width: 767px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
