/* ═══════════════════════════════════════════
   Gallery Modal — Centered popup with blur backdrop
   Two-column layout (image left, info right)
   ═══════════════════════════════════════════ */

.gm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    animation: gm-fade-in 0.2s ease;
}
.gm-overlay.open { display: flex; }

@keyframes gm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gm-container {
    display: grid;
    grid-template-columns: 55% 45%;
    width: 90vw;
    max-width: 1200px;
    height: 92vh;
    max-height: 950px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: gm-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gm-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Left Column: Image Viewer ── */
.gm-viewer {
    position: relative;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gm-viewer img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.gm-viewer img:hover {
    transform: scale(1.02);
}

/* Close button */
.gm-close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 50;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.gm-close:hover { background: rgba(255, 255, 255, 0.25); }

/* Navigation arrows */
.gm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}
.gm-nav:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-50%) scale(1.1); }
.gm-nav.prev { left: 16px; }
.gm-nav.next { right: 16px; }
.gm-nav:disabled { opacity: 0.2; cursor: default; pointer-events: none; }

/* Bottom bar (download + share) */
.gm-bottom-bar {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.gm-bottom-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: none;
    background: rgba(40, 40, 50, 0.9);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
}
.gm-bottom-btn:hover { background: rgba(60, 60, 80, 0.95); }

/* ── Right Column: Info Panel ── */
.gm-info {
    background: #18181b;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable content area */
.gm-info-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Header row (avatar + name + date + position) */
.gm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.gm-creator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.gm-creator-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.gm-creator-date {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 1px;
}

.gm-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gm-position-badge {
    background: #27272a;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}

.gm-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s, background 0.2s;
}
.gm-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Badges row */
.gm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gm-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    border: none;
}
.gm-badge.type { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.gm-badge.model { background: #27272a; color: #d1d5db; }

/* Technical details */
.gm-section-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.gm-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 3px 0;
}
.gm-detail-row .label { color: #9ca3af; }
.gm-detail-row .value { color: #fff; }

/* Description — full text, no truncation */
.gm-description {
    color: #d1d5db;
    font-size: 0.82rem;
    line-height: 1.6;
}

/* Action buttons — flow with content */
.gm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    padding-bottom: 4px;
}

.gm-action-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    transition: filter 0.2s, transform 0.15s;
}
.gm-action-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.gm-action-btn:active { transform: translateY(0); }

.gm-action-btn.theme-song { background: linear-gradient(135deg, #7c3aed, #3b82f6); }
.gm-action-btn.similar { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.gm-action-btn.video { background: linear-gradient(135deg, #16a34a, #22c55e); }
.gm-action-btn.upscale { background: linear-gradient(135deg, #7c3aed, #a855f7); }

/* Prompt copy */
.gm-prompt-section {
    position: relative;
}
.gm-copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.gm-copy-btn:hover { background: rgba(139, 92, 246, 0.3); color: #fff; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .gm-container {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh 1fr;
        width: 96vw;
        height: 92vh;
        max-height: none;
        border-radius: 14px;
    }
    .gm-viewer img { max-width: 95%; max-height: 95%; }
    .gm-info { border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.06); }
}

/* Zoom overlay */
.gm-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0, 0, 0, 0.97);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.gm-zoom-overlay.open { display: flex; }
.gm-zoom-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}
