/**
 * Novay AI — Holographic Voice Button System
 * Touch-optimized interactive button for 86" Holobox
 */

.holo-voice-controller {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 65;
}

/* Outer Aura Ripple */
.holo-btn-aura {
    display: none !important;
}

/* The Main Interactive Button Pill */
.holo-voice-btn {
    position: relative;
    z-index: 10;
    min-width: 340px;
    height: 78px;
    padding: 0 2.2rem;
    border-radius: 45px;
    background: linear-gradient(135deg, rgba(20, 5, 45, 0.92) 0%, rgba(10, 2, 25, 0.96) 100%);
    border: 2px solid rgba(198, 169, 254, 0.45);
    color: #ffffff;
    font-family: var(--font-tajawal);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.65),
        0 0 30px rgba(122, 0, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
}

.holo-voice-btn:hover {
    transform: none !important;
    border-color: rgba(198, 169, 254, 0.45) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

.holo-voice-btn:active {
    transform: none !important;
}

/* Icon Container */
.btn-icon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--holo-purple), var(--holo-purple-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(122, 0, 255, 0.6);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.btn-icon-wrapper svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

/* Button Status Text & Subtitle */
.btn-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    line-height: 1.25;
}

.btn-main-label {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    transition: color 0.3s ease;
}

.btn-sub-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--holo-lavender);
    opacity: 0.85;
}

/* Audio Wave Visualizer Bars */
.audio-wave-bars {
    display: none;
    align-items: center;
    gap: 4px;
    height: 28px;
    margin-right: 0.5rem;
}

.wave-bar {
    width: 4px;
    height: 100%;
    background: var(--holo-neon-lime);
    border-radius: 3px;
    animation: wave-bar-pulse 0.9s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) { height: 35%; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 75%; animation-delay: 0.3s; }
.wave-bar:nth-child(3) { height: 100%; animation-delay: 0.15s; }
.wave-bar:nth-child(4) { height: 60%; animation-delay: 0.4s; }
.wave-bar:nth-child(5) { height: 40%; animation-delay: 0.25s; }

@keyframes wave-bar-pulse {
    0% { transform: scaleY(0.3); opacity: 0.5; }
    100% { transform: scaleY(1.1); opacity: 1; }
}

/* ========================================================
   DYNAMIC STATES (IDLE, CONNECTING, LISTENING, SPEAKING)
======================================================== */

/* 1. STATE: CONNECTING */
.holo-voice-controller.state-connecting .holo-voice-btn {
    border-color: var(--holo-lavender);
    box-shadow: 0 0 40px rgba(198, 169, 254, 0.4);
}
.holo-voice-controller.state-connecting .btn-icon-wrapper {
    background: rgba(255, 255, 255, 0.1);
    animation: spin-pulse 1.2s linear infinite;
}
@keyframes spin-pulse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 2. STATE: LISTENING (USER SPEAKING) */
.holo-voice-controller.state-listening .holo-voice-btn {
    background: linear-gradient(135deg, rgba(6, 45, 30, 0.94) 0%, rgba(2, 25, 18, 0.98) 100%);
    border-color: var(--holo-emerald);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(16, 185, 129, 0.3);
}
.holo-voice-controller.state-listening .btn-icon-wrapper {
    background: var(--holo-emerald);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.8);
}
.holo-voice-controller.state-listening .btn-main-label {
    color: #4EFEB3;
}
.holo-voice-controller.state-listening .audio-wave-bars {
    display: inline-flex;
}
.holo-voice-controller.state-listening .audio-wave-bars .wave-bar {
    background: #4EFEB3;
}
.holo-voice-controller.state-listening .holo-btn-aura {
    background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
}

/* 3. STATE: SPEAKING (NOUR RESPONDING) */
.holo-voice-controller.state-speaking .holo-voice-btn {
    background: linear-gradient(135deg, rgba(40, 6, 80, 0.94) 0%, rgba(20, 2, 45, 0.98) 100%);
    border-color: var(--holo-neon-lime);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.7),
        0 0 55px rgba(204, 255, 0, 0.45),
        inset 0 1px 0 rgba(204, 255, 0, 0.3);
}
.holo-voice-controller.state-speaking .btn-icon-wrapper {
    background: var(--holo-neon-lime);
    color: #080214;
    box-shadow: 0 0 30px rgba(204, 255, 0, 0.8);
}
.holo-voice-controller.state-speaking .btn-main-label {
    color: var(--holo-neon-lime);
}
.holo-voice-controller.state-speaking .audio-wave-bars {
    display: inline-flex;
}
.holo-voice-controller.state-speaking .audio-wave-bars .wave-bar {
    background: var(--holo-neon-lime);
}
.holo-voice-controller.state-speaking .holo-btn-aura {
    background: radial-gradient(ellipse at center, rgba(204, 255, 0, 0.4) 0%, transparent 70%);
}

/* Active End Call Action Pill */
.holo-end-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(255, 77, 109, 0.15);
    border: 1px solid rgba(255, 77, 109, 0.35);
    color: #FF859B;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.holo-end-btn:hover {
    background: rgba(255, 77, 109, 0.25);
    border-color: #FF4D6D;
    color: #fff;
    transform: none !important;
    box-shadow: none !important;
}

.holo-voice-controller.is-active .holo-end-btn {
    display: inline-flex;
}

/* ========================================================
   4K DISPLAY SCALING (86-INCH VIEWPORT)
======================================================== */
@media (min-width: 1400px) and (min-height: 2000px) {
    .holo-voice-btn {
        min-width: 520px;
        height: 110px;
        padding: 0 3.2rem;
        border-radius: 60px;
        border-width: 3px;
        font-size: 1.75rem;
    }
    .btn-icon-wrapper {
        width: 68px;
        height: 68px;
    }
    .btn-icon-wrapper svg {
        width: 36px;
        height: 36px;
    }
    .btn-main-label {
        font-size: 1.75rem;
    }
    .btn-sub-label {
        font-size: 1.15rem;
    }
    .wave-bar {
        width: 6px;
    }
    .holo-end-btn {
        padding: 12px 28px;
        font-size: 1.25rem;
        border-radius: 30px;
    }
    .holo-btn-aura {
        width: 600px;
        height: 180px;
    }
}
