:root {
    --arl-gold: #D4AF37;
    --arl-gold-soft: rgba(212, 175, 55, 0.12);
    --arl-bg: #0A0A0A;
    --arl-glass: blur(40px) saturate(200%) contrast(90%);
    --arl-font: 'Outfit', sans-serif;
    --arl-shadow-luxe: 0 30px 60px -12px rgba(0,0,0,0.6), 0 18px 36px -18px rgba(0,0,0,0.5);
    --arl-radius: 32px;
}

/* Global Reset */
.arl-chat-window * { box-sizing: border-box !important; -webkit-font-smoothing: antialiased; letter-spacing: normal; line-height: normal; }
.arl-chat-window button { background: transparent; border: none; padding: 0; margin: 0; outline: none; box-shadow: none; font-family: inherit; }

/* ===========================
   THE BUBBLE (GOOGLE-STYLE FAB)
   =========================== */
#arl-ai-bubble {
    position: fixed !important;
    bottom: 30px;
    right: 30px;
    width: 72px;
    height: 72px;
    background: #000;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2147483646 !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.08);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: auto !important;
}

#arl-ai-bubble::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--arl-gold), #FFF 150%);
    opacity: 0.2;
    z-index: -1;
    transition: 0.4s;
    animation: bubbleGlow 3s infinite alternate ease-in-out;
}

@keyframes bubbleGlow {
    from { opacity: 0.1; transform: scale(0.95); }
    to { opacity: 0.3; transform: scale(1.05); }
}

#arl-ai-bubble:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 25px 55px rgba(212,175,55,0.25);
}

#arl-ai-bubble img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
    transition: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255,255,255,0.1);
}

/* ===========================
   CHAT WINDOW (TECH LEADER UX)
   =========================== */
.arl-chat-window {
    position: fixed !important;
    bottom: 115px;
    right: 30px;
    width: 420px;
    height: 680px;
    max-height: 80vh;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: var(--arl-glass);
    -webkit-backdrop-filter: var(--arl-glass);
    border-radius: var(--arl-radius);
    border: 1px solid rgba(255,255,255,0.06);
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483647 !important;
    box-shadow: var(--arl-shadow-luxe);
    font-family: var(--arl-font);
    display: none; 
    transform: translateY(30px) scale(0.96);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: auto !important;
}

/* Left Position Modifier */
.arl-chat-window.arl-pos-left { left: 30px !important; right: auto !important; }
#arl-ai-bubble.arl-pos-left { left: 30px !important; right: auto !important; }

/* Top Accent Line (Premium Detail) */
.arl-chat-window::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--arl-gold), transparent);
    opacity: 0.8;
}

/* ===========================
   HEADER (SOPHISTICATED)
   =========================== */
.arl-chat-header {
    background: rgba(255,255,255,0.02);
    padding: 30px 28px 25px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.arl-main-chat {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    overflow: hidden;
    margin: 0 !important;
}


.arl-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.arl-header-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--arl-gold);
    padding: 1px;
    background: #000;
    flex-shrink: 0;
}

.arl-header-text h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.1;
}

.arl-header-text p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.arl-header-text p::before {
    content: '';
    width: 6px; height: 6px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981;
}

.arl-header-icons {
    display: flex;
    gap: 14px;
}

.arl-header-icons span {
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
}

.arl-header-icons span:hover { color: #fff; transform: scale(1.1); }

/* ===========================
   CHAT BODY & MESSAGES
   =========================== */
.arl-chat-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 25px 28px;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px;
    scrollbar-width: none;
    background: radial-gradient(circle at top right, rgba(212,175,55,0.03), transparent);
}
.arl-chat-body::-webkit-scrollbar { display: none; }

