/* Cyberpunk Lightbox (#9) */
.cyber-lightbox {
position: fixed;
inset: 0;
z-index: 20000;
display: flex;
align-items: center;
justify-content: center;
transition: opacity 0.25s ease, visibility 0.25s ease;
user-select: none;
-webkit-user-select: none;
}

.cyber-lightbox.hidden {
display: none !important;
opacity: 0;
pointer-events: none;
visibility: hidden;
}

.lightbox-backdrop {
position: absolute;
inset: 0;
background: rgba(4, 2, 10, 0.92);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}

.lightbox-container {
position: relative;
width: 80vw;
height: 80vh;
max-width: 80vw;
max-height: 80vh;
min-width: 320px;
min-height: 240px;
background: rgba(14, 8, 28, 0.94);
border: 1.5px solid rgba(168, 85, 247, 0.6);
border-radius: 18px;
box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(168, 85, 247, 0.3);
display: flex;
flex-direction: column;
overflow: hidden;
z-index: 1;
box-sizing: border-box;
}

.lightbox-resize-handle {
position: absolute;
bottom: 2px;
right: 2px;
width: 22px;
height: 22px;
display: flex;
align-items: center;
justify-content: center;
cursor: nwse-resize;
color: rgba(192, 132, 252, 0.6);
transition: all 0.2s ease;
z-index: 50;
user-select: none;
touch-action: none;
}

.lightbox-resize-handle:hover,
.lightbox-resize-handle.active {
color: #34d399;
filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.8));
transform: scale(1.15);
}

.lightbox-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 18px;
background: rgba(8, 4, 18, 0.96);
border-bottom: 1px solid rgba(168, 85, 247, 0.35);
font-family: ui-monospace, monospace;
font-size: 0.85rem;
user-select: none;
}

.lightbox-title-box {
display: flex;
align-items: center;
gap: 8px;
color: #e9d5ff;
font-weight: 600;
}

.lightbox-zoom-badge {
padding: 2px 8px;
border-radius: 6px;
background: rgba(52, 211, 153, 0.15);
border: 1px solid rgba(52, 211, 153, 0.4);
color: #34d399;
font-size: 0.72rem;
font-weight: 700;
}

.lightbox-gallery-counter {
padding: 2px 8px;
border-radius: 6px;
background: rgba(168, 85, 247, 0.18);
border: 1px solid rgba(168, 85, 247, 0.4);
color: #c084fc;
font-size: 0.72rem;
font-weight: 700;
}

.lightbox-gallery-counter.hidden,
.lightbox-nav-btn.hidden {
display: none !important;
}

.lightbox-nav-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 20;
width: 42px;
height: 64px;
border: 1px solid rgba(168, 85, 247, 0.45);
border-radius: 12px;
background: rgba(8, 4, 18, 0.78);
color: #e9d5ff;
font-size: 1.8rem;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}

.lightbox-nav-prev { left: 12px; }
.lightbox-nav-next { right: 12px; }

.lightbox-nav-btn:hover {
background: rgba(52, 211, 153, 0.22);
border-color: #34d399;
color: #34d399;
box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

.lightbox-toolbar {
display: flex;
align-items: center;
gap: 6px;
}

.lightbox-tool-btn {
background: rgba(168, 85, 247, 0.12);
border: 1px solid rgba(168, 85, 247, 0.35);
border-radius: 8px;
color: #e9d5ff;
padding: 5px 10px;
font-family: ui-monospace, monospace;
font-size: 0.8rem;
font-weight: 700;
cursor: pointer;
transition: all 0.2s ease;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
}

.lightbox-tool-btn:hover {
background: rgba(52, 211, 153, 0.25);
border-color: #34d399;
color: #34d399;
box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
}

.lightbox-tool-btn.active {
background: rgba(52, 211, 153, 0.3);
border-color: #34d399;
color: #34d399;
box-shadow: 0 0 16px rgba(52, 211, 153, 0.7);
}

.lightbox-close-btn:hover {
background: rgba(244, 63, 94, 0.3);
border-color: #f43f5e;
color: #f43f5e;
box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
}

.lightbox-viewport {
position: relative;
flex: 1;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
cursor: zoom-in;
background: radial-gradient(circle at center, rgba(30, 15, 60, 0.3) 0%, rgba(5, 2, 12, 0.95) 100%);
user-select: none;
-webkit-user-select: none;
touch-action: none;
}

.lightbox-viewport.is-zoomed {
cursor: grab;
}

.lightbox-viewport.grabbing {
cursor: grabbing !important;
}

.lightbox-viewport.grabbing .lightbox-img {
transition: filter 0.25s ease !important;
}

.lightbox-img {
max-width: 90%;
max-height: 90%;
object-fit: contain;
border-radius: 8px;
box-shadow: 0 0 35px rgba(0, 0, 0, 0.8);
transition: filter 0.25s ease, transform 0.08s cubic-bezier(0.16, 1, 0.3, 1);
transform-origin: center center;
user-select: none;
-webkit-user-select: none;
-webkit-user-drag: none;
}

.lightbox-img.night-vision {
filter: invert(1) hue-rotate(180deg) saturate(1.4) contrast(1.2) drop-shadow(0 0 20px rgba(52, 211, 153, 0.8));
}

.lightbox-hud {
position: absolute;
bottom: 16px;
left: 16px;
padding: 10px 14px;
border-radius: 10px;
background: rgba(8, 4, 18, 0.88);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(52, 211, 153, 0.5);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 15px rgba(52, 211, 153, 0.2);
font-family: ui-monospace, monospace;
font-size: 0.72rem;
color: #a7f3d0;
pointer-events: none;
animation: msg-appear 0.2s ease-out;
}

.hud-header {
font-weight: 700;
color: #34d399;
letter-spacing: 0.08em;
margin-bottom: 4px;
border-bottom: 1px solid rgba(52, 211, 153, 0.3);
padding-bottom: 2px;
}

.hud-row {
display: flex;
justify-content: space-between;
gap: 12px;
line-height: 1.4;
}

.hud-row b {
color: #f1f5f9;
}
