/* media_viewer/static/style.css */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #000; /* Black background for full-screen effect */
    color: #fff; /* White text */
    overflow: hidden; /* Hide scrollbars if media slightly overflows */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Ensure body takes full viewport height */
    position: relative; /* For absolute positioning of controls */
}

.controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000; /* Ensure controls are on top of media */
    background: rgba(12, 18, 30, 0.88); /* Translucent dark background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 210, 255, 0.3);
    padding: 12px 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 92vw;
    max-width: 540px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 210, 255, 0.15);
    opacity: 0; /* Start hidden */
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Add a class to make it visible */
.controls.visible {
    opacity: 1;
    pointer-events: auto; /* Enable interaction when visible */
}

.dev-mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 1px;
    color: #38bdf8;
    text-transform: uppercase;
}

.dev-title {
    display: flex;
    align-items: center;
}

.dev-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff6b00;
    box-shadow: 0 0 10px #ff6b00, 0 0 18px rgba(255, 107, 0, 0.6);
    margin-right: 8px;
    animation: dev-pulse 2s infinite;
}

@keyframes dev-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hotkeys-guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78em;
    color: #94a3b8;
}

.hotkeys-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 12px;
    flex-wrap: wrap;
}

.hotkeys-tag {
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

.tag-portal {
    color: #38bdf8;
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.tag-keypad {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.hotkey-item {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.keypad-row kbd {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.4);
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
    font-weight: bold;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.35);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.version-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 0.85em;
    font-weight: bold;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.4);
    border-radius: 4px;
    letter-spacing: 0.5px;
    user-select: none;
}

.dev-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-photobooth-btn {
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: bold;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dev-photobooth-btn.active {
    background: rgba(255, 107, 0, 0.22);
    border-color: rgba(255, 107, 0, 0.7);
    color: #ff9d42;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

.dev-photobooth-btn:hover {
    filter: brightness(1.2);
}

.dev-sound-btn {
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: bold;
    background: rgba(255, 107, 0, 0.2);
    border: 1px solid rgba(255, 107, 0, 0.6);
    color: #ff9d42;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dev-sound-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.dev-sound-btn:hover {
    filter: brightness(1.15);
}

/* Dataset Preview in Developer Mode */
.dev-dataset-container {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 620px;
}

.dev-dataset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75em;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-dataset-subtext {
    font-size: 0.85em;
    color: #64748b;
    font-weight: normal;
    text-transform: none;
}

.dev-dataset-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 190px;
    overflow-y: auto;
    padding-right: 4px;
}

.dev-dataset-list::-webkit-scrollbar {
    width: 5px;
}

.dev-dataset-list::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.3);
    border-radius: 3px;
}

.dev-dataset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.dev-dataset-item:hover {
    background: rgba(0, 210, 255, 0.12);
    border-color: rgba(0, 210, 255, 0.4);
}

.dev-item-id {
    font-family: monospace;
    font-size: 0.85em;
    font-weight: bold;
    color: #38bdf8;
    background: rgba(0, 210, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.dev-item-name {
    flex: 1;
    margin: 0 10px;
    font-size: 0.85em;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dev-item-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-youtube {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-video {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-image {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.dev-dataset-empty {
    font-size: 0.8em;
    color: #64748b;
    padding: 8px;
    text-align: center;
}

/* Sound Toast Notification */
.sound-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #00d2ff;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.05em;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 210, 255, 0.3);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.sound-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #475569;
    border-radius: 4px;
    background-color: #1e293b;
    color: #fff;
    font-size: 1em;
    width: 240px;
}

input[type="text"]:focus {
    outline: none;
    border-color: #00d2ff;
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

button {
    padding: 8px 15px;
    background-color: #0284c7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #0369a1;
}

.media-container {
    width: 100vw; /* Take full viewport width */
    height: 100vh; /* Take full viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#mediaTitle {
    position: absolute;
    top: 100px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 999; /* Below controls, above media */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

#mediaTitle.visible {
    opacity: 1;
}

#mediaDisplay {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Crops excess on the sides */
}

/* Ensure native videos and images always fill 100% of vertical height and crop sides */
#mediaDisplay > img,
#mediaDisplay > video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 100vw;
    min-height: 100vh;
    object-fit: cover; /* Fills vertically and horizontally, cropping overflow */
    object-position: center;
    border: none;
    display: block;
    pointer-events: none;
}

/* Force YouTube 16:9 iframe to fill the screen vertically and crop on the sides */
#mediaDisplay iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    min-width: 177.78vh; /* 100vh * (16 / 9) - forces full vertical coverage */
    min-height: 56.25vw; /* 100vw * (9 / 16) - forces full horizontal coverage */
    border: none;
    display: block;
    pointer-events: none;
}

/* Real-time Photobooth AI Person Cutout Canvas */
#photoboothCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    object-fit: cover;
    z-index: 100; /* Directly above mediaDisplay (z-index: 1), below transition overlay (z-index: 2000) */
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out;
}

#photoboothCanvas.visible {
    opacity: 1;
    visibility: visible;
}

/* Styling for the transition video overlay */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover; /* Cover the entire screen vertically & horizontally */
    object-position: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
}

.transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Registration / QR Code Screen --- */
.registration-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    max-width: 440px;
    width: 90vw;
    background: rgba(10, 16, 28, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 2px solid rgba(0, 210, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0, 210, 255, 0.25), 0 10px 40px rgba(0, 0, 0, 0.85);
    text-align: center;
    animation: reg-fade-in 0.4s ease-out;
}

@keyframes reg-fade-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.reg-badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #38bdf8;
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.reg-title {
    font-size: 1.6em;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 12px rgba(0, 210, 255, 0.5);
}

.reg-id-box {
    margin-bottom: 12px;
    font-size: 0.95em;
    color: #94a3b8;
}

.reg-id-val {
    font-family: monospace;
    font-weight: bold;
    color: #00d2ff;
    background: rgba(0, 210, 255, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.reg-qr-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 210, 255, 0.3);
    margin: 6px 0 14px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reg-qr-wrapper img {
    position: static !important;
    transform: none !important;
    width: 200px !important;
    height: 200px !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: contain !important;
    display: block !important;
    pointer-events: auto !important;
}

.reg-instructions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    text-align: left;
    font-size: 0.85em;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.reg-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
}

.reg-step-num {
    font-weight: 800;
    color: #00d2ff;
    min-width: 16px;
}

.reg-hint {
    font-size: 0.75em;
    color: #64748b;
    margin-top: 4px;
}

.reg-direct-link {
    font-size: 0.8em;
    color: #38bdf8;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 4px;
}

/* --- Member Passport & Certifications Screen --- */
.certifications-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px 34px;
    max-width: 480px;
    width: 90vw;
    background: rgba(10, 16, 28, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(59, 192, 205, 0.6);
    border-radius: 18px;
    box-shadow: 0 0 45px rgba(59, 192, 205, 0.3), 0 12px 45px rgba(0, 0, 0, 0.85);
    text-align: center;
    animation: reg-fade-in 0.35s ease-out;
}

