﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    height: 100vh;
    background: #eeeeee;
    color: #333;
}

.event-container {
    /*    height: 100%;
    display: flex;
    flex-direction: column;*/
    min-height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
}

/* TOP SECTION */
    .event-container .top {
        /*        flex: 1;
        background: #eeeeee;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10rem;
        text-align: center;*/
        background-color: rgba(238, 238, 238, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .event-container .top h1 {
            font-size: clamp(1.8rem, 5vw, 2.6rem);
            font-weight: 500;
            letter-spacing: 0.6px;
        }

/* BOTTOM SECTION */
    .event-container .bottom {
        flex: 1;
        background-color: rgba(238, 238, 238, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
        /*position: absolute;*/
        bottom: 0;
        width: 100%;
    }

        .event-container .bottom .details {
            max-width: 620px;
            text-align: center;
        }

            .event-container .bottom .details p {
                font-size: clamp(0.95rem, 3.5vw, 1.05rem);
                line-height: 1.6;
                margin-bottom: 1.4rem;
            }

            .event-container .bottom .details .info {
                font-size: 0.9rem;
                color: #555;
                margin-bottom: 1rem;
            }

                .event-container .bottom .details .info span {
                    display: block;
                    margin-top: 0.4rem;
                }

/* ENTER BUTTON */
            .event-container .bottom .details .enter-btn {
                display: inline-block;
                padding: 0.9rem 3rem;
                font-size: 0.95rem;
                letter-spacing: 1.5px;
                text-transform: uppercase;
                background: #333;
                color: #fff;
                text-decoration: none;
                border-radius: 30px;
                transition: all 0.25s ease;
            }

                .event-container .bottom .details .enter-btn:hover {
                    background: #000;
                    transform: translateY(-2px);
                }

                .event-container .bottom .details .enter-btn:active {
                    transform: translateY(0);
                }

/* MOBILE OPTIMIZATION */
@media (max-width: 600px) {
    .event-container .top {
        padding:1rem;
    }

    .event-container .bottom {
        padding: 1.5rem 1rem;
        /*position: absolute;*/
        bottom: 0;
        width: 100%;
    }

        .event-container .bottom .details {
            width: 100%;
            text-align: center;
        }

    .event-container .bottom .details p {
        margin-bottom: 0.5rem;
    }

    .event-container .bottom .details .enter-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Fullscreen overlay */
#preview-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(102, 102, 102, 0.85); /* #666 with transparency */

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Close button (top-right) */
#video-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
}

/* Centered video */
/*.video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video, #snapshot {
    width: 100%;
    max-width: 420px;
    max-height: 70vh;
    border-radius: 12px;
    background: #000;
    position:absolute;
}*/

.preview-btn-success {
    color: #fff !important;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.preview-btn-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Capture button at bottom */
.event-overlay-button {
    margin: 24px 0;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 24px;
    border: none;
    background: #fff;
    color: #000;
    cursor: pointer;
}

    .event-overlay-button:disabled,
    .event-overlay-button[disabled],
    .enter-btn[disabled] {
        cursor: not-allowed;
        background: #d0d0d0 !important;
        color: #888 !important;
    }

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 3 / 4; /* good for face capture */
    overflow: hidden;
    border-radius: 12px;
}

    /* Video fills container */
    .video-wrapper video, #snapshot {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
    }

/* Overlay covers the video */
.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none; /* allow clicks through */
}

/* The scanning line */
.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient( to right, transparent, #00ff66, transparent );
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.8);
    animation: scanMove 2.5s ease-in-out infinite;
}

/* Animation */
@keyframes scanMove {
    0% {
        top: 5%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    50% {
        top: 95%;
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 5%;
        opacity: 0;
    }
}

/* Horizontal snap gallery */
.horizontal-gallery {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 12px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* Thumbnails */
.user-picture-thmb {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    scroll-snap-align: start;
    position:relative;
}

/* Preview modal */
.preview-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preview-image {
    width: 90vw;
    border-radius: 12px;
    position:fixed;
}

/* Template Thumbnails */
.user-template-thmb {
    flex: 0 0 100%;
    background-size: contain;
    background-position: center;
    border-radius: 8px;
    scroll-snap-align: start;
    height: 400px;
    width: 100%;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position:relative;
}

.user-template-thmb-fg {
    width: 100%;
    height: 100%;
    position: absolute;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.overlay-mask {
    background: rgba(0, 0, 0, 0.75);
    position: fixed;
    inset: 0;
}

.preview-button-container {
    position: fixed;
    bottom: 25px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-evenly; /* equal spacing */
    align-items: center;
    padding: 0 16px;
    box-sizing: border-box;
}

.no-template-item {
    background-color: #dedede;
    height: 300px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

    .no-template-item p {
        font-size: clamp(16px, 5vw, 40px);
    }

.user-picture-thmb-index {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 70px;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
}

.border-rect {
    background-color: #cecece;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#userPictureDownload {
    width:unset;
    padding:0.9rem 1.5rem;
    margin-right:10px;
}

#userPictureNext {
    width: unset;
}

/* Overlay */
.photo-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
    font-family: system-ui, sans-serif;
    transition: opacity 0.25s ease;
}

    .photo-loader.hidden {
        opacity: 0;
        pointer-events: none;
    }

/* Camera Spinner */
.camera-spinner {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

    .camera-spinner::before {
        content: "";
        position: absolute;
        top: -8px;
        left: 18px;
        width: 20px;
        height: 8px;
        background: #222;
        border-radius: 2px;
    }

/* Lens */
.lens {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid #888;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

/* Text */
.photo-loader p {
    font-size: 14px;
    opacity: 0.85;
    letter-spacing: 0.5px;
}

/* Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.container-gallery {
    width: calc(100vw - 2rem);
}

div#swal2-content {
    white-space: pre-line;
}

.swal2-confirm {
    margin-right:10px;
}

.event-root-bg-image {
    background-image: none;
    background-size: cover;
    background-position: center;
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50; /* above the video + overlays */
    pointer-events: none; /* so it doesn't block clicks */
}

.countdown-number {
    font-size: 128px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 8px 24px rgba(0,0,0,0.6);
    transform: translateZ(0);
}