/* --- VARIABEL WARNA HOLOGRAFIK MODERN --- */
:root {
    --holo-cyan: #00f3ff;
    --holo-blue: #0077ff;
    --holo-dark: rgba(10, 25, 47, 0.7);
    --text-light: #e6f1ff;
    --radius-pill: 50px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #000; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh; 
    width: 100vw;
    overflow: hidden; 
    user-select: none; 
}

/* --- LAPISAN AVATAR --- */
.avatar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#avatar-video, .avatar-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    background: radial-gradient(circle at center, #112240 0%, #020c1b 100%);
}

/* --- KONTINER UTAMA (Holografik UI) --- */
.hologram-ui {
    width: 100%;
    max-width: 1080px; 
    height: 100%; 
    position: relative; 
    z-index: 2;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 40%, rgba(0,0,0,0.9) 100%);
}

/* ========================================== */
/* --- HEADER & LOGO --- */
/* ========================================== */
.top-bar {
    padding: 20px 25px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    flex-shrink: 0; 
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: relative; 
    z-index: 10;
}

.logo-header-left {
    height: 40px; 
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.4)); 
}

.btn-refresh-right {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--holo-dark);
    border: 1px solid var(--holo-cyan);
    color: var(--holo-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,243,255,0.1);
    transition: all 0.3s ease;
}

.btn-refresh-right svg {
    width: 22px;
    height: 22px;
    transition: transform 0.4s ease;
}

.btn-refresh-right:active {
    background: var(--holo-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--holo-cyan);
}

.btn-refresh-right:active svg {
    transform: rotate(180deg); 
}

/* ========================================== */
/* --- AREA OBROLAN --- */
/* ========================================== */
.holo-chat {
    flex: 1 1 0; 
    height: 0; 
    padding: 20px;
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    gap: 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.holo-chat::before {
    content: "";
    flex: 1 1 auto;
}

.holo-chat::-webkit-scrollbar {
    display: none; 
}

.message {
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 85%;
    font-size: 1.15rem;
    line-height: 1.5;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,243,255,0.3);
    flex-shrink: 0; 
}

.mira-msg {
    background: rgba(0, 30, 60, 0.6);
    color: var(--holo-cyan);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 0 15px rgba(0,243,255,0.1);
}

.user-msg {
    background: rgba(0, 119, 255, 0.6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    border-color: var(--holo-blue);
}

/* ========================================== */
/* --- ZONA INTERAKSI BAWAH --- */
/* ========================================== */
.interaction-zone {
    padding: 15px 20px 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0; 
    width: 100%;
}

.quick-actions {
    display: flex;
    gap: 12px;
    padding: 5px 0;
    flex-wrap: nowrap; 
    overflow-x: auto;  
    justify-content: flex-start; 
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.quick-actions::-webkit-scrollbar {
    display: none;
}

.btn-holo {
    background: var(--holo-dark);
    border: 1px solid var(--holo-cyan);
    color: var(--holo-cyan);
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-size: 1.05rem;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0,243,255,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; 
    white-space: nowrap; 
}

.btn-holo:active {
    background: var(--holo-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--holo-cyan);
}

/* --- PUSAT KONTROL SUARA --- */
.voice-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.btn-mic-glow {
    width: 76px;
    height: 76px;
    min-width: 76px;
    min-height: 76px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--holo-cyan);
    color: var(--holo-cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0,243,255,0.3), inset 0 0 20px rgba(0,243,255,0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-mic-glow svg {
    width: 32px;
    height: 32px;
}

.btn-mic-glow.listening {
    background: rgba(0, 243, 255, 0.2);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 40px var(--holo-cyan), inset 0 0 40px var(--holo-cyan);
    animation: pulseMic 1.5s infinite;
}

.soundwave {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 35px;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.soundwave.active {
    opacity: 1;
}

.bar {
    width: 5px;
    background: var(--holo-cyan);
    border-radius: 3px;
    height: 8px;
    transition: height 0.1s;
    box-shadow: 0 0 8px var(--holo-cyan);
}

.soundwave.active .bar {
    animation: eq 1s ease-in-out infinite alternate;
}

.soundwave.active .bar:nth-child(1) { animation-delay: 0.1s; }
.soundwave.active .bar:nth-child(2) { animation-delay: 0.4s; }
.soundwave.active .bar:nth-child(3) { animation-delay: 0.2s; }

@keyframes pulseMic { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.05); } 
    100% { transform: scale(1); } 
}

@keyframes eq { 
    0% { height: 8px; } 
    100% { height: 35px; } 
}

/* Sembunyikan elemen input teks lama */
.input-text, #btn-send, .simple-keyboard {
    display: none !important;
}

/* ========================================== */
/* --- TAMPILAN GAME PSIKOLOGI --- */
/* ========================================== */
.game-ui {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 15, 30, 0.85); 
    backdrop-filter: blur(10px);
    z-index: 5;
    animation: fadeIn 0.5s ease;
}

