/**
 * Novay AI — Holographic Circular Voice Button System for Al-Madinah Region Municipality
 * Ergonomically positioned at shoulder-level for 86" Holobox Touch Kiosks
 *
 * - Single compact circular launcher
 * - Luminous emerald teal glow & breathing state auras
 * - Instant touch/click toggle & acoustic soundwave visual feedback
 * - Al-Madinah Region Municipality Brand Identity Palette (#007366 / #40968D / #6CBE4A)
 */

.holo-voice-controller {
    position: absolute;
    top: 28.5%;
    /* Viewer's LEFT side — pushed cleanly outward away from torso */
    left: 2.5% !important;
    right: auto !important;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================
   THE COMPACT CIRCULAR VOICE BUTTON
======================================================== */
.holo-circle-btn {
    position: relative;
    z-index: 10;
    width: clamp(44px, 6.2vh, 72px);
    height: clamp(44px, 6.2vh, 72px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(2, 34, 29, 0.94) 0%, rgba(1, 18, 15, 0.98) 100%);
    border: 2px solid rgba(64, 150, 141, 0.72);
    color: #ffffff;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(0, 115, 102, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0) scale(1);
}

.holo-circle-btn:hover {
    transform: scale(1.08);
    border-color: rgba(108, 190, 74, 0.9);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.5),
        0 0 32px rgba(0, 115, 102, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.holo-circle-btn:active {
    transform: scale(0.95);
}

/* Breathing Outer Glow Aura */
.circle-btn-aura {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 115, 102, 0.45);
    animation: holo-aura-breathe 2.8s ease-in-out infinite;
    pointer-events: none;
    transition: all 0.3s ease;
}

@keyframes holo-aura-breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
        box-shadow: 0 0 10px rgba(0, 115, 102, 0.22);
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 22px rgba(0, 148, 131, 0.58);
    }
}

/* Concentric Acoustic Soundwave Rings */
.circle-soundwave-rings {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    pointer-events: none;
    display: none;
}

.circle-soundwave-rings span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--amana-leaf);
    opacity: 0;
    animation: wave-ring-expand 1.8s cubic-bezier(0.1, 0.4, 0.7, 1) infinite;
}

.circle-soundwave-rings span:nth-child(2) {
    animation-delay: 0.6s;
}

