/* Floating Chat Widget Styles */

/* Floating Chat Button */
.floating-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #FF6B35;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.floating-chat-button:hover {
    background: #e55a2b;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.floating-chat-button.hidden {
    display: none;
}

.floating-chat-button svg {
    width: 28px;
    height: 28px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Floating Chat Window */
.floating-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.floating-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.floating-chat-header {
    background: linear-gradient(135deg, #FF6B35 0%, #e55a2b 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    width: 20px;
    height: 20px;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: block;
    margin-top: 2px;
}

.chat-minimize {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.floating-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.floating-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Welcome Message */
.chat-welcome {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
}

.welcome-avatar {
    width: 40px;
    height: 40px;
    background: #e0f4ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-avatar svg {
    width: 24px;
    height: 24px;
    color: #27ae60;
}

.welcome-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 15px;
}

.welcome-text p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

/* Message Bubbles */
.floating-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease;
}

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

.floating-message.user-message {
    align-self: flex-end;
}

.floating-message.assistant-message {
    align-self: flex-start;
}

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message-content strong {
    font-weight: 600;
}

.user-message .message-content {
    background: #FF6B35;
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

.assistant-message .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

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

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

/* Input Container */
.floating-chat-input-container {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 12px;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.floating-chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    transition: border-color 0.2s;
}

.floating-chat-input:focus {
    outline: none;
    border-color: #FF6B35;
}

.floating-chat-input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.chat-send-button {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #FF6B35;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
    background: #e55a2b;
    transform: scale(1.05);
}

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

.chat-send-button svg {
    width: 20px;
    height: 20px;
}

.chat-footer {
    margin-top: 8px;
    text-align: center;
}

.chat-powered-by {
    font-size: 11px;
    color: #999;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-width: none;
        max-height: none;
        bottom: 10px;
        right: 10px;
        border-radius: 12px;
    }

    .floating-chat-button {
        bottom: 90px;
        right: 15px;
        width: 56px;
        height: 56px;
        z-index: 10000;
    }
}