.arl-msg {
    max-width: 85%;
    padding: 16px 20px;
    font-size: 15px;
    line-height: 1.6;
    border-radius: 24px;
    position: relative;
    animation: luxeSlide 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes luxeSlide {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.arl-bot {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(255,255,255,0.03);
}

.arl-user {
    background: var(--arl-gold);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(212,175,55,0.25), inset 0 0 0 1px rgba(255,255,255,0.2);
    text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

/* ===========================
   INPUT AREA (PREMIUM REDESIGN)
   =========================== */
.arl-chat-input-area {
    padding: 20px 24px 34px 24px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 10;
}

.arl-input-vessel {
    flex: 1;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 6px 8px 6px 20px;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.arl-input-vessel:focus-within {
    background: rgba(255,255,255,0.08);
    border-color: var(--arl-gold);
    box-shadow: 0 8px 30px rgba(212,175,55,0.15), 0 0 0 1px var(--arl-gold);
    transform: translateY(-2px);
}

#arl-chat-input {
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    flex: 1;
    padding: 12px 0;
    outline: none;
    font-family: inherit;
    font-weight: 500;
}
#arl-chat-input::placeholder { color: rgba(255,255,255,0.3); }

.arl-svg-icon {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    flex-shrink: 0;
}

.arl-mic-btn, .arl-attach-btn {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.4) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 2px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.arl-mic-btn:hover, .arl-attach-btn:hover { 
    background: rgba(212,175,55,0.1);
    color: var(--arl-gold);
    border-color: rgba(212,175,55,0.3);
    transform: translateY(-2px);
}

#arl-chat-send {
    background: var(--arl-gold) !important;
    color: #000 !important;
    border: none !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    margin: 0 0 0 8px !important;
    padding: 0 !important;
    box-shadow: 0 4px 15px rgba(212,175,55,0.3) !important;
    flex-shrink: 0;
}

#arl-chat-send:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(212,175,55,0.4);
    filter: brightness(1.1);
}

#arl-chat-send .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Voice Active State - Wave Pulse */
.arl-mic-btn.active {
    color: #FF3B30;
    position: relative;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.1);
}

.arl-mic-btn.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #FF3B30;
    animation: voiceWave 1.2s infinite ease-out;
}

@keyframes voiceWave {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

.arl-attach-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arl-attach-btn:hover { color: var(--arl-gold); transform: rotate(15deg) scale(1.1); }

/* Attachment Preview Bar */
.arl-attachment-preview {
    background: rgba(255,255,255,0.05);
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.arl-preview-item {
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.2);
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--arl-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: luxeFadeIn 0.3s ease;
}

.arl-preview-remove {
    cursor: pointer;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
}
.arl-preview-remove:hover { color: #FF3B30; }
.arl-attach-btn:hover { color: var(--arl-gold); transform: scale(1.1); }

/* Quick Replies (Luxe Chips) */
.arl-quick-replies {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 28px 18px 28px;
    scrollbar-width: none;
    flex-shrink: 0;
}
.arl-quick-replies::-webkit-scrollbar { display: none; }

.arl-qr-chip {
    white-space: nowrap !important;
    padding: 10px 22px !important;
    background: rgba(212,175,55,0.06) !important;
    color: var(--arl-gold) !important;
    border: 1px solid rgba(212,175,55,0.15) !important;
    border-radius: 100px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: 0.3s;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
}
.arl-qr-chip:hover {
    background: var(--arl-gold);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212,175,55,0.2);
}

/* ===========================
   MISC POLISH & RICH MEDIA
   =========================== */
.typing-indicator {
    padding: 16px 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    width: fit-content;
    display: flex;
    gap: 4px;
    align-self: flex-start;
    margin-left: 56px; /* Offset for avatar */
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--arl-gold);
    border-radius: 50%;
    opacity: 0.4;
    animation: arlTyping 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes arlTyping {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.4); opacity: 1; }
}

.luxe-processing {
    animation: arlThink 2s infinite ease-in-out;
}
@keyframes arlThink {
    0% { filter: drop-shadow(0 0 5px rgba(212,175,55,0)); }
    50% { filter: drop-shadow(0 0 15px rgba(212,175,55,0.4)); }
    100% { filter: drop-shadow(0 0 5px rgba(212,175,55,0)); }
}

.arl-deep-thinking {
    background: radial-gradient(circle at center, rgba(212,175,55,0.08) 0%, rgba(10,10,10,0.95) 70%) !important;
    border-color: rgba(212,175,55,0.3) !important;
}

