/**
 * Synthetic Mining Chatbot Widget Styles
 *
 * Modern, responsive chat widget that matches Bootstrap 5 design system.
 */

/* Container */
.synth-chatbot {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.synth-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.synth-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.synth-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.synth-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

/* Chat Window */
.synth-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

/* Dark Theme */
.synth-chatbot-dark .synth-chat-window {
    background: #1a1a1a;
    color: #e0e0e0;
}

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

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

.synth-chat-bot-avatar {
    font-size: 32px;
    line-height: 1;
}

.synth-chat-bot-name {
    font-weight: 600;
    font-size: 16px;
}

.synth-chat-bot-status {
    font-size: 12px;
    opacity: 0.9;
}

.synth-chat-close {
    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;
}

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

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

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

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

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

.synth-chatbot-dark .synth-chat-messages::-webkit-scrollbar-thumb {
    background: #444;
}

/* Message Bubbles */
.synth-chat-message {
    display: flex;
    margin-bottom: 8px;
}

.synth-chat-message-bot {
    justify-content: flex-start;
}

.synth-chat-message-user {
    justify-content: flex-end;
}

.synth-chat-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.synth-chat-message-bot .synth-chat-message-content {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.synth-chatbot-dark .synth-chat-message-bot .synth-chat-message-content {
    background: #2a2a2a;
    color: #e0e0e0;
}

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

/* Typing Indicator */
.synth-chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #f0f0f0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.synth-chatbot-dark .synth-chat-typing {
    background: #2a2a2a;
}

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

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

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

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

/* Input Container */
.synth-chat-input-container {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    background: white;
}

.synth-chatbot-dark .synth-chat-input-container {
    border-top-color: #333;
    background: #1a1a1a;
}

.synth-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

.synth-chatbot-dark .synth-chat-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.synth-chatbot-dark .synth-chat-input:focus {
    border-color: #667eea;
}

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

.synth-chat-send:hover {
    transform: scale(1.1);
}

.synth-chat-send:active {
    transform: scale(0.95);
}

/* Footer */
.synth-chat-footer {
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #e0e0e0;
}

.synth-chatbot-dark .synth-chat-footer {
    border-top-color: #333;
}

/* Responsive */
@media (max-width: 480px) {
    .synth-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 20px;
    }

    .synth-chatbot-bottom-left .synth-chat-window {
        left: 20px;
        right: auto;
    }
}
