/* ==========================================================================
   MODULE: GALLERY.CSS
   Architectural Styles for Public-Facing Event Galleries & Media Portals
   ========================================================================== */

/* --- GALLERY LAYOUT CONTAINER --- */
.gallery-viewport {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 60px 16px;
}

/* ==========================================================================
   1C. ADMIN CONTROL PANEL MODULE & CONSTRAINED BACKDROP CURTAIN ENGINE
   ========================================================================== */
#control-panel-section {
    position: relative !important;
    box-sizing: border-box;
    margin-top: 0px !important;
    margin-bottom: 24px !important;
}

#control-panel-section::after {
    content: '' !important;
    position: absolute !important;
    top: -49px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: -110px !important;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 12, 0.75) 0%,
        rgba(10, 10, 12, 0.75) 65%,
        rgba(10, 10, 12, 0.35) 88%,
        rgba(10, 10, 12, 0.0) 100%
    ) !important;
    border-radius: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease-in-out !important;
    z-index: 5 !important;
}

.management-active-state #control-panel-section::after {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.control-panel-header {
    position: relative !important;
    padding: 10px 30px 16px 30px;
    box-sizing: border-box;
    z-index: 1 !important;
    transition: opacity 0.2s ease-in-out !important;
}

.management-active-state .control-panel-header {
    opacity: 0.3 !important;
}

.control-panel-header .bucket-title {
    padding-left: 0;
}

.dashboard-panel-row {
    padding: 0 30px;
    box-sizing: border-box;
}

.dashboard-panel-row .primary-toggle-block {
    padding-left: 0;
    margin: 0;
}

.dashboard-panel-row .secondary-action-block {
    padding-right: 0;
    margin: 0;
}

.drawer-content .nested-modifier-block {
    padding: 0 30px;
    box-sizing: border-box;
    margin-top: 12px;
}

.drawer-content .standalone-modifier-block {
    padding: 0 30px;
    box-sizing: border-box;
}

/* ==========================================================================
   1D. WORKSPACE CORE GRID LAYOUT & INITIALIZATION TOKENS
   ========================================================================== */
.admin-hidden-init {
    display: none !important;
}

.triage-structural-boundary {
    position: relative;
    padding: 20px 0;
}

.bucket-title {
    padding: 10px 0 16px 30px;
    font-weight: 700;
}

.triage-title-theme {
    color: #ff9500;
}

.live-title-theme {
    color: #30d158;
}

.admin-workspace-filter-bar {
    margin-top: 20px;
    padding: 0 30px;
}

/* ==========================================================================
   2. HIGH-PERFORMANCE PHOTOGRAPHY GRIDS
   ========================================================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0;
    margin-top: 16px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #1c1c1e;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid #2c2c2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
}

.photo-item:hover img {
    transform: scale(1.04);
}

/* ==========================================================================
   4. SYSTEM LIGHTBOX LAYER OVERLAYS & MODAL DIALOGUES
   ========================================================================== */
#lightboxOverlay.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   5. RESPONSIVE OVERRIDES (Gallery Grid Compression)
   ========================================================================== */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    #qrLightboxOverlay .modal-content {
        padding: 30px 20px !important;
    }
}

/* ==========================================================================
   6. ADMIN MODERATION ENGINE UI & SELECTION BLOCKS
   ========================================================================== */
.mod-item {
    position: relative;
    aspect-ratio: 1 / 1;
    background-color: #1c1c1e;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid #2c2c2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mod-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mod-item.selectable-mode:hover {
    transform: scale(1.02);
}

.mod-item.asset-selected {
    box-shadow: 0 0 25px rgba(0, 122, 255, 0.8) !important;
    transform: scale(0.96) !important;
}

.mod-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.mod-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.mod-item:hover .mod-overlay {
    opacity: 1;
}

.btn-card-micro {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: #ffffff;
    transition: background-color 0.15s;
}

.card-btn-danger { background-color: rgba(255, 69, 58, 0.9); }
.card-btn-danger:hover { background-color: #ff453a; }

.mod-item.selectable-mode:hover .mod-overlay {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.mod-item.selectable-mode.asset-selected::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 3px solid #007aff !important;
    border-radius: 11px;
    pointer-events: none;
    z-index: 99;
}

.no-photos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #8e8e93;
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}
