/* Chat Widget Styles - Modern Premium Design */

/* Floating Button */
#chat-widget-btn {
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6366f1 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.4);
    animation: pulse-ring 2s ease-out infinite;
}

#chat-widget-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), 0 0 0 10px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4), 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* Chat Window */
#chat-widget-window {
    z-index: 9998;
    background: linear-gradient(180deg, rgba(17, 25, 40, 0.98) 0%, rgba(11, 15, 26, 0.98) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* Messages Container */
#chat-messages {
    background: linear-gradient(180deg, rgba(11, 15, 26, 0.5) 0%, rgba(17, 25, 40, 0.3) 100%);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Message Bubbles */
.msg-user {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.msg-bot {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.9) 0%, rgba(31, 41, 55, 0.9) 100%);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 18px 18px 18px 4px;
}

.msg-admin {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* Message Animation */
@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

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

#chat-messages>div {
    animation: messageSlide 0.3s ease-out forwards;
}

/* Bot Question Buttons */
.bot-question-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.bot-question-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateX(5px);
}

/* Input Area */
.chat-input-area {
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.5) 0%, rgba(17, 25, 40, 0.8) 100%);
    border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.chat-input {
    background: rgba(17, 25, 40, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.chat-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.chat-send-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.9) 0%, rgba(31, 41, 55, 0.9) 100%);
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: rgba(139, 92, 246, 0.7);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Status Badge */
.status-online {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-waiting {
    color: #f59e0b;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Notification Badge */
#chat-badge {
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chat-widget-window {
        width: calc(100vw - 24px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 12px;
        left: 12px;
        border-radius: 16px;
    }

    #chat-widget-btn {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Escalation Button */
.escalate-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.escalate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}