.circle-soundwave-rings span:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes wave-ring-expand {
    0% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Icon Container */
.btn-icon-wrapper {
    position: relative;
    width: clamp(24px, 3.4vh, 38px);
    height: clamp(24px, 3.4vh, 38px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amana-emerald), var(--amana-emerald-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(0, 115, 102, 0.7);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.btn-icon-wrapper svg {
    width: clamp(14px, 1.9vh, 21px);
    height: clamp(14px, 1.9vh, 21px);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ========================================================
   SUBTLE MICRO HINT PILL
======================================================== */
.circle-btn-hint {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(4px, 0.6vh, 7px) clamp(9px, 1.2vh, 14px);
    border-radius: 100px;
    background: rgba(1, 22, 19, 0.88);
    border: 1px solid rgba(64, 150, 141, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.25s ease;
}

.btn-main-label {
    font-size: clamp(10px, 1.25vh, 14px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ========================================================
   END CALL BUTTON (PILL)
======================================================== */
.holo-end-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(220, 38, 38, 0.92);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-family: var(--font-tajawal);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
    transition: all 0.2s ease;
}

.holo-end-btn:hover {
    background: #ef4444;
    transform: scale(1.05);
}

/* ========================================================
   STATE STYLES
======================================================== */

/* State: CONNECTING */
.holo-voice-controller.state-connecting .btn-icon-wrapper {
    background: linear-gradient(135deg, var(--holo-amber), #D97706);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.holo-voice-controller.state-connecting .circle-btn-aura {
    border-color: rgba(245, 158, 11, 0.6);
    animation-duration: 1.2s;
}

.holo-voice-controller.state-connecting .circle-btn-hint {
    border-color: rgba(245, 158, 11, 0.45);
}

/* State: LISTENING (Vibrant Leaf Green) */
.holo-voice-controller.state-listening .btn-icon-wrapper {
    background: linear-gradient(135deg, #059669, var(--amana-leaf));
    box-shadow: 0 0 18px rgba(108, 190, 74, 0.72);
}

.holo-voice-controller.state-listening .circle-soundwave-rings {
    display: block;
}

.holo-voice-controller.state-listening .circle-soundwave-rings span {
    border-color: var(--amana-leaf);
}

.holo-voice-controller.state-listening .circle-btn-hint {
    border-color: rgba(108, 190, 74, 0.55);
}

/* State: SPEAKING (Amana Emerald Teal) */
.holo-voice-controller.state-speaking .btn-icon-wrapper {
    background: linear-gradient(135deg, var(--amana-emerald), var(--amana-emerald-bright));
    box-shadow: 0 0 20px rgba(0, 148, 131, 0.85);
    animation: holo-speaking-pulse 1.4s ease-in-out infinite;
}

@keyframes holo-speaking-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.holo-voice-controller.state-speaking .circle-soundwave-rings {
    display: block;
}

.holo-voice-controller.state-speaking .circle-soundwave-rings span {
    border-color: var(--amana-emerald-bright);
}

.holo-voice-controller.state-speaking .circle-btn-hint {
    border-color: rgba(0, 148, 131, 0.65);
}

/* Active State Show End Button */
.holo-voice-controller.is-active .holo-end-btn {
    display: inline-flex;
}

/* ========================================================
   BRAND WATERMARK BADGE — الكتف الأيسر للشخصية (يمين الشاشة)
======================================================== */
.holo-brand-controller {
    position: absolute;
    top: 28.5%;
    right: 2.5% !important;
    left: auto !important;
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.holo-circle-badge {
    position: relative;
    z-index: 10;
    width: clamp(44px, 6.2vh, 72px);
    height: clamp(44px, 6.2vh, 72px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(242, 249, 247, 0.98) 100%);
    border: 2px solid rgba(0, 115, 102, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 115, 102, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.brand-icon-wrapper {
    width: clamp(28px, 4.1vh, 46px);
    height: clamp(28px, 4.1vh, 46px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-circle-logo {
    max-width: clamp(24px, 3.5vh, 38px);
    max-height: clamp(24px, 3.5vh, 38px);
    object-fit: contain;
}

.brand-hint {
    background: rgba(1, 22, 19, 0.88);
    border: 1px solid rgba(64, 150, 141, 0.45);
}

.brand-main-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.brand-row-main {
    font-size: clamp(9.5px, 1.2vh, 13.5px);
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.brand-row-sub {
    font-size: clamp(8.5px, 1.05vh, 11.5px);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 4px;
}

.brand-tag {
    color: #6CBE4A;
    font-weight: 800;
}

/* ========================================================
   RESPONSIVE SAFEGUARDS (Prevents overlap on narrow/short screens)
======================================================== */
@media (max-width: 900px) {
    .holo-voice-controller {
        left: 2% !important;
    }
    .holo-brand-controller {
        right: 2% !important;
    }
    .circle-btn-hint {
        padding: 4px 9px;
    }
}

@media (max-width: 600px) {
    .holo-voice-controller {
        left: 1.5% !important;
        top: 26%;
    }
    .holo-brand-controller {
        right: 1.5% !important;
        top: 26%;
    }
    .holo-circle-btn, .holo-circle-badge {
        width: 44px;
        height: 44px;
    }
    .btn-icon-wrapper {
        width: 25px;
        height: 25px;
    }
    .btn-icon-wrapper svg {
        width: 14px;
        height: 14px;
    }
    .btn-main-label {
        font-size: 10px;
    }
    .brand-row-main {
        font-size: 9.5px;
    }
    .brand-row-sub {
        font-size: 8.5px;
    }
}

/* ========================================================
   WIDE / LANDSCAPE SCREENS: PUSH WIDGETS CLEANLY INTO OUTER MARGINS
   (Placed last so compact landscape windows also keep outer spacing)
======================================================== */
@media (min-aspect-ratio: 11/16) {
    .holo-voice-controller {
        left: -10% !important;
    }
    .holo-brand-controller {
        right: -10% !important;
    }
}