.typing-indicator small {
    display: inline-block;
    color: var(--arl-gold);
    letter-spacing: 0.05em;
    font-weight: 700;
    text-transform: uppercase;
    animation: textFlicker 2s infinite linear;
}

@keyframes textFlicker {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.arl-session-divider {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0;
    position: relative;
    font-weight: 700;
    width: 100%;
    flex-shrink: 0;
}
.arl-session-divider::before, .arl-session-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20%;
    height: 1px;
    background: rgba(255,255,255,0.05);
}
.arl-session-divider::before { left: 0; }
.arl-session-divider::after { right: 0; }

.arl-bot-msg-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.arl-bot-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--arl-gold);
    padding: 1px;
    background: #000;
    flex-shrink: 0;
}

.arl-chat-image, .arl-user-image {
    max-width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 5px;
}
.arl-chat-image:hover, .arl-user-image:hover { transform: scale(1.02); }

/* Service Bundle Cards */
.arl-service-bundle {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 20px;
    margin: 10px 0;
}

.arl-bundle-header {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.arl-bundle-icon { font-size: 24px; }
.arl-bundle-title { font-weight: 700; color: #fff; line-height: 1.2; }
.arl-bundle-subtitle { font-size: 12px; color: rgba(255,255,255,0.5); }

.arl-bundle-services {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.arl-bundle-pill {
    font-size: 11px;
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: 100px;
    color: rgba(255,255,255,0.8);
}

.arl-bundle-price {
    font-size: 13px;
    margin-bottom: 15px;
    color: var(--arl-gold);
}

.arl-bundle-cta {
    width: 100%;
    padding: 12px;
    background: var(--arl-gold);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

/* RTL Support */
.arl-rtl { direction: rtl; }
.arl-rtl #arl-chat-input { text-align: right; }
.arl-rtl .arl-msg { text-align: right; }
.arl-rtl .arl-bot { border-bottom-left-radius: 24px; border-bottom-right-radius: 6px; }
.arl-rtl .arl-user { border-bottom-right-radius: 24px; border-bottom-left-radius: 4px; }

/* Dashicons Font Fix (Critical for Mobile Close Button) */
.arl-chat-window .dashicons,
.arl-chat-header .dashicons {
    font-family: dashicons !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 20px !important;
    line-height: 1 !important;
    color: inherit !important;
}

/* Mobile Excellence - Tablets & Phones */
@media screen and (max-width: 992px) {
    .arl-chat-window {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
        transform: translateY(100%) !important;
        margin-bottom: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }
    
    .arl-chat-window.active {
        transform: translateY(0) scale(1) !important;
        display: flex !important;
    }

    .arl-chat-body {
        padding: 20px 18px !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .arl-msg {
        max-width: 88% !important;
        margin-bottom: 4px !important;
    }

    .arl-bot-msg-wrapper {
        width: 100% !important;
        max-width: 90% !important;
    }

    #arl-ai-bubble {
        bottom: 25px !important;
        bottom: env(safe-area-inset-bottom, 25px) !important;
        right: 25px !important;
        width: 64px !important;
        height: 64px !important;
    }

    .arl-chat-header {
        padding: 55px 20px 20px 20px !important;
        padding-top: calc(env(safe-area-inset-top, 20px) + 25px) !important;
    }

    .arl-quick-replies {
        padding: 0 18px 15px 18px !important;
    }

    .arl-chat-input-area {
        padding: 12px 18px !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 12px) !important;
    }

    body.arl-chat-is-open #arl-ai-bubble {
        display: none !important;
    }
}

/* Speaker Button */
.arl-speaker-btn {
    position: absolute;
    bottom: -15px;
    right: -10px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 10;
}

.arl-speaker-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.arl-speaking {
    background: #FFD700 !important; /* Gold while speaking */
    color: #000 !important;
    animation: arlPulse 1s infinite alternate;
}

@keyframes arlPulse {
    from { transform: scale(1); box-shadow: 0 0 0 rgba(255, 215, 0, 0); }
    to { transform: scale(1.2); box-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
}

@media screen and (max-width: 992px) {
    .arl-speaker-btn {
        width: 38px;
        height: 38px;
        font-size: 20px !important;
        bottom: -20px;
        right: -10px;
    }
}


