/* MMA Fight Chatbot — "The Corner" */

.mma-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #E3001C;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(227, 0, 28, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mma-chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(227, 0, 28, 0.55);
}

.mma-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    transition: transform 0.3s ease;
}

.mma-chatbot-toggle.mma-chatbot-open svg {
    transform: rotate(90deg);
}

/* Chat Window */
.mma-chatbot-window {
    position: fixed;
    bottom: 100px;
    left: 24px;
    z-index: 99998;
    width: 380px;
    max-height: 560px;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.mma-chatbot-window.mma-chatbot-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.mma-chatbot-header {
    background: linear-gradient(135deg, #E3001C 0%, #b8001a 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
    flex-shrink: 0;
}

.mma-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mma-chatbot-header-text {
    flex: 1;
    min-width: 0;
}

.mma-chatbot-header-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.mma-chatbot-header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin: 2px 0 0;
    line-height: 1.2;
}

.mma-chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.mma-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mma-chatbot-close svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}

/* Messages Area */
.mma-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    direction: rtl;
    min-height: 300px;
    max-height: 360px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.mma-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

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

.mma-chatbot-messages::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* Message Bubbles */
.mma-chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    animation: mmaChatFadeIn 0.25s ease;
}

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

.mma-chatbot-msg-user {
    align-self: flex-start;
    background: #E3001C;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.mma-chatbot-msg-bot {
    align-self: flex-end;
    background: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #2a2a2a;
    border-bottom-left-radius: 4px;
}

.mma-chatbot-msg-bot strong {
    color: #fff;
    font-weight: 700;
}

.mma-chatbot-msg-bot a {
    color: #E3001C;
    text-decoration: none;
}

.mma-chatbot-msg-bot a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.mma-chatbot-typing {
    align-self: flex-end;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.mma-chatbot-typing-dot {
    width: 7px;
    height: 7px;
    background: #555;
    border-radius: 50%;
    animation: mmaChatTyping 1.4s infinite;
}

.mma-chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.mma-chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Input Area */
.mma-chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    gap: 8px;
    direction: rtl;
    background: #0d0d0d;
    flex-shrink: 0;
}

.mma-chatbot-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    direction: rtl;
    min-height: 40px;
    max-height: 80px;
    line-height: 1.4;
    transition: border-color 0.15s ease;
}

.mma-chatbot-input::placeholder {
    color: #555;
}

.mma-chatbot-input:focus {
    border-color: #E3001C;
}

.mma-chatbot-send {
    background: #E3001C;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    align-self: flex-end;
}

.mma-chatbot-send:hover {
    background: #ff1a35;
}

.mma-chatbot-send:active {
    transform: scale(0.92);
}

.mma-chatbot-send:disabled {
    background: #333;
    cursor: not-allowed;
}

.mma-chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    transform: scaleX(-1);
}

/* Welcome Message */
.mma-chatbot-welcome {
    text-align: center;
    padding: 20px 16px;
    direction: rtl;
}

.mma-chatbot-welcome-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.mma-chatbot-welcome-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.mma-chatbot-welcome-text {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
    line-height: 1.5;
}

.mma-chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mma-chatbot-suggestion {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 9px 14px;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: right;
    direction: rtl;
    font-family: inherit;
}

.mma-chatbot-suggestion:hover {
    background: #222;
    border-color: #E3001C;
    color: #fff;
}

/* Rate limit message */
.mma-chatbot-limit {
    text-align: center;
    padding: 8px 12px;
    background: #1c1c0a;
    color: #cca300;
    font-size: 12px;
    direction: rtl;
    border-top: 1px solid #333;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .mma-chatbot-window {
        width: calc(100vw - 16px);
        left: 8px;
        bottom: 90px;
        max-height: calc(100vh - 120px);
        border-radius: 14px;
    }

    .mma-chatbot-toggle {
        bottom: 16px;
        left: 16px;
        width: 54px;
        height: 54px;
    }

    .mma-chatbot-messages {
        min-height: 200px;
        max-height: calc(100vh - 300px);
    }
}
