/* ==========================================================================
   Uber Gesture Booking - Custom Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Uber Move font
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Uber Move';
    src: url('Assets/Fonts/UberMoveJP-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Uber Move';
    src: url('Assets/Fonts/UberMoveJP-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Uber Move';
    src: url('Assets/Fonts/UberMoveJP-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* --------------------------------------------------------------------------
   Base & portrait layout
   -------------------------------------------------------------------------- */

body {
    overscroll-behavior: none;
    background-color: #000;
    font-family: 'Uber Move', sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Experience runs in a centered portrait column with empty side space */
#experience-wrapper {
    position: relative;
    width: 100%;
    max-width: min(430px, 100vw);
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
}

/* Rotate device overlay – show in landscape */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

#rotate-overlay.visible {
    display: flex;
}

#rotate-overlay svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

#rotate-overlay p {
    font-size: 1.25rem;
    color: #fff;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Camera loading overlay (no black screen)
   -------------------------------------------------------------------------- */

#camera-loading {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: #000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

#camera-loading.visible {
    display: flex;
}

#camera-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #4185F4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#camera-loading p {
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.1em;
}

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

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

@keyframes scan-line {
    0% {
        top: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

@keyframes float-badge {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.badge-float {
    animation: float-badge 2s ease-in-out infinite;
}

.promo-badge-hand {
    position: absolute;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    will-change: left, top;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.promo-badge-hand.badge-visible {
    opacity: 1;
}
.promo-badge-hand.hidden {
    opacity: 0;
}

/* ---------- Badge wipe-reveal (on hand) ---------- */
.badge-reveal-wrap {
    position: relative;
    width: 240px;
    height: 52px;
    border-radius: 26px;
    overflow: hidden;
}

.badge-reveal-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 26px;
    font-family: 'Uber Move', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    white-space: nowrap;
    user-select: none;
}

.badge-reveal-actual {
    z-index: 1;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 12px rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.95);
}

/* --------------------------------------------------------------------------
   Canvas & typography
   -------------------------------------------------------------------------- */

.canvas-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.font-superpower {
    font-family: 'Uber Move', sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 0.05em;
}

.scan-animation {
    animation: scan-line 2s linear infinite;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(61, 136, 231, 0.5),
        transparent
    );
}

/* --------------------------------------------------------------------------
   Speed warp overlay
   -------------------------------------------------------------------------- */

#speed-warp-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle,
        transparent 20%,
        rgba(122, 169, 244, 0.15) 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease-in;
    pointer-events: none;
    z-index: 25;
}

.warp-active {
    opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   Layout & transitions – angled diagonal split (top-left to bottom-right)
   -------------------------------------------------------------------------- */

/*
 * Initial: top-half full screen (camera only).
 * Split view: angled diagonal – top section (camera), bottom section (video).
 * Diagonal runs from ~(0, 38%) to (100%, 58%).
 */
#top-half {
    position: absolute;
    inset: 0;
    z-index: 10;
    background-color: #000;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transition:
        clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1),
        -webkit-clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: clip-path;
}

/* Angled split view: diagonal cut from bottom-left to top-right */
#top-half.split-view {
    clip-path: polygon(0 0, 100% 0, 100% 65%, 0 45%);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 65%, 0 45%);
}

#top-half.full-screen-mode {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/*
 * Bottom half (video): full area, clipped to diagonal wedge.
 * Initial: clipped to nothing (below fold). Split-view: visible in lower diagonal.
 */
#bottom-half {
    position: absolute;
    inset: 0;
    z-index: 0;
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    transition:
        clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1),
        -webkit-clip-path 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    will-change: clip-path;
}

#bottom-half.split-view {
    clip-path: polygon(0 45%, 100% 65%, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 45%, 100% 65%, 100% 100%, 0 100%);
}

#bottom-half.slide-out {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
}

/* Faster transition when video ends → badge to avoid black splash */
body.video-to-badge #top-half,
body.video-to-badge #bottom-half {
    transition-duration: 0.22s;
    -webkit-transition-duration: 0.22s;
}

/* Video loading overlay (hidden once video can play) */
.video-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease;
}
.video-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.video-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: video-load-spin 0.8s linear infinite;
}
@keyframes video-load-spin {
    to { transform: rotate(360deg); }
}

/* Cinematic LUT effect for the camera canvas */
.cinematic-lut {
    /* Mimics a moody, cinematic teal/orange style color grade */
    filter: contrast(1.15) saturate(1.2) brightness(0.95) sepia(0.2) hue-rotate(-10deg);
}

/* Teal/green colour effect on camera feed (matches particle glow) */
.camera-teal-overlay {
    background: linear-gradient(
        135deg,
        rgba(61, 136, 231, 0.08) 0%,
        rgba(61, 136, 231, 0.04) 50%,
        rgba(170, 255, 255, 0.06) 100%
    );
    mix-blend-mode: overlay;
}

/* --------------------------------------------------------------------------
   SVG divider line (only visible in split view)
   -------------------------------------------------------------------------- */

#split-line-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#split-line-svg.visible {
    opacity: 1;
}

.fade-out {
    opacity: 0 !important;
}

/* Grab hint icon – support image from Assets */
#grab-hint-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

#grab-hint-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

#grab-hint-icon.hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Success modal – Congratulations (reference layout)
   -------------------------------------------------------------------------- */

.success-modal-screen {
    background-color: #000000 !important;
    background: #000000 !important;
    font-family: 'Uber Move', sans-serif;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    min-height: 100dvh;
    will-change: transform;
}

.success-modal-inner {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.success-modal-title {
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    line-height: 1.2;
}

.success-modal-subtitle {
    font-weight: bold;
    font-size: 1.7rem;
    opacity: 0.95;
}

/* ---------- Promo wipe-reveal ---------- */
.promo-reveal-wrap {
    position: relative;
    width: 90%;
    max-width: 280px;
    height: 64px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 32px;
}

.promo-reveal-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 32px;
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
    user-select: none;
}

.promo-reveal-actual {
    z-index: 1;
    background: #000;
    border: 2px solid #4185F4;
    color: #7aa9f4;
}

.success-modal-cta {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.success-modal-validity {
    opacity: 0.9;
}

.success-modal-terms {
    min-height: 0;
}

.success-modal-terms-heading {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.success-modal-terms-scroll {
    flex: 1;
    min-height: 160px;
    -webkit-overflow-scrolling: touch;
}

.success-modal-terms-scroll::-webkit-scrollbar {
    width: 4px;
}

.success-modal-terms-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.success-modal-terms-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.success-modal-terms-text {
    padding-right: 4px;
    color: #b0b0b0;
    font-size: 0.66rem;
    line-height: 1.5;
}

.success-modal-logo {
    letter-spacing: 0.05em;
}
