/* ==========================================================================
   EVEREST LATINO — PHOTOBOOTH SCREEN STYLING (QUIET LUXURY / LEICA-HASSELBLAD)
   Screen-sized photobooth layout, precision viewfinder ticks, and concentric shutter.
   ========================================================================== */

body.booth-screen {
    background: #06070a;
}

.booth-screen .reto-bg,
.booth-screen .reto-overlay {
    display: none;
}

.booth-screen .reto-wrapper {
    max-width: none;
    width: 100%;
    min-height: 100dvh;
    padding: 20px 32px 30px;
    gap: 20px;
}

.booth-screen .photobooth-top-nav {
    min-height: 60px;
    position: relative;
    border-bottom: 1px solid rgba(229, 193, 123, 0.15);
}

.booth-screen .nav-brand-lockup {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.booth-screen .nav-brand-text {
    display: block;
    line-height: 1.6;
    text-align: center;
    letter-spacing: 2.2px;
}

.booth-screen .nav-brand-text small {
    color: var(--gold-primary);
    letter-spacing: 1.2px;
    font-size: 11px;
    font-weight: 500;
}

.booth-screen .reto-card {
    flex: 1;
    min-height: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* GRID PRINCIPAL EN PANTALLA COMPLETA */
.booth-screen #stepChallenge {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-rows: auto auto 1fr auto;
    gap: 20px 28px;
    align-items: start;
}

.booth-screen #stepChallenge > :not(.live-camera-modal) {
    grid-column: 2;
}

.booth-screen #stepChallenge > :is(.event-badge, .host-title, .event-subtitle, .welcome-banner, .missions-invite, .challenge-box) {
    display: none;
}

.booth-screen .mode-tabs {
    margin: 0;
    grid-row: 1;
}

.booth-screen .filter-section {
    grid-row: 2;
    margin: 0;
    text-align: left;
}

.booth-screen .filter-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-height: none;
    overflow: visible;
    gap: 8px;
}

.booth-screen .filter-pill {
    text-align: left;
    border-radius: 12px;
    min-height: 46px;
    padding: 12px 16px;
    font-size: 0.8rem;
}

/* MODAL Y VIEWPORT DE CÁMARA LEICA/HASSELBLAD */
.booth-screen .live-camera-modal {
    display: flex;
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1 / 5;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    z-index: auto;
    width: 100%;
}

.booth-screen .live-camera-content {
    display: flex;
    flex-direction: column;
    max-width: none;
    width: 100%;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    background: rgba(14, 17, 26, 0.94);
    overflow: hidden;
}

.booth-screen .live-video-box {
    height: clamp(300px, calc(100dvh - 240px), 760px);
    aspect-ratio: auto;
    background: radial-gradient(ellipse at center, #151825 0%, #07090f 100%);
    isolation: isolate;
    position: relative;
}

/* Render effects on a stable canvas rather than native video layer */
.booth-screen #liveVideo {
    position: absolute;
    inset: 0;
    opacity: 0;
    filter: none !important;
    transform: none;
    pointer-events: none;
    transition: none;
}

.booth-screen #livePreviewCanvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* PANTALLA IDLE / ESPERA EDITORIAL */
.booth-screen .booth-idle {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 4;
    text-align: center;
    background: radial-gradient(ellipse at center, #161b2a 0%, #07080c 100%);
}

.booth-screen.camera-running .booth-idle {
    display: none;
}

.booth-screen .booth-lens {
    width: 96px;
    height: 96px;
    border: 1px solid rgba(229, 193, 123, 0.35);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at center, rgba(229, 193, 123, 0.08) 0%, rgba(14, 17, 26, 0.8) 70%);
    box-shadow: 0 0 35px rgba(229, 193, 123, 0.15), inset 0 0 20px rgba(229, 193, 123, 0.1);
    margin-bottom: 24px;
    animation: lensBreathe 4s ease-in-out infinite;
}

@keyframes lensBreathe {
    0%, 100% {
        box-shadow: 0 0 25px rgba(229, 193, 123, 0.15), inset 0 0 15px rgba(229, 193, 123, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 45px rgba(229, 193, 123, 0.35), inset 0 0 25px rgba(229, 193, 123, 0.2);
        transform: scale(1.03);
    }
}

.booth-screen .booth-lens span {
    width: 44px;
    height: 44px;
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    box-shadow: inset 0 0 0 10px rgba(229, 193, 123, 0.15), 0 0 15px rgba(229, 193, 123, 0.3);
}

.booth-screen .booth-idle-title {
    font-family: var(--font-serif);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 500;
    line-height: 1.1;
    background: linear-gradient(135deg, #ffffff 30%, #f7e7c4 75%, #e5c17b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.booth-screen .booth-idle p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    margin: 12px 0 24px;
    max-width: 440px;
    line-height: 1.5;
}

.booth-screen .booth-privacy {
    font-size: 11px;
    font-family: var(--font-brand);
    letter-spacing: 1.2px;
    color: rgba(229, 193, 123, 0.65);
    text-transform: uppercase;
    margin-top: 18px;
}

.booth-screen #btnLaunchCamera {
    width: auto;
    padding: 14px 28px;
    min-height: 50px;
    border-radius: 999px;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 2px;
    box-shadow: var(--glow-gold);
}

/* MARCAS DE ENCUADRE DE PRECISIÓN (LEICA / HASSELBLAD TICKS) */
.booth-screen .booth-viewfinder {
    position: absolute;
    inset: 20px;
    border-radius: 12px;
    pointer-events: none;
    z-index: 4;
    background: 
        /* Top-left bracket */
        linear-gradient(to right, #e5c17b 18px, transparent 18px) top left / 100% 2px no-repeat,
        linear-gradient(to bottom, #e5c17b 18px, transparent 18px) top left / 2px 100% no-repeat,
        /* Top-right bracket */
        linear-gradient(to left, #e5c17b 18px, transparent 18px) top right / 100% 2px no-repeat,
        linear-gradient(to bottom, #e5c17b 18px, transparent 18px) top right / 2px 100% no-repeat,
        /* Bottom-left bracket */
        linear-gradient(to right, #e5c17b 18px, transparent 18px) bottom left / 100% 2px no-repeat,
        linear-gradient(to top, #e5c17b 18px, transparent 18px) bottom left / 2px 100% no-repeat,
        /* Bottom-right bracket */
        linear-gradient(to left, #e5c17b 18px, transparent 18px) bottom right / 100% 2px no-repeat,
        linear-gradient(to top, #e5c17b 18px, transparent 18px) bottom right / 2px 100% no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* BARRA DE ESTADO EN VIVO */
.booth-screen .live-status-bar {
    z-index: 5;
    top: 16px;
}

.booth-screen:not(.camera-running) .live-status-bar {
    display: none;
}

.booth-screen .live-status-badge {
    background: rgba(8, 10, 16, 0.82);
    border: 1px solid var(--card-border);
    color: var(--gold-primary);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.booth-screen .btn-pro-toggle {
    background: rgba(8, 10, 16, 0.82);
    border: 1px solid var(--card-border);
    color: var(--gold-primary);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.booth-screen .live-filter-chips {
    display: none;
}

/* BARRA DE CONTROLES INFERIOR */
.booth-screen .live-controls {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: rgba(10, 12, 18, 0.96);
    border-top: 1px solid var(--subtle-border);
}

/* BOTÓN DE DISPARO DUAL CONCÉNTRICO DE ALTA GAMA */
.booth-screen #btnSnapLive {
    position: relative;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    min-height: 80px;
    flex: none;
    padding: 0;
    border: 3px solid rgba(229, 193, 123, 0.35);
    background: transparent;
    outline: none;
    box-shadow: 0 0 25px rgba(229, 193, 123, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.booth-screen #btnSnapLive::before {
    content: '';
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7e7c4 0%, #e5c17b 50%, #caa45d 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 2px 2px rgba(255, 255, 255, 0.6);
    transition: all 0.15s ease;
}

.booth-screen #btnSnapLive:hover {
    border-color: rgba(229, 193, 123, 0.7);
    box-shadow: 0 0 35px rgba(229, 193, 123, 0.45);
    transform: scale(1.04);
}

.booth-screen #btnSnapLive:active {
    transform: scale(0.93);
    border-color: var(--gold-primary);
}

.booth-screen #btnSnapLive:active::before {
    transform: scale(0.90);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.booth-screen #btnSnapLive svg {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    stroke: #07080c;
}

.booth-screen #btnSnapLive span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.booth-screen #btnSnapLive:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.booth-screen #btnCloseLiveCamera {
    min-height: 42px;
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--subtle-border);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-brand);
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.booth-screen #btnCloseLiveCamera:hover {
    border-color: rgba(229, 193, 123, 0.4);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.booth-screen:not(.camera-running) #btnCloseLiveCamera {
    visibility: hidden;
}

.booth-screen #btnFlipLiveCamera {
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(229, 193, 123, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.booth-screen #btnFlipLiveCamera:hover {
    background: rgba(229, 193, 123, 0.2);
    border-color: var(--gold-primary);
    transform: rotate(45deg);
}

.booth-screen:not(.camera-running) #btnFlipLiveCamera {
    visibility: hidden;
}

.booth-screen .pro-controls-drawer {
    max-height: 220px;
    overflow: auto;
    background: rgba(10, 12, 18, 0.98);
    border-top: 1px solid var(--card-border);
}

.booth-screen .btn-gallery-trigger {
    width: 100%;
    border: 1px dashed rgba(229, 193, 123, 0.3);
    border-radius: 14px;
    text-decoration: none;
    padding: 14px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.booth-screen .btn-gallery-trigger:hover {
    background: rgba(229, 193, 123, 0.08);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.booth-screen .result-box,
.booth-screen .analyzing-box {
    max-width: 620px;
    margin: 0 auto;
}

.booth-screen .reto-footer {
    margin: 0;
    padding-top: 0;
}

/* RESPONSIVE LAYOUTS */
@media (min-width: 1000px) {
    .booth-screen .reto-wrapper {
        height: 100dvh;
    }
    .booth-screen .filter-bar {
        max-height: calc(100dvh - 300px);
        overflow-y: auto;
        padding-right: 6px;
    }
}

@media (max-width: 768px) {
    .booth-screen .reto-wrapper {
        min-height: 100dvh;
        height: auto;
        padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        gap: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .booth-screen .photobooth-top-nav {
        padding-bottom: 8px;
        min-height: 44px;
        gap: 8px;
    }

    .booth-screen .nav-brand-text {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .booth-screen .nav-brand-lockup {
        left: 50%;
        transform: translateX(-50%);
    }

    .booth-screen .nav-brand-icon {
        display: none !important;
    }

    .booth-screen .nav-back-link {
        font-size: 10px;
    }

    .booth-screen .reto-card {
        padding: 0;
        width: 100%;
        overflow: visible;
    }

    /* PANTALLA 1: Flujo limpio en columna natural para móviles */
    .booth-screen #stepChallenge {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .booth-screen #stepChallenge > :not(.live-camera-modal) {
        grid-column: auto;
    }

    .booth-screen .mode-tabs {
        margin: 0;
        width: 100%;
    }

    .booth-screen .mode-tab-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.74rem;
    }

    .booth-screen .live-camera-modal {
        position: relative;
        width: 100%;
        padding: 0;
        grid-column: auto;
        grid-row: auto;
    }

    .booth-screen .live-camera-content {
        border-radius: 20px;
        width: 100%;
    }

    .booth-screen .live-video-box {
        width: 100%;
        height: clamp(260px, 48dvh, 480px);
        border-radius: 20px 20px 0 0;
        position: relative;
    }

    /* Pantalla Idle dentro del viewfinder móvil */
    .booth-screen .booth-idle {
        padding: 16px 12px;
        gap: 6px;
    }

    .booth-screen .booth-lens {
        width: 58px;
        height: 58px;
        margin-bottom: 6px;
    }

    .booth-screen .booth-lens span {
        width: 28px;
        height: 28px;
    }

    .booth-screen .booth-idle-title {
        font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    }

    .booth-screen .booth-idle p {
        margin: 4px 0 10px;
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .booth-screen #btnLaunchCamera {
        padding: 12px 24px;
        min-height: 46px;
        font-size: 0.78rem;
    }

    .booth-screen .booth-privacy {
        margin-top: 8px;
        font-size: 10px;
    }

    /* Filtros rápidos Canon G7X en vivo dentro de la cámara */
    .booth-screen.camera-running .live-filter-chips {
        display: flex !important;
        overflow-x: auto;
        padding: 8px 10px;
        gap: 6px;
        background: rgba(10, 12, 18, 0.98);
        border-top: 1px solid rgba(229, 193, 123, 0.15);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .booth-screen.camera-running .live-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .booth-screen.camera-running .canon-chip-btn {
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 0.72rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: #ffffff;
        white-space: nowrap;
    }

    .booth-screen.camera-running .canon-chip-btn.active {
        background: rgba(229, 193, 123, 0.25);
        border-color: var(--gold-primary);
        color: var(--gold-primary);
    }

    .booth-screen.camera-running .filter-section {
        display: none; /* Ocultar barra exterior cuando la cámara está activa para dar foco al visor */
    }

    /* Barra de disparo y controles */
    .booth-screen .live-controls {
        padding: 12px 16px;
        gap: 18px;
        background: rgba(10, 12, 18, 0.98);
        border-radius: 0 0 20px 20px;
    }

    .booth-screen #btnSnapLive {
        width: 70px;
        height: 70px;
        min-height: 70px;
    }

    .booth-screen #btnSnapLive::before {
        width: 54px;
        height: 54px;
    }

    .booth-screen #btnCloseLiveCamera {
        min-height: 38px;
        padding: 8px 16px;
        font-size: 0.72rem;
    }

    .booth-screen #btnFlipLiveCamera {
        width: 42px;
        height: 42px;
        min-height: 42px;
    }

    /* Filtros estándar cuando la cámara está en espera */
    .booth-screen .filter-section {
        margin: 0;
        width: 100%;
    }

    .booth-screen .filter-header {
        margin-bottom: 6px;
    }

    .booth-screen .filter-bar {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .booth-screen .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .booth-screen .filter-pill {
        flex-shrink: 0;
        min-height: 38px;
        padding: 8px 14px;
        font-size: 0.76rem;
        white-space: nowrap;
    }

    /* PANTALLA 3: RESULTADO, STICKERS Y COMPARTIR */
    .booth-screen .result-box {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        padding: 0 4px;
    }

    .booth-screen .theme-selector-preview {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding: 4px 2px 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        width: 100%;
    }

    .booth-screen .theme-selector-preview::-webkit-scrollbar {
        display: none;
    }

    .booth-screen .theme-pill-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 0.68rem;
    }

    .booth-screen .canvas-preview-container {
        width: 100%;
        max-width: 100%;
        border-radius: 14px;
        overflow: hidden;
        margin-bottom: 14px;
    }

    .booth-screen .stickers-panel {
        background: rgba(14, 17, 26, 0.95);
        border: 1px solid var(--card-border);
        border-radius: 16px;
        padding: 12px 10px;
        margin-bottom: 14px;
    }

    .booth-screen .stickers-cat-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .booth-screen .stickers-cat-tabs::-webkit-scrollbar {
        display: none;
    }

    .booth-screen .stickers-cat-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 5px 10px;
        font-size: 0.70rem;
    }

    .booth-screen .stickers-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
        gap: 6px;
        max-height: 125px;
        overflow-y: auto;
        padding: 4px 0;
    }

    .booth-screen .sticker-chip {
        padding: 6px;
        min-height: 50px;
    }

    .booth-screen .action-buttons-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    .booth-screen .input-guest-name,
    .booth-screen .input-guest-message {
        font-size: 16px !important; /* Evita zoom automático en Safari iOS */
        width: 100%;
        box-sizing: border-box;
    }

    .booth-screen .wa-audience-card {
        padding: 14px 12px;
        margin: 14px 0;
        border-radius: 14px;
    }
}

@media (max-width: 480px) {
    .booth-screen .action-buttons-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .booth-screen .btn-download,
    .booth-screen .btn-send-event {
        width: 100%;
        min-height: 48px;
        font-size: 0.78rem;
    }

    .booth-screen .criteria-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .booth-screen .nav-brand-text {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .booth-screen .nav-brand-lockup {
        left: 50%;
        transform: translateX(-50%);
    }
}
