﻿/* ==========================================================================
   OPTIBOT CHATBOT - OPTIMUS11 THEME (FAST ANIMATIONS + MOBILE TEXT HIDDEN)
   Clean, Modern, Professional - Optimized Performance
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap');

/* ==========================================================================
   1. MAIN CONTAINER - LEFT ALIGNED (Respects existing buttons)
   ========================================================================== */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99999;
    font-family: 'Inter', sans-serif;
}

/* ==========================================================================
   2. TOGGLE WRAPPER - LEFT SIDE, FASTER ANIMATIONS
   ========================================================================== */
.chatbot-toggle-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Floating Robot Circle - Super Fast Animation (1.2s) */
.chatbot-icon-circle {
    width: 65px;
    height: 65px;
    background: linear-gradient(145deg, #0A2540, #1A4B6E);
    color: #FFC107;
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 25px rgba(10, 37, 64, 0.3);
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: floatGlowFast 1.2s ease-in-out infinite;
    will-change: transform;
}

/* Label below icon */
.bot-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    background: #0A2540;
    color: #FFC107;
    padding: 6px 16px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    transition: all 0.15s ease;
    white-space: nowrap;
}

/* Hover Effects - Instant response (0.1s) */
.chatbot-toggle-wrapper:hover .chatbot-icon-circle {
    background: linear-gradient(145deg, #FFC107, #FFB347);
    color: #0A2540;
    border-color: #0A2540;
    transform: scale(1.08);
    animation: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    transition: transform 0.1s ease, background 0.15s ease;
}

.chatbot-toggle-wrapper:hover .bot-label {
    background: #FFC107;
    color: #0A2540;
    border-color: #0A2540;
    transform: translateY(-2px);
    transition: all 0.1s ease;
}

/* SUPER FAST Floating Animation - 1.2 seconds with snappy movement */
@keyframes floatGlowFast {
    0% {
        transform: translateY(0px);
        box-shadow: 0 10px 25px rgba(10, 37, 64, 0.3);
    }

    35% {
        transform: translateY(-8px);
        box-shadow: 0 18px 30px rgba(10, 37, 64, 0.4);
    }

    65% {
        transform: translateY(-4px);
        box-shadow: 0 14px 28px rgba(10, 37, 64, 0.35);
    }

    100% {
        transform: translateY(0px);
        box-shadow: 0 10px 25px rgba(10, 37, 64, 0.3);
    }
}

/* ==========================================================================
   3. CHAT WINDOW - FAST TRANSITIONS
   ========================================================================== */
.chatbot-window {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 400px;
    height: 600px;
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom left;
    transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
    border: 1px solid rgba(10, 37, 64, 0.1);
}

    .chatbot-window.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #0A2540 0%, #1A4B6E 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: #FFC107;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #0A2540;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    position: relative;
}

    /* Online Status Dot - Fast pulse */
    .chatbot-avatar::after {
        content: '';
        position: absolute;
        bottom: 2px;
        right: 2px;
        width: 10px;
        height: 10px;
        background: #22C55E;
        border-radius: 50%;
        border: 2px solid #FFFFFF;
        animation: statusPulseFast 1s infinite;
    }

@keyframes statusPulseFast {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }

    50% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.header-title h5 {
    color: #FFFFFF;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.header-title p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin: 3px 0 0;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .chatbot-close-btn:hover {
        background: rgba(220, 53, 69, 0.8);
        transform: rotate(90deg);
    }

/* ==========================================================================
   4. MESSAGES AREA - FAST ANIMATIONS
   ========================================================================== */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #F8FAFE;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

    /* Custom Scrollbar */
    .chatbot-messages::-webkit-scrollbar {
        width: 5px;
    }

    .chatbot-messages::-webkit-scrollbar-track {
        background: #E2E8F0;
        border-radius: 10px;
    }

    .chatbot-messages::-webkit-scrollbar-thumb {
        background: #1A4B6E;
        border-radius: 10px;
    }

/* Chat Bubbles - Fast fade in (0.15s) */
.chat-message {
    max-width: 85%;
    animation: fadeSlideUpFast 0.15s ease-out;
}

@keyframes fadeSlideUpFast {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.45;
    font-weight: 500;
}

/* Bot Message */
.bot-message {
    align-self: flex-start;
}

    .bot-message .message-content {
        background: #FFFFFF;
        color: #1E293B;
        border-bottom-left-radius: 5px;
        border: 1px solid #E2E8F0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    }

/* User Message */
.user-message {
    align-self: flex-end;
}

    .user-message .message-content {
        background: linear-gradient(135deg, #0A2540, #1A4B6E);
        color: white;
        border-bottom-right-radius: 5px;
        box-shadow: 0 4px 10px rgba(10, 37, 64, 0.15);
    }

/* Typing Indicator - Fast animation (0.7s) */
.chatbot-typing {
    background: transparent;
    padding: 0 20px 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #1A4B6E;
    border-radius: 50%;
    animation: typingBounceFast 0.7s infinite ease-in-out;
}

    .typing-dot:nth-child(1) {
        animation-delay: -0.2s;
    }

    .typing-dot:nth-child(2) {
        animation-delay: -0.1s;
    }

@keyframes typingBounceFast {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
        background: #FFC107;
    }
}

/* ==========================================================================
   5. QUICK REPLIES
   ========================================================================== */
.chatbot-quick-replies {
    background: #FFFFFF;
    padding: 10px 16px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
    scrollbar-width: thin;
}

    .chatbot-quick-replies::-webkit-scrollbar {
        height: 3px;
    }

.quick-reply-btn {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #0A2540;
    padding: 7px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: 'Inter', sans-serif;
}

    .quick-reply-btn:hover {
        background: #FFC107;
        border-color: #FFC107;
        color: #0A2540;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
    }

/* ==========================================================================
   6. INPUT AREA
   ========================================================================== */
.chatbot-input-area {
    padding: 14px 16px;
    background: #FFFFFF;
    display: flex;
    gap: 10px;
    border-top: 1px solid #E2E8F0;
}

#chatbot-input {
    flex: 1;
    background: #F8FAFE;
    border: 1px solid #CBD5E1;
    border-radius: 40px;
    padding: 11px 18px;
    font-size: 13px;
    color: #0A2540;
    font-weight: 500;
    outline: none;
    transition: all 0.12s ease;
    font-family: 'Inter', sans-serif;
}

    #chatbot-input:focus {
        border-color: #1A4B6E;
        background: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(26, 75, 110, 0.1);
    }

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    background: #FFC107;
    color: #0A2540;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

    .chatbot-send-btn:hover {
        transform: scale(1.05);
        background: #FFB347;
        box-shadow: 0 6px 14px rgba(255, 193, 7, 0.4);
    }

    .chatbot-send-btn:active {
        transform: scale(0.96);
    }

