/**
 * ANZ Digital Dubai - AI Live Chatbot Stylesheet
 * Ultra-Modern Glassmorphic Luxury Interface for Desktop & Mobile
 */

/* Chatbot Floating Trigger Button */
#anz-chatbot-trigger-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (max-width: 768px) {
    #anz-chatbot-trigger-container {
        bottom: 85px; /* Sits nicely above the mobile bottom navigation bar */
        right: 16px;
    }
}

/* Callout Attention Bubble */
.anz-chat-bubble-teaser {
    background: rgba(10, 20, 38, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 102, 255, 0.25);
    margin-bottom: 10px;
    cursor: pointer;
    animation: teaserFloat 3s ease-in-out infinite;
    max-width: 240px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.anz-chat-bubble-teaser:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(0, 212, 255, 0.6);
}

@keyframes teaserFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Main Circular Floating Launcher Button */
.anz-chat-trigger-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066FF 0%, #00D4FF 100%);
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.45), 0 0 0 0 rgba(0, 212, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.anz-chat-trigger-btn:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 12px 35px rgba(0, 102, 255, 0.65), 0 0 25px rgba(0, 212, 255, 0.5);
}

.anz-chat-trigger-btn:active {
    transform: scale(0.95);
}

/* Pulsing Outer Ring */
.anz-chat-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #00D4FF;
    animation: pulseRing 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Online Status Badge Dot */
.anz-chat-online-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    background: #10B981;
    border: 2.5px solid #060B14;
    border-radius: 50%;
    box-shadow: 0 0 10px #10B981;
}

/* Chat Main Window Container */
#anz-chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: linear-gradient(180deg, #0A1426 0%, #060B14 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(0, 102, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

@media (max-width: 768px) {
    #anz-chatbot-window {
        bottom: 12px;
        right: 10px;
        left: 10px;
        width: auto;
        height: min(620px, calc(100dvh - 24px));
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    .anz-chat-header {
        padding: 12px 14px;
    }

    .anz-chat-onboarding {
        padding: 16px 16px 20px;
        justify-content: flex-start;
    }

    .anz-input-field,
    .anz-chat-input {
        font-size: 16px;
    }
}

/* Chatbot Hidden State */
#anz-chatbot-window.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateY(30px);
    visibility: hidden;
}

/* Header Area */
.anz-chat-header {
    background: linear-gradient(135deg, rgba(14, 26, 49, 0.95) 0%, rgba(6, 11, 20, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.anz-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0066FF, #00D4FF, #D4AF37, #0066FF);
}

.anz-chat-avatar-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #00D4FF;
    overflow: hidden;
    flex-shrink: 0;
    background: #002244;
}

.anz-chat-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anz-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.anz-chat-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.anz-chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Chat Body (Scrollable Messages Area) */
.anz-chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.anz-chat-messages-container::-webkit-scrollbar {
    width: 5px;
}

.anz-chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Message Bubble Styles */
.anz-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 88%;
}

.anz-msg-row.bot {
    align-self: flex-start;
}

.anz-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.anz-msg-bubble {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.55;
    position: relative;
    word-break: break-word;
}

.anz-msg-row.bot .anz-msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.anz-msg-row.user .anz-msg-bubble {
    background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
    color: #FFFFFF;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.35);
}

.anz-msg-time {
    font-size: 10px;
    color: #64748B;
    margin-top: 4px;
    text-align: right;
    font-family: monospace;
}

.anz-msg-row.user .anz-msg-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Quick Suggestion Pills Container */
.anz-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0;
}

.anz-suggestion-chip {
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    color: #38BDF8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.anz-suggestion-chip:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00D4FF;
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* Typing Indicator (Dots Animation) */
.anz-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
}

.anz-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00D4FF;
    animation: anzDotBounce 1.4s infinite ease-in-out both;
}

.anz-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.anz-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes anzDotBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Bar Area */
.anz-chat-input-bar {
    padding: 12px 14px;
    background: rgba(10, 20, 38, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.anz-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 13px;
    color: #FFFFFF;
    outline: none;
    transition: border-color 0.2s ease;
}

.anz-chat-input:focus {
    border-color: #0066FF;
    background: rgba(255, 255, 255, 0.09);
}

.anz-chat-input::placeholder {
    color: #64748B;
}

.anz-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0066FF 0%, #00D4FF 100%);
    border: none;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.anz-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.5);
}

.anz-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Onboarding Welcome Screen */
.anz-chat-onboarding {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    min-height: 0;
    text-align: center;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.anz-chat-onboarding > form {
    margin-top: auto;
    margin-bottom: auto;
}

.anz-onboarding-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #FBBF24;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto 12px;
}

.anz-input-group {
    text-align: left;
    margin-bottom: 12px;
}

.anz-input-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 4px;
}

.anz-input-wrapper {
    position: relative;
}

.anz-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748B;
    font-size: 12px;
}

.anz-input-field {
    width: 100%;
    padding: 10px 14px 10px 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.anz-input-field:focus {
    border-color: #00D4FF;
    background: rgba(255, 255, 255, 0.08);
}

/* Chat Image & Package Poster Card */
.anz-chat-banner-card {
    margin-top: 10px;
    margin-bottom: 6px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #030A14;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.anz-chat-banner-card:hover {
    border-color: rgba(0, 210, 255, 0.45);
}

.anz-chat-banner-card img {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.anz-chat-banner-card img:hover {
    opacity: 0.95;
}

/* Human Typewriter Streaming Cursor */
.anz-streaming-cursor {
    display: inline-block;
    color: #00D2FF;
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
    margin-left: 2px;
    animation: anzCursorBlink 0.75s ease-in-out infinite;
    vertical-align: baseline;
}

.anz-streaming-cursor::after {
    content: '▋';
}

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

.anz-msg-bubble.is-streaming {
    border-color: rgba(0, 210, 255, 0.35) !important;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.15) !important;
}
