/**
 * Novay AI — 86-inch Holobox Presentation System for Dearson (ديرسن)
 * الزي الموحد منذ 1978 — المدينة المنورة
 * 
 * Optimized for:
 * - 86" Vertical Hologram Box (2160x3840 4K UHD Portrait / 9:16 Aspect Ratio)
 * - Touch screen kiosks (PCAP / IR Multi-touch)
 * - Zero chrome clutter, pure holographic presence
 * - Dearson Brand Palette: Signature Red (#ED2024 / #D32F2F), Pure White (#FFFFFF), Modern Graphite (#120429 / #1E1E1E)
 */

:root {
    --holo-bg-dark: #0a0104;
    --dearson-red: #ED2024;
    --dearson-red-bright: #FF2E36;
    --dearson-red-dark: #B31317;
    --dearson-red-glow: rgba(237, 32, 36, 0.5);
    --dearson-red-subtle: rgba(237, 32, 36, 0.15);
    
    --holo-emerald: #10B981;
    --holo-emerald-glow: rgba(16, 185, 129, 0.5);
    --holo-amber: #F59E0B;
    --holo-cyan: #00F0FF;

    /* Measured Studio Background Palette for seamless edge blending */
    --studio-bg-top: #D5E3EC;
    --studio-bg-mid: #EBF5FE;
    --studio-bg-bottom: #D5DEE5;
    
    --text-pure: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.85);
    --text-dark: #1A1A1A;
    --text-dim: rgba(255, 255, 255, 0.65);

    --font-tajawal: 'Tajawal', system-ui, -apple-system, sans-serif;
}

/* ========================================================
   GLOBAL KIOSK RESET (NO SCROLL, NO SELECTION)
======================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--holo-bg-dark);
    color: var(--text-pure);
    font-family: var(--font-tajawal);
    direction: rtl;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* ========================================================
   HOLOBOX ROOT STAGE CONTAINER
======================================================== */
.holobox-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    background-color: var(--holo-bg-dark);
    transition: background-color 0.5s ease;
}

/* ========================================================
   THEME VARIANTS (STUDIO, WHITE, CYBERBOX)
======================================================== */

/* 1. STUDIO VARIANT: Seamless Edge Blending into Background */
.holobox-stage[data-variant="studio"] {
    background: radial-gradient(circle at 50% 35%, var(--studio-bg-mid) 0%, var(--studio-bg-top) 70%, #6e767a 100%) !important;
    background-color: var(--studio-bg-mid) !important;
    color: var(--text-dark);
}

.holobox-stage[data-variant="studio"] .ambient-holo-glow {
    display: none !important;
}

.holobox-stage[data-variant="studio"] .character-anchor,
.holobox-stage[data-variant="studio"] .hologram-figure,
.holobox-stage[data-variant="studio"] .hologram-video,
.holobox-stage[data-variant="studio"].is-speaking .hologram-figure,
.holobox-stage[data-variant="studio"].is-speaking .hologram-video,
.holobox-stage[data-variant="studio"].is-listening .hologram-figure,
.holobox-stage[data-variant="studio"].is-listening .hologram-video {
    box-shadow: none !important;
    filter: none !important;
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* Seamless edge feathering: dissolves 9:16 frame edges into stage background on desktop screens */
.holobox-stage[data-variant="studio"] .hologram-figure,
.holobox-stage[data-variant="studio"] .hologram-video {
    -webkit-mask-image: 
        linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.2) 1.5%, rgba(0, 0, 0, 0.8) 4%, black 7%, black 93%, rgba(0, 0, 0, 0.8) 96%, rgba(0, 0, 0, 0.2) 98.5%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 1%, black 3.5%, black 97.5%, rgba(0, 0, 0, 0.5) 99%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: 
        linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.2) 1.5%, rgba(0, 0, 0, 0.8) 4%, black 7%, black 93%, rgba(0, 0, 0, 0.8) 96%, rgba(0, 0, 0, 0.2) 98.5%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 1%, black 3.5%, black 97.5%, rgba(0, 0, 0, 0.5) 99%, transparent 100%);
    mask-composite: intersect;
}

/* 2. PURE WHITE VARIANT */
.holobox-stage[data-variant="white"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: var(--text-dark);
}

.holobox-stage[data-variant="white"] .ambient-holo-glow {
    display: none !important;
}

.holobox-stage[data-variant="white"] .character-anchor,
.holobox-stage[data-variant="white"] .hologram-figure,
.holobox-stage[data-variant="white"] .hologram-video,
.holobox-stage[data-variant="white"].is-speaking .hologram-figure,
.holobox-stage[data-variant="white"].is-speaking .hologram-video,
.holobox-stage[data-variant="white"].is-listening .hologram-figure,
.holobox-stage[data-variant="white"].is-listening .hologram-video {
    box-shadow: none !important;
    filter: contrast(105%) brightness(102%) !important;
    mix-blend-mode: multiply !important;
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* 3. CYBERBOX 3D VARIANT */
.holobox-stage[data-variant="cyberbox"] {
    background: radial-gradient(circle at 50% 40%, #2A050B 0%, #0F0104 70%, #050002 100%);
}

/* ========================================================
   HOLOGRAPHIC AMBIENT GLOWS (CYBERBOX)
======================================================== */
.ambient-holo-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
    opacity: 0.35;
    z-index: 1;
    transition: all 0.8s ease;
}

.glow-red {
    top: 25%;
    left: 20%;
    width: 60vw;
    height: 55vh;
    background: radial-gradient(circle, var(--dearson-red) 0%, transparent 70%);
}

.glow-white {
    bottom: 10%;
    right: 25%;
    width: 45vw;
    height: 45vh;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    opacity: 0.2;
}

/* Active State Pulsing Glows */
.holobox-stage.is-speaking .glow-red {
    opacity: 0.55;
    transform: scale(1.1);
    filter: blur(140px);
}

.holobox-stage.is-listening .glow-white {
    opacity: 0.4;
    transform: scale(1.15);
}

/* ========================================================
   CENTRAL HOLOGRAM STAGE VIEWPORT
======================================================== */
.hologram-stage-viewport {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
}

.character-anchor {
    position: relative;
    height: 100%;
    aspect-ratio: 9 / 16;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hologram-figure {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    pointer-events: none;
    will-change: transform, opacity;
}

.hologram-video {
    z-index: 5;
}

/* Kiosk lock class */
body.kiosk-locked {
    cursor: none !important;
}

body.kiosk-locked .holo-brand-controller {
    opacity: 0.85;
}

/* Hide ElevenLabs Container */
.elevenlabs-shadow-vault {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    z-index: -9999 !important;
}