.cert-badge {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #3bc0cd;
    background: rgba(59, 192, 205, 0.15);
    border: 1px solid rgba(59, 192, 205, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cert-title {
    font-size: 1.8em;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
    text-shadow: 0 0 14px rgba(59, 192, 205, 0.5);
}

.cert-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.cert-tier {
    font-size: 0.8em;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
}

.cert-card-id {
    font-family: monospace;
    font-size: 0.8em;
    font-weight: 700;
    color: #f16622;
    background: rgba(241, 102, 34, 0.15);
    border: 1px solid rgba(241, 102, 34, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
}

.cert-section-label {
    width: 100%;
    text-align: left;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.cert-list-box {
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

.cert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}

.cert-check {
    color: #10b981;
    font-weight: 900;
    font-size: 1.1em;
    margin-right: 8px;
}

.cert-name {
    font-size: 0.85em;
    font-weight: 700;
    color: #f1f5f9;
    flex: 1;
}

.cert-tag {
    font-size: 0.7em;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
}

.cert-empty {
    padding: 20px 14px;
    font-size: 0.85em;
    color: #94a3b8;
    line-height: 1.5;
}

.cert-footer-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.75em;
    color: #94a3b8;
}

.cert-footer-guide kbd {
    background: #1e293b;
    border: 1px solid #475569;
    color: #38bdf8;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
}

/* Developer Mode Drive Script Row */
.dev-drive-script-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78em;
    color: #94a3b8;
}

.dev-drive-script-row label {
    white-space: nowrap;
    font-weight: bold;
    color: #38bdf8;
}

.dev-drive-script-row input {
    flex: 1;
    font-size: 0.8em;
    padding: 4px 8px;
    width: auto;
}

/* --- Photobooth Capture Modal & Backdrop Picker --- */
.capture-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.capture-modal.active {
    display: flex;
}

/* Fullscreen Countdown Overlay with Glowing Orange Circle */
.capture-countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(220px, 44vmin, 380px);
    height: clamp(220px, 44vmin, 380px);
    border-radius: 50%;
    border: 9px solid #ff7b00;
    box-shadow: 0 0 35px #ff7b00, 
                0 0 75px rgba(255, 123, 0, 0.75), 
                inset 0 0 35px rgba(255, 123, 0, 0.45);
    background: rgba(8, 14, 26, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: clamp(7rem, 22vmin, 13rem);
    font-weight: 900;
    font-family: system-ui, -apple-system, sans-serif;
    color: #ffffff;
    text-shadow: 0 0 25px #ff7b00, 0 0 55px #ff7b00, 0 0 90px rgba(255, 123, 0, 0.9);
    z-index: 3500;
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
    user-select: none;
    line-height: 1;
    box-sizing: border-box;
}

.capture-countdown.active {
    display: flex;
}

.capture-countdown.anim-pop {
    animation: countdown-pop 0.95s cubic-bezier(0.15, 0.85, 0.35, 1.2) forwards;
}

@keyframes countdown-pop {
    0% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; filter: blur(6px); }
    18% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; filter: blur(0px); }
    75% { transform: translate(-50%, -50%) scale(0.98); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
}

/* Fullscreen Camera Flash Effect */
.capture-flash {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 3600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

.capture-flash.active {
    opacity: 0.95;
    transition: none;
}

/* Result Card */
.capture-result-card {
    background: rgba(10, 16, 28, 0.95);
    border: 2px solid rgba(0, 210, 255, 0.5);
    border-radius: 14px;
    padding: 18px 24px;
    max-width: 680px;
    width: 92vw;
    box-shadow: 0 0 40px rgba(0, 210, 255, 0.3), 0 10px 40px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: reg-fade-in 0.3s ease-out;
}

.capture-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.capture-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.capture-title {
    font-size: 1.15em;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 1px;
}

.capture-inactivity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.45);
    border-radius: 14px;
    font-size: 0.82em;
    font-weight: 700;
    color: #ff9d42;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    user-select: none;
}

.capture-inactivity-badge .timer-icon {
    font-size: 0.95em;
}

.capture-inactivity-badge .timer-countdown {
    font-family: monospace;
    font-size: 1.05em;
    min-width: 28px;
    text-align: right;
    font-weight: 800;
}

.capture-inactivity-badge.urgent {
    background: rgba(255, 107, 0, 0.3);
    border-color: #ff6b00;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 107, 0, 0.8);
    animation: badge-pulse 1s ease-in-out infinite alternate;
}

@keyframes badge-pulse {
    0% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 107, 0, 0.5); }
    100% { transform: scale(1.06); box-shadow: 0 0 18px rgba(255, 107, 0, 0.95); }
}

.capture-subtitle {
    font-size: 0.78em;
    color: #94a3b8;
}

.capture-preview-box {
    position: relative;
    width: auto;
    height: 52vh;
    max-height: 55vh;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(0, 210, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#captureCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Spinner Overlay while uploading */
.capture-spinner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.capture-spinner-overlay.active {
    display: flex;
}

.capture-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(0, 210, 255, 0.2);
    border-top-color: #00d2ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.capture-spinnerText {
    font-size: 0.9em;
    font-weight: bold;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

/* QR Code Download Overlay */
.capture-qr-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 28, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 10px;
    text-align: center;
}

.capture-qr-overlay.active {
    display: flex;
}

.qr-heading {
    font-size: 1.15em;
    font-weight: 800;
    color: #ff7700;
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(255, 107, 0, 0.65);
}

.qr-img-box {
    background: #ffffff;
    padding: 8px;
    border-radius: 10px;
    border: 2px solid rgba(255, 107, 0, 0.7);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 0, 0.5);
    display: inline-flex;
}

.qr-img-box img {
    position: static !important;
    transform: none !important;
    width: 160px !important;
    height: 160px !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: contain !important;
    display: block !important;
}

.qr-subtext {
    font-size: 0.8em;
    color: #94a3b8;
}

.qr-direct-link {
    font-size: 0.8em;
    color: #38bdf8;
    text-decoration: underline;
    cursor: pointer;
}

/* Backdrop Switcher Bar */
.backdrop-selector-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    max-height: 90px;
    overflow-y: auto;
}

.backdrop-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    font-size: 0.8em;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.backdrop-pill:hover {
    background: rgba(0, 210, 255, 0.12);
    border-color: rgba(0, 210, 255, 0.4);
}

