/* ============================================
   AIZONIQ - Enhanced Chatbot Widget Styles
   Modern & Spacious Design - Centered Version
   ============================================ */

/* Overlay Background */
.chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.chatbot-overlay.active {
    opacity: 1;
    visibility: visible;
}

.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-family: 'Inter', sans-serif;
    z-index: 999;
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 32px;
    position: relative;
    overflow: hidden;
}

.chatbot-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.7);
}

.chatbot-toggle:hover::before {
    opacity: 1;
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: rotate(90deg);
}

.chatbot-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 420px;
    height: 580px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 100px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(20px);
    z-index: 1000;
}

.chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 28px 24px;
    border-radius: 22px 22px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chatbot-header-content {
    position: relative;
    z-index: 1;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.chatbot-header p {
    margin: 6px 0 0 0;
    font-size: 14px;
    opacity: 0.95;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.chatbot-close:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.25);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
    animation: slideIn 0.4s ease-out;
}

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

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}

.chat-message.bot .message-bubble {
    background: rgba(102, 126, 234, 0.15);
    color: #ffffff;
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

.message-typing {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
}

.message-typing span {
    width: 10px;
    height: 10px;
    background: rgba(102, 126, 234, 0.8);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-12px);
    }
}

.chatbot-input-area {
    padding: 20px;
    border-top: 2px solid rgba(102, 126, 234, 0.2);
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.chatbot-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chatbot-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.chatbot-send {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-send:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 28px 20px 28px;
}

.quick-reply-btn {
    padding: 14px 18px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
}

.quick-reply-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: #667eea;
    color: #ffffff;
    transform: translateX(4px);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #10b981;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px #10b981;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Badge for chat widget */
.chatbot-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    animation: badgePulse 2s infinite;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
    border: 2px solid #1a1a2e;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-toggle {
        width: 65px;
        height: 65px;
        font-size: 28px;
    }

    .chatbot-container {
        width: 90%;
        max-width: 400px;
        height: 550px;
    }

    .chat-message .message-bubble {
        max-width: 85%;
        font-size: 14px;
        padding: 14px 18px;
    }
}

@media (max-width: 480px) {
    .chatbot-toggle {
        width: 60px;
        height: 60px;
        font-size: 26px;
    }

    .chatbot-container {
        width: 95%;
        height: 85vh;
        max-height: 600px;
    }

    .chatbot-header {
        padding: 24px 20px;
    }

    .chatbot-messages {
        padding: 20px;
    }

    .chatbot-input-area {
        padding: 16px;
    }

    .quick-replies {
        padding: 0 20px 16px 20px;
    }
}
