/* 
   ============================================
   EZIBELL TECH - PREMIUM CHATBOT UI
   ============================================
*/

:root {
    --chat-primary: #163768;
    --chat-accent: #ffd700;
    --chat-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --bot-shadow: 0 8px 32px 0 rgba(22, 55, 104, 0.2);
}

/* 1. THE FLOATING BUBBLE */
.ez-chat-bubble {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #163768 0%, #165368 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--bot-shadow);
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-ring 2s infinite;
}

.ez-chat-bubble:hover {
    transform: scale(1.1);
}

.ez-chat-bubble img {
    width: 35px;
    filter: invert(1);
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 55, 104, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(22, 55, 104, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(22, 55, 104, 0);
    }
}

/* TEASER TOOLTIP */
.ez-chat-teaser {
    position: fixed;
    bottom: 45px;
    left: 110px;
    background: white;
    color: #333;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 4px 20px rgba(22, 55, 104, 0.15);
    z-index: 10001;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: 1px solid rgba(22, 55, 104, 0.08);
}

/* Arrow pointing to the bubble */
.ez-chat-teaser::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
    filter: drop-shadow(-2px 0 2px rgba(22, 55, 104, 0.08));
}

.ez-chat-teaser.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.ez-chat-teaser:hover {
    background: var(--chat-primary);
    color: white;
    box-shadow: 0 6px 25px rgba(22, 55, 104, 0.25);
}

.ez-chat-teaser:hover::before {
    border-right-color: var(--chat-primary);
}

@keyframes teaser-bounce {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.9);
    }

    50% {
        transform: translateX(5px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 2. CHAT WINDOW (Glassmorphism) */
.ez-chat-window {
    position: fixed;
    bottom: 110px;
    left: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: var(--chat-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    box-shadow: var(--bot-shadow);
    z-index: 10000;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.ez-chat-window.active {
    display: flex;
    transform: translateY(0);
}

/* Header */
.ez-chat-header {
    background: var(--chat-primary);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ez-bot-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ez-bot-avatar img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.ez-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ez-header-info span {
    font-size: 11px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Message Area */
.ez-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.4);
}

.ez-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    margin-left: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ez-chat-close:hover {
    opacity: 1;
}

.ez-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
    word-wrap: break-word;
}

.ez-msg.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ez-msg.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer & Input */
.ez-chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.ez-chat-input-container {
    display: flex;
    gap: 10px;
    background: #f5f7fa;
    padding: 5px 15px;
    border-radius: 25px;
    border: 1px solid #eceff1;
}

.ez-chat-input-container input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-family: inherit;
    outline: none;
    font-size: 14.5px;
}

.ez-send-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
    color: #163768;
}

.ez-send-btn:hover {
    transform: scale(1.1) translateX(2px);
}

/* Typing Animation */
.ez-typing {
    display: flex;
    gap: 4px;
    padding: 15px;
}

.ez-typing span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: blink 1.4s infinite;
}

.ez-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ez-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .ez-chat-bubble {
        bottom: 20px;
        left: 20px;
        width: 55px;
        height: 55px;
    }

    .ez-chat-window {
        width: calc(100% - 30px);
        left: 15px;
        bottom: 85px;
        /* Shifted up slightly */
        height: min(550px, 80vh);
        border-radius: 15px;
    }

    .ez-chat-messages {
        padding: 15px;
    }

    .ez-msg {
        max-width: 90%;
        font-size: 14px;
    }

    .ez-chat-teaser {
        left: 90px;
        bottom: 35px;
        font-size: 13px;
        padding: 10px 16px;
    }
}