.game-ui h2 {
    color: gold;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.game-choices {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 20px;
}

.choice-box {
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    border-radius: 20px;
    border: 3px solid var(--holo-cyan);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(0, 243, 255, 0.1);
    transition: all 0.3s ease;
}

.choice-box.highlight {
    background: var(--holo-cyan);
    color: black;
    transform: scale(1.1);
    box-shadow: 0 0 40px var(--holo-cyan);
}

.game-progress {
    width: 80%;
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    margin-top: 40px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: gold;
    transition: width 0.1s linear;
}

.game-instruction {
    color: var(--text-light);
    margin-top: 20px;
    font-size: 1.1rem;
    animation: pulseMic 2s infinite;
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

/* ========================================== */
/* --- WELCOME OVERLAY (POPUP NAMA TAMU) --- */
/* ========================================== */
.welcome-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 15, 30, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 100; 
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
    padding: 20px; 
}

.welcome-box {
    background: linear-gradient(145deg, rgba(10, 25, 47, 0.9) 0%, rgba(2, 12, 27, 0.9) 100%);
    border: 2px solid var(--holo-cyan);
    padding: 35px 25px; 
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.2), inset 0 0 20px rgba(0, 243, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-box h2 {
    color: var(--holo-cyan);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.welcome-box p {
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 1.05rem;
}

.welcome-box .sub-msg {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: row; 
    gap: 10px;
    width: 100%;
    justify-content: center;
}

#guest-name, #wa-number {
    flex: 1;
    width: 100%;
    min-width: 0; /* KUNCI FIX: Mencegah input membludak keluar form */
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 2px solid rgba(0, 243, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.1rem;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
}

#guest-name:focus {
    border-color: var(--holo-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

/* KHUSUS UNTUK FOCUS WA NUMBER (Warna Hijau) */
#wa-number:focus {
    border-color: #25D366 !important;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
}
@media (max-width: 400px) {
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #btn-start-session {
        justify-content: center;
        width: 100%;
    }
}

/* ========================================== */
/* --- TAMPILAN CAROUSEL PROYEK WHATSAPP --- */
/* ========================================== */
.carousel-wrapper {
    display: flex;
    gap: 15px;
    padding: 10px 0 20px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
    width: 100%;
    scroll-behavior: smooth;
    /* KUNCI FIX ANTI-GEPENG: */
    flex-shrink: 0; 
    min-height: 300px;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 250px;
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid rgba(0, 243, 255, 0.4);
    border-radius: 15px;
    overflow: hidden;
    scroll-snap-align: start;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.carousel-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #000;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

.carousel-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.carousel-title {
    color: var(--holo-cyan);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.carousel-desc {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
    margin-bottom: 15px;
}

.btn-carousel-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid #25D366;
    color: #25D366;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-carousel-wa:active {
    background: #25D366;
    color: #000;
}