/**
 * Support Chat Widget Styles
 */

/* Widget Container */
.support-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Toggle Button */
.support-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.support-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.support-chat-toggle.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.support-chat-toggle .chat-icon {
    width: 28px;
    height: 28px;
    color: white;
}

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

/* Chat Window */
.support-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.support-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

.chat-avatar svg {
    width: 24px;
    height: 24px;
    color: white;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
    color: white;
}

.chat-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

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

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

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

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

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #a0a0b0;
}

.welcome-message p {
    margin: 8px 0;
}

/* Chat Messages */
.chat-message {
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
    background: #2a2a4a;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.message-content a {
    color: #667eea;
    text-decoration: underline;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

/* Typing Indicator */
.chat-message.typing .typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Feedback */
.message-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-left: 4px;
}

.feedback-label {
    font-size: 11px;
    color: #707090;
}

.feedback-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.feedback-btn svg {
    width: 16px;
    height: 16px;
    color: #707090;
}

.feedback-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.feedback-btn:hover svg {
    color: #667eea;
}

.feedback-btn.helpful:hover svg {
    color: #00d26a;
}

.feedback-btn.not-helpful:hover svg {
    color: #ff4757;
}

.feedback-thanks {
    font-size: 11px;
    color: #00d26a;
}

/* Suggestions */
.chat-suggestions {
    padding: 0 20px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-btn {
    padding: 8px 14px;
    background: #2a2a4a;
    border: 1px solid #3a3a5c;
    border-radius: 20px;
    color: #a0a0b0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #3a3a5c;
    border-color: #667eea;
    color: #e0e0e0;
}

/* Input Area */
.chat-input-area {
    padding: 16px 20px;
    background: #16162a;
    display: flex;
    gap: 12px;
    border-top: 1px solid #2a2a4a;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    background: #2a2a4a;
    border: 1px solid #3a3a5c;
    border-radius: 24px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#chat-input:focus {
    border-color: #667eea;
}

#chat-input::placeholder {
    color: #707090;
}

#chat-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#chat-send:hover {
    transform: scale(1.05);
}

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

#chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .support-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .support-chat-toggle {
        width: 54px;
        height: 54px;
    }

    .support-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        bottom: 70px;
        right: 0;
        border-radius: 12px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input-area {
        padding: 12px 16px;
    }
}