.backdrop-pill.selected {
    background: rgba(0, 210, 255, 0.22);
    border-color: #00d2ff;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
}

.backdrop-pill kbd {
    font-size: 0.85em;
    padding: 1px 4px;
}

.capture-footer-guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78em;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

#captureConfirmHint kbd {
    color: #ff9d42;
    background: rgba(255, 107, 0, 0.18);
    border-color: rgba(255, 107, 0, 0.55);
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.35);
}

/* --- Photobooth Media Options Gallery Modal --- */
.photobooth-gallery-modal {
    z-index: 2400; /* Directly below capture modal (2500), above transitions/media */
}

.gallery-result-card {
    max-width: 880px;
    width: 94vw;
    max-height: 88vh;
}

.gallery-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    max-height: 64vh;
    overflow-y: auto;
    padding: 6px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.4) transparent;
}

.gallery-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(13, 21, 38, 0.88);
    border: 2px solid rgba(0, 210, 255, 0.35);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.gallery-card:hover,
.gallery-card:focus-visible {
    border-color: #ff7700;
    transform: translateY(-3px) scale(1.025);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.65), 0 0 32px rgba(0, 210, 255, 0.35);
}

.gallery-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3; /* Portrait aspect ratio matching vertical screen & portal display */
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-thumb-img {
    transform: scale(1.08);
}

.gallery-num-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 16, 28, 0.94);
    border: 1.5px solid #ff7700;
    color: #ff9d42;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.95em;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.85);
    user-select: none;
}

.gallery-info {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(10, 16, 28, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-title {
    font-size: 0.9em;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.gallery-num-tag {
    font-size: 0.78em;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(0, 210, 255, 0.12);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
}

.gallery-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px;
    color: #94a3b8;
    font-size: 0.95em;
}

#galleryCancelHint kbd {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* --- Delete Confirmation Modal (-) --- */
.delete-card {
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 45px rgba(239, 68, 68, 0.35), 0 10px 40px rgba(0, 0, 0, 0.95);
    max-width: 520px;
}

.delete-title {
    color: #ef4444;
}

.delete-info-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    margin: 8px 0;
    box-sizing: border-box;
}

.delete-item-title {
    font-size: 1.25em;
    font-weight: 800;
    color: #ffffff;
    word-break: break-word;
}

.delete-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85em;
    color: #94a3b8;
}

.delete-item-meta strong {
    color: #38bdf8;
}

.delete-warning-text {
    margin: 0;
    font-size: 0.88em;
    line-height: 1.45;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
    padding: 8px 12px;
    border-radius: 4px;
}

.confirm-delete-hint kbd {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 0 #991b1b;
    border-color: #f87171;
}

.confirm-delete-hint {
    color: #fca5a5;
    font-weight: 700;
}

.delete-status-spinner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    color: #38bdf8;
    font-size: 0.9em;
    font-weight: 600;
}





.cert-name {
    font-size: 0.85em;
    font-weight: 700;
    color: #f1f5f9 !important;
    flex: 1;
}

.cert-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    flex-shrink: 0;
}

.cert-icon-box svg {
    width: 22px;
    height: 22px;
}

.cert-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.cert-category {
    font-size: 0.72em;
    color: #94a3b8;
    margin-top: 2px;
}

.cert-plus-tag {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.75em;
    font-weight: 900;
    color: #ffffff;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
}


/* --- Video Game Style Badge Grid (v6.6) --- */
.cert-game-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 10px 4px;
    width: 100%;
    box-sizing: border-box;
}

.cert-game-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 116px;
    text-align: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cert-game-badge:hover {
    transform: translateY(-4px) scale(1.05);
}

.cert-badge-frame {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 22px;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.15) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 3px solid var(--badge-color, #3bc0cd);
    box-shadow: 0 0 20px var(--badge-color, rgba(59, 192, 205, 0.4)), inset 0 0 14px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.cert-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    filter: drop-shadow(0 0 8px var(--badge-color, #3bc0cd));
}

.cert-badge-plus {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--badge-color, #f16622);
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    line-height: 25px;
    text-align: center;
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px var(--badge-color, rgba(241, 102, 34, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-badge-caption {
    width: 100%;
}

.cert-badge-title {
    font-size: 0.85em;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.25;
    margin-bottom: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    word-break: break-word;
}

.cert-badge-level {
    font-size: 0.7em;
    font-weight: 700;
    color: var(--badge-color, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.75px;
}
