/* ===================================
   Live Chat Widget Styles
   =================================== */

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.6);
}

.chat-button i {
    font-size: 28px;
    color: white;
}

.chat-button.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Notification Badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background-color: #1f2937;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    border: 1px solid #374151;
}

.chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.chat-header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mode Toggle */
.mode-toggle {
    background-color: #111827;
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #374151;
}

.mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #374151;
    background-color: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mode-btn:hover {
    border-color: #17a2b8;
    color: #17a2b8;
}

.mode-btn.active {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border-color: #17a2b8;
}

.mode-btn i {
    font-size: 14px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #111827;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1f2937;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Message Bubble */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot .message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    max-width: 75%;
}

.message.bot .message-bubble {
    background-color: #1f2937;
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 12px 12px 12px 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border-radius: 12px 12px 4px 12px;
}

.message-bubble {
    padding: 12px 16px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px 12px 12px 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply-btn {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #17a2b8;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background-color: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

/* Welcome Message */
.welcome-message {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.welcome-message h4 {
    color: #17a2b8;
    margin-bottom: 10px;
    font-size: 16px;
}

.welcome-message p {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.6;
}

/* Chat Input */
.chat-input {
    background-color: #1f2937;
    padding: 15px 20px;
    border-top: 1px solid #374151;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    background-color: #111827;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    border-color: #17a2b8;
}

.chat-input input::placeholder {
    color: #6b7280;
}

.send-btn {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn i {
    font-size: 16px;
}

/* Agent Mode Specific */
.agent-info {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 15px;
}

.agent-info h4 {
    color: #17a2b8;
    margin-bottom: 8px;
    font-size: 14px;
}

.agent-info p {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.whatsapp-btn {
    background-color: #25d366;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: all 0.3s;
}

.whatsapp-btn:hover {
    background-color: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn i {
    font-size: 18px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 80px;
    }

    .chat-button {
        right: 20px;
        bottom: 20px;
        width: 55px;
        height: 55px;
    }

    .chat-button i {
        font-size: 24px;
    }

    .message-content {
        max-width: 85%;
    }
}

/* Animations */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Loading State */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    animation: loading 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loading {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}
