/* ==========================================================================
   MATH WITH RAZZ - COMPACT AI FLOATING SUPPORT UI
   ========================================================================== */

.mwr-ai-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1060; /* Ensures visibility above headers and footers */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Action Button Styling */
.mwr-ai-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #761c22 0%, #a8323a 100%);
    border: 2px solid #f1c40f; /* Premium gold accent tint matching brand guidelines */
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(118, 28, 34, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mwr-ai-fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 28, 34, 0.5);
}

.mwr-ai-fab.active {
    transform: rotate(135deg);
    background: #2c3e50;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Chat Card Pane Display Configuration */
.mwr-ai-card {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

/* Header UI Elements */
.mwr-ai-header {
    background: #761c22;
    padding: 16px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #f1c40f;
}

.mwr-ai-avatar-spark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.mwr-ai-title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.mwr-ai-status {
    font-size: 11px;
    opacity: 0.85;
    display: block;
}

.mwr-ai-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.mwr-ai-close-btn:hover {
    opacity: 1;
}

/* Chat Processing Feed Timelines */
.mwr-ai-messages-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mwr-chat-bubble-wrapper {
    display: flex;
    width: 100%;
}

.mwr-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}

.bg-user-context {
    background-color: #761c22;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.bg-ai-context {
    background-color: #ffffff;
    color: #2d3748;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Footer Control Form Elements */
.mwr-ai-footer-form {
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 8px;
    align-items: center;
}

.mwr-ai-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

.mwr-ai-input:focus {
    border-color: #761c22;
}

.mwr-ai-send-btn {
    background: none;
    border: none;
    color: #761c22;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.mwr-ai-send-btn:hover {
    transform: scale(1.1);
}

/* Simple Typographic Loading Dot Frames */
.typing-indicator-dots span {
    height: 6px;
    width: 6px;
    float: left;
    margin: 0 2px;
    background-color: #a8323a;
    border-radius: 50%;
    opacity: 0.4;
    animation: mwrBounce 1s infinite;
}
.typing-indicator-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mwrBounce {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Small Device Responsiveness Adjustments */
@media (max-width: 480px) {
    .mwr-ai-widget-container { bottom: 16px; right: 16px; left: 16px; }
    .mwr-ai-card { width: 100%; height: 420px; bottom: 70px; }
}