/* AI Support Chat Widget Styles */

#ai-support-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2563eb;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.chat-toggle .chat-icon,
.chat-toggle .close-icon {
    color: white;
    transition: all 0.3s ease;
    position: absolute;
}

.chat-toggle .close-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.chat-toggle.open .chat-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.chat-toggle.open .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chat-window.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background-color: #2563eb;
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-name {
    font-weight: 600;
    font-size: 16px;
}

.bot-status {
    font-size: 12px;
    opacity: 0.9;
}

.close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9fafb;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Messages */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar svg {
    color: #6b7280;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.message.assistant .message-content {
    background: #2563eb;
    color: white;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots 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;
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid #e5e7eb;
    background: white;
    padding: 16px;
    border-radius: 0 0 16px 16px;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #2563eb;
}

.chat-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background: #2563eb;
    color: white;
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Footer */
.chat-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.need-help {
    color: #6b7280;
}

.contact-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.contact-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ai-support-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chat-window {
        width: 100%;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        bottom: 70px;
        left: 0;
        right: 0;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
        position: fixed;
        right: 10px;
        bottom: 10px;
    }
}