/**
 * Novay AI — 86-inch Holobox Presentation System
 * ملتقى الذكاء الاصطناعي بالمدينة المنورة 2026 — MED Ai (نور)
 * 
 * Optimized for:
 * - 86" Vertical Hologram Box (2160x3840 4K UHD Portrait / 9:16 Aspect Ratio)
 * - Touch screen kiosks (PCAP / IR Multi-touch)
 * - Ultra-clean holographic presence (Zero chrome clutter, zero scrollbars)
 */

:root {
    --holo-bg-dark: #070212;
    --holo-purple-dark: #120429;
    --holo-purple: #7A00FF;
    --holo-purple-bright: #9B30FF;
    --holo-lavender: #C6A9FE;
    --holo-neon-lime: #CCFF00;
    --holo-emerald: #10B981;
    --holo-rose: #FF4D6D;
    --holo-cyan: #00F0FF;
    
    --text-pure: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.75);
    --text-dim: rgba(198, 169, 254, 0.6);

    --glass-bg: rgba(18, 4, 41, 0.65);
    --glass-border: rgba(198, 169, 254, 0.22);
    --glass-glow: rgba(122, 0, 255, 0.35);

    --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 CONTAINER (9:16 ENFORCED OR FULL SCREEN)
======================================================== */
.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 Background Variants */
.holobox-stage[data-variant="white"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #120429;
}

.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(106%) brightness(105%) !important;
    mix-blend-mode: multiply !important;
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

.holobox-stage[data-variant="cyberbox"] {
    background: radial-gradient(circle at 50% 40%, #1A0538 0%, #070114 75%, #030008 100%);
}

.holobox-stage[data-variant="studio"] {
    background: linear-gradient(180deg, #EDF7FD 0%, #EBF6FC 12%, #EBF6FC 85%, #D4DEE6 100%) !important;
    background-color: #EBF6FC !important;
    color: #120429;
}

.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: blends 9:16 frame edges into the stage background on wide/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;
}


/* ========================================================
   HOLOGRAPHIC AMBIENT GLOWS & 3D LIGHT BEAMS
======================================================== */
.ambient-holo-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(140px);
    z-index: 1;
    opacity: 0.45;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.glow-purple {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(122, 0, 255, 0.5) 0%, transparent 70%);
    top: 5%;
    right: -150px;
}

.glow-cyan {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.25) 0%, transparent 70%);
    bottom: 10%;
    left: -150px;
}

/* ========================================================
   TOP BRANDING HEADER (MINIMAL, ELEGANT EXHIBITION CHROME)
======================================================== */
.top-branding {
    position: relative;
    z-index: 50;
    width: calc(100% - 3rem);
    max-width: 980px;
    margin: 1.5rem auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--glass-glow);
    transition: all 0.3s ease;
}

.organizers-cluster {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-logo-item {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-medai {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.logo-mcit {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.logo-chamber {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.brand-divider {
    width: 1px;
    height: 30px;
    background: rgba(198, 169, 254, 0.25);
}

.tech-partner-cluster {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.partner-badge {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--holo-lavender);
    letter-spacing: 0.02em;
}

.logo-novay {
    height: 22px;
    width: auto;
    object-fit: contain;
}

/* ========================================================
   CENTRAL HOLOGRAM CHARACTER DISPLAY
======================================================== */
.hologram-stage-viewport {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
    pointer-events: none; /* Let touches pass to buttons */
}

.character-anchor {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
}

.hologram-figure,
.hologram-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
    transform-origin: bottom center;
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.holobox-stage[data-variant="white"] .hologram-figure,
.holobox-stage[data-variant="white"] .hologram-video {
    mix-blend-mode: multiply !important;
    filter: contrast(106%) brightness(105%) !important;
    box-shadow: none !important;
}

/* Speaking State */
.holobox-stage.is-speaking .hologram-figure,
.holobox-stage.is-speaking .hologram-video {
    animation: none !important;
    box-shadow: none !important;
}

/* Listening State */
.holobox-stage.is-listening .hologram-figure,
.holobox-stage.is-listening .hologram-video {
    animation: none !important;
    box-shadow: none !important;
}

/* ========================================================
   ERGONOMIC TOUCH BUTTON SECTION (BOTTOM 15-20%)
======================================================== */
.touch-interaction-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem 3rem;
    pointer-events: auto;
}

/* Quick Exhibition Controls (Permanently removed) */
.exhibition-quick-bar {
    display: none !important;
}

.exhibition-quick-bar:hover,
.exhibition-quick-bar:focus-within {
    opacity: 1;
}

.kiosk-btn-toggle {
    background: none;
    border: none;
    color: var(--holo-lavender);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kiosk-btn-toggle:hover,
.kiosk-btn-toggle.active {
    background: var(--holo-purple);
    color: #fff;
}

/* Hidden Kiosk Mode */
body.kiosk-locked .top-branding,
body.kiosk-locked .exhibition-quick-bar {
    display: none !important;
}

body.kiosk-locked .touch-interaction-zone {
    padding-bottom: 4rem;
}

/* ========================================================
   ELEVENLABS ULTRA-CONCEALMENT 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;
    clip-path: inset(100%) !important;
    z-index: -9999 !important;
}

/* Ensure no child spills out */
.elevenlabs-shadow-vault elevenlabs-convai {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ========================================================
   RESPONSIVE & FULLSCREEN OPTIMIZATIONS
======================================================== */
@media (min-width: 1400px) and (min-height: 2000px) {
    /* Dedicated 4K Vertical Holobox Scaling */
    .top-branding {
        padding: 1.4rem 2.5rem;
        margin-top: 2.5rem;
        border-radius: 32px;
    }
    .logo-medai { height: 68px; }
    .logo-mcit { height: 60px; }
    .logo-chamber { height: 60px; }
    .partner-badge { font-size: 1.25rem; }
    .logo-novay { height: 36px; }
    .touch-interaction-zone { padding-bottom: 6rem; }
}

@media (max-width: 768px) {
    .top-branding {
        width: calc(100% - 1.5rem);
        padding: 0.65rem 1rem;
        margin-top: 0.75rem;
    }
    .organizers-cluster { gap: 0.65rem; }
    .logo-medai { height: 28px; }
    .logo-mcit { height: 25px; }
    .logo-chamber { height: 25px; }
    .partner-badge { font-size: 0.72rem; }
    .logo-novay { height: 16px; }
}
