/* Mía Chat Widget Styles - Mía 360 Parity */
:root {
    --mia-primary: #A024C0;
    --mia-secondary: #983ca5;
    --mia-bg: #ffffff;
    --mia-text: #2d3436;
    --mia-gray: #dfe6e9;
    --mia-user-bubble: #6c5ce7;
    --mia-user-text: #ffffff;
    --mia-assistant-bubble: #A024C0;
    --mia-assistant-text: #ffffff;
    --mia-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Launcher Button */
.mia-chat-launcher {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 60px !important;
    height: 60px !important;
    background: var(--mia-primary) !important;
    border-radius: 50% !important;
    box-shadow: var(--mia-shadow) !important;
    cursor: pointer !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.mia-chat-launcher:hover {
    transform: scale(1.1);
}

.mia-chat-launcher img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
}

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

/* Chat Widget Window */
.mia-chat-widget {
    position: fixed !important;
    bottom: 90px !important;
    right: 20px !important;
    width: 350px !important;
    height: 500px !important;
    background: var(--mia-bg) !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.mia-chat-widget.collapsed {
    opacity: 0 !important;
    transform: translateY(20px) !important;
    pointer-events: none !important;
    height: 0 !important;
}

/* Header */
.mia-chat-header {
    background: linear-gradient(135deg, var(--mia-primary), var(--mia-secondary)) !important;
    padding: 15px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: white !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.mia-chat-header-info {
    display: flex !important;
    align-items: center !important;
}

.mia-chat-avatar img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    margin-right: 10px !important;
}

.mia-chat-title h4 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
}

.mia-chat-title span {
    font-size: 12px !important;
    opacity: 0.8 !important;
}

.mia-icon-btn {
    background: none !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 18px !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s !important;
    padding: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mia-icon-btn:hover {
    opacity: 1 !important;
}

/* Body */
.mia-chat-body {
    flex: 1 !important;
    padding: 15px !important;
    overflow-y: auto !important;
    background: #fdfdfd !important;
}

.mia-message {
    display: flex !important;
    margin-bottom: 15px !important;
    animation: fadeInMia 0.3s ease !important;
}

.mia-message.user {
    justify-content: flex-end !important;
}

.mia-message.assistant {
    justify-content: flex-start !important;
}

.mia-bubble {
    max-width: 80% !important;
    padding: 10px 15px !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
}

.mia-message.user .mia-bubble {
    background: var(--mia-user-bubble) !important;
    color: var(--mia-user-text) !important;
    border-bottom-right-radius: 2px !important;
}

.mia-message.assistant .mia-bubble {
    background: var(--mia-assistant-bubble) !important;
    color: var(--mia-assistant-text) !important;
    border-bottom-left-radius: 2px !important;
}

/* Footer */
.mia-chat-footer {
    padding: 10px 15px !important;
    background: white !important;
    border-top: 1px solid var(--mia-gray) !important;
}

.mia-input-group {
    display: flex !important;
    align-items: center !important;
    background: #f1f2f6 !important;
    border-radius: 25px !important;
    padding: 5px 15px !important;
}

#mia-chat-input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 10px 5px !important;
    outline: none !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

#mia-chat-send {
    background: var(--mia-primary) !important;
    color: white !important;
    border: none !important;
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s !important;
    padding: 0 !important;
}

#mia-chat-send:disabled {
    background: var(--mia-gray) !important;
    cursor: not-allowed !important;
}

#mia-chat-send:hover:not(:disabled) {
    background: #5649c0 !important;
}

#mia-chat-send svg {
    stroke: white !important;
}

.mia-chat-powered {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 5px !important;
    font-size: 10px !important;
    color: #b2bec3 !important;
    padding: 0 5px !important;
}

/* Typing Indicator */
.rosarito-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rosarito-chat-typing span {
    width: 6px;
    height: 6px;
    background: #b2bec3;
    border-radius: 50%;
    animation: typingMia 1.4s infinite;
}

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

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

@keyframes typingMia {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes fadeInMia {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .mia-chat-widget {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        z-index: 10001 !important;
    }

    .mia-chat-widget.collapsed {
        transform: translateY(100%) !important;
    }

    body.mia-chat-open .mia-chat-launcher {
        display: none !important;
    }
}