/* ==========================================================================
   BT4G Unified Badge Design System (Pixel-Perfect)
   Standard Height: 16px | Fixed Widths | Theme Consistency
   ========================================================================== */

/* 1. Base Badge Class */
.metadata-badge,
.type-badge,
.res-badge,
.hdr-table-badge,
.status-badge,
.hdr-small-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    line-height: 1;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
    margin: 0;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* 2. Specific Absolute Widths */
.type-badge { width: 48px; min-width: 48px; max-width: 48px; transform: translateY(0px); }
.res-badge { width: 38px; min-width: 38px; max-width: 38px; transform: translateY(0px); }
.hdr-table-badge, .hdr-small-badge { width: 44px; min-width: 44px; max-width: 44px; }
.status-badge { 
    width: 60px; 
    min-width: 60px; 
    max-width: 60px; 
    padding-right: 2px;
}

/* 3. Type Colors */
.type-badge.type-remux { background: #a855f7; color: #fff; }
.type-badge.type-webdl { background: #06b6d4; color: #fff; }
.type-badge.type-audio { background: #10b981; color: #fff; }
.type-badge.type-others { background: #64748b; color: #fff; }
.type-badge.type-encode { background: #f43f5e; color: #fff; }

/* 4. Resolution Colors */
.res-badge.res-2160p { background: #f59e0b; color: #fff; }
.res-badge.res-1080p { background: #2563eb; color: #fff; }
.res-badge.res-720p, .res-badge.res-standard { background: #059669; color: #fff; }
.res-badge.res-sacd, .res-badge.res-dsd { background: #eab308; color: #fff; }
.res-badge.res-flac, .res-badge.res-alac { background: #0f766e; color: #fff; }
.res-badge.res-mp3, .res-badge.res-aac { background: #3b82f6; color: #fff; }
.res-badge.res-unknown { background: #475569; color: #cbd5e1; }

/* 5. HDR Colors */
.hdr-table-badge, .hdr-small-badge { background: #eab308; color: #fff; font-weight: 800; }
.hdr-table-badge.hdr-dv, .hdr-small-badge.hdr-dv { background: #8b5cf6; }
.hdr-table-badge.hdr-10plus, .hdr-small-badge.hdr-10plus { background: #f97316; }
.hdr-table-badge.hdr-none, .hdr-small-badge.hdr-none { background: #475569; color: #cbd5e1; font-weight: 400; }

/* 6. Status Colors */
.status-badge.cached { background: #10b981; color: #fff; }
.status-badge.not-cached { background: #ef4444; color: #fff; }
.status-badge.pending { background: #f59e0b; color: #000; }
.status-badge.failed { background: #6b7280; color: #fff; }

/* 6-1. Size Badge (for Grid View) */
.size-badge {
    background: rgba(71, 85, 105, 0.4);
    color: #4ade80;
    padding: 0 6px;
    border: 1px solid rgba(74, 222, 128, 0.2);
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 50px;
}

/* 7. Lightbox Overlay Styles */
#lightboxOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 200000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 5px;
    box-sizing: border-box;
}

#lightboxOverlay.active {
    display: flex;
    opacity: 1;
}

#lightboxOverlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightboxOverlay.active img {
    transform: scale(1);
}

#lightboxClose {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightboxClose:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}