/* ==========================================================================
   7. MOBILE RESPONSIVE - TEXT HIDDEN (ONLY ICON VISIBLE)
   ========================================================================== */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 30px;
        left: 16px;
    }

    .chatbot-toggle-wrapper {
        bottom: 30px;
        left: 16px;
        flex-direction: row;
        gap: 0;
        background: rgba(10, 37, 64, 0.92);
        backdrop-filter: blur(12px);
        padding: 10px;
        border-radius: 50px;
        border: 1.5px solid rgba(255, 193, 7, 0.6);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
        width: auto;
        min-width: 56px;
        animation: mobileGlowPulse 2.5s infinite;
    }

    .chatbot-icon-circle {
        width: 44px;
        height: 44px;
        font-size: 24px;
        background: linear-gradient(145deg, #FFC107, #FFB347);
        color: #0A2540;
        border: none;
        animation: none;
        box-shadow: none;
    }

    /* HIDE THE TEXT ON MOBILE - ONLY ICON VISIBLE */
    .bot-label {
        display: none;
    }

    .chatbot-toggle-wrapper:hover .chatbot-icon-circle {
        transform: scale(1.08);
        background: linear-gradient(145deg, #FFC107, #FFB347);
    }

    /* Mobile Chat Window - Fullscreen */
    .chatbot-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 100000;
        transform: translateY(100%);
        transition: transform 0.25s ease;
    }

        .chatbot-window.active {
            transform: translateY(0);
        }

    .chatbot-header {
        border-radius: 0;
        padding: 16px 20px;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .chatbot-messages {
        padding: 16px;
    }

    .chatbot-quick-replies {
        padding: 10px 14px;
        gap: 8px;
    }

    .quick-reply-btn {
        padding: 6px 14px;
        font-size: 11px;
    }

    .chatbot-input-area {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}

/* Mobile Glow Pulse */
@keyframes mobileGlowPulse {
    0% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 193, 7, 0.6);
        border-color: rgba(255, 193, 7, 0.6);
    }

    70% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 14px rgba(255, 193, 7, 0);
        border-color: rgba(255, 193, 7, 0.2);
    }

    100% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(255, 193, 7, 0);
        border-color: rgba(255, 193, 7, 0.6);
    }
}

/* Small Phones (<=480px) */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: 70px;
        left: 12px;
    }

    .chatbot-toggle-wrapper {
        bottom: 30px;
        left: 12px;
        padding: 8px;
        min-width: 48px;
    }

    .chatbot-icon-circle {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .message-content {
        padding: 9px 13px;
        font-size: 12px;
    }
}

/* ==========================================================================
   8. SAFE AREA & NOTCH SUPPORT
   ========================================================================== */
@supports (padding: max(0px)) {
    .chatbot-input-area {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .chatbot-header {
            padding-top: max(16px, env(safe-area-inset-top));
        }
    }
}

/* ==========================================================================
   9. HIGH CONTRAST ACCESSIBILITY
   ========================================================================== */
@media (prefers-contrast: high) {
    .chatbot-window {
        border: 2px solid #0A2540;
    }

    .user-message .message-content {
        background: #0A2540;
        color: white;
    }

    .bot-message .message-content {
        border: 1px solid #0A2540;
    }

    .quick-reply-btn {
        background: white;
        border: 2px solid #0A2540;
        color: #0A2540;
    }

        .quick-reply-btn:hover {
            background: #0A2540;
            color: white;
        }

    @media (max-width: 768px) {
        .chatbot-toggle-wrapper {
            background: #0A2540;
            border: 2px solid #FFC107;
        }
    }
}

/* ==========================================================================
   10. PERFORMANCE OPTIMIZATIONS & REDUCED MOTION
   ========================================================================== */
.chatbot-icon-circle,
.chatbot-window,
.chat-message,
.quick-reply-btn,
.chatbot-send-btn {
    will-change: transform;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .chatbot-icon-circle,
    .chatbot-avatar::after,
    .chat-message,
    .typing-dot,
    .chatbot-toggle-wrapper {
        animation: none !important;
        transition: none !important;
    }

    .chatbot-icon-circle {
        transform: none !important;
    }
}

/* ==========================================================================
   END - READY FOR OPTIMUS11 INTEGRATION
   - Animation duration: 1.2s (super fast)
   - Mobile: Only robot icon visible (text hidden)
   ========================================================================== */
