/* Premium Chat Bubble Styles */
:root {
    --primary-color: #4e46e5;
    --primary-dark: #3730a3;
    --primary-light: #c7d2fe;
    --text-white: #ffffff;
    --text-dark: #1f2937;
    --background-light: #f3f4f6;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --bubble-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    --popup-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
}

#elecreo-chatbot {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif, Arial;
    line-height: 1.5;
    color: var(--text-dark);
}

/* Chat Bubble */
.elecreo-chat-bubble {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9998;
    cursor: pointer;
    transform-origin: bottom right;
    animation: bounce-in 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.elecreo-agent-bubble {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 30px;
    padding: 10px 24px 10px 10px;
    box-shadow: var(--bubble-shadow);
    max-width: 280px;
    transition: all var(--transition-speed) ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.elecreo-agent-bubble:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.elecreo-agent-avatar {
    width: 42px;
    height: 42px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.elecreo-agent-avatar i {
    font-size: 22px;
    color: var(--primary-color);
}

.elecreo-agent-avatar::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    z-index: 2;
}

.elecreo-agent-message {
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
}

/* Typing Animation */
.elecreo-typing-animation {
    display: inline-block;
    position: relative;
}

.elecreo-typing-animation::after {
    content: '|';
    position: absolute;
    right: -4px;
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Chat Popup - FIXED FOR DISPLAY ISSUE */
.elecreo-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 360px;
    max-width: 90vw;
    height: 550px;
    max-height: 80vh;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--popup-shadow);
    z-index: 9999;
    display: none; /* This will be overridden */
    flex-direction: column;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
}

.elecreo-chat-popup.active {
    display: flex !important; /* Important to override any conflicts */
    animation: popup-appear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-appear {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.elecreo-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Chat Header */
.elecreo-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.elecreo-header-info {
    display: flex;
    align-items: center;
}

.elecreo-logo {
    width: 36px;
    height: 36px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.elecreo-logo i {
    font-size: 18px;
    color: var(--primary-color);
}

.elecreo-chat-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.elecreo-chat-header p {
    font-size: 13px;
    margin: 3px 0 0;
    opacity: 0.9;
}

.elecreo-online {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.elecreo-online-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    margin-right: 6px;
    position: relative;
}

.elecreo-online-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--success-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    70% { transform: scale(2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.elecreo-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.elecreo-close-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.elecreo-messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    background-color: #f9fafc;
    background-image: 
        radial-gradient(#e0e7ff 1px, transparent 1px),
        radial-gradient(#e0e7ff 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.elecreo-messages-area::-webkit-scrollbar {
    width: 6px;
}

.elecreo-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.elecreo-messages-area::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Bot Message */
.elecreo-bot-message {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
    animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.elecreo-bot-message .elecreo-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.elecreo-bot-message .elecreo-avatar i {
    font-size: 18px;
    color: white;
}

.elecreo-bot-message .elecreo-message-bubble {
    background-color: white;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.elecreo-message-text {
    font-size: 14px;
}

.elecreo-message-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* User Message */
.elecreo-user-message {
    display: flex;
    margin-bottom: 16px;
    justify-content: flex-end;
    animation: message-appear 0.3s ease-out;
}

.elecreo-user-message .elecreo-message-bubble {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.elecreo-user-message .elecreo-message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.elecreo-typing {
    margin-bottom: 16px;
}

.elecreo-typing-dots {
    display: flex;
    padding: 12px 16px;
}

.elecreo-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    margin-right: 4px;
    animation: typing-dot 1s infinite;
}

.elecreo-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.elecreo-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.elecreo-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input Area */
.elecreo-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--border-color);
    background-color: white;
}

.elecreo-message-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-speed);
    background-color: var(--background-light);
}

.elecreo-message-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.elecreo-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.elecreo-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Service Options */
.elecreo-service-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.elecreo-service-options button {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-speed);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.elecreo-service-options button:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.elecreo-other-option {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    font-weight: 500;
}

.elecreo-other-input {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.elecreo-other-service-input {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

.elecreo-submit-other, .elecreo-back-to-options {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.elecreo-submit-other:hover, .elecreo-back-to-options:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.elecreo-back-to-options {
    background-color: #6b7280;
    margin-top: 4px;
    font-size: 12px;
    justify-content: flex-start;
}

.elecreo-back-to-options i {
    margin-right: 4px;
}

/* Confirmation Step */
.elecreo-submit-request {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

#elecreo-submit-lead {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#elecreo-submit-lead:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#elecreo-submit-lead:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#elecreo-submit-lead.success {
    background-color: var(--success-color);
}

/* WhatsApp Button */
.elecreo-whatsapp-button {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.elecreo-whatsapp-button a {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.elecreo-whatsapp-button a:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.elecreo-whatsapp-button i {
    margin-right: 8px;
    font-size: 18px;
}

/* Wave Message */
.elecreo-wave-message {
    position: absolute;
    top: -45px;
    right: 0;
    background-color: white;
    padding: 8px 16px;
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    box-shadow: var(--bubble-shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-speed);
}

.elecreo-wave-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse Animation */
.pulse-attention {
    animation: pulse-ring 2s ease infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
    }
    5% {
        transform: scale(1.05);
    }
    10% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.05);
    }
    20% {
        transform: scale(1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .elecreo-chat-popup {
        bottom: 80px;
        right: 10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 160px);
        max-height: none;
    }

    .elecreo-chat-bubble {
        bottom: 15px;
        right: 15px;
    }

    .elecreo-agent-bubble {
        padding: 8px 20px 8px 8px;
    }

    .elecreo-agent-avatar {
        width: 36px;
        height: 36px;
    }

    .elecreo-agent-message {
        font-size: 14px;
    }

    .elecreo-service-options {
        grid-template-columns: 1fr;
    }
}

/* Ensure the chatbot displays properly */
.elecreo-chat-popup.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}
/* Here are the critical CSS fixes to add at the bottom of your style.css file */

/* Fix for chat popup display issue */
.elecreo-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 360px;
    max-width: 90vw;
    height: 550px;
    max-height: 80vh;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--popup-shadow);
    z-index: 9999;
    display: none;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
}

/* Override display property to ensure visibility */
.elecreo-chat-popup.active {
    display: flex !important;
    animation: popup-appear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hardware acceleration for smoother animations */
.elecreo-chat-popup.active {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}
/* Add this to style.css */
#elecreo-submit-lead.submitted {
    background-color: var(--success-color);
    cursor: default;
}

.elecreo-submit-request button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.elecreo-submit-request button:hover:not(.submitted) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}
