/* Chatbot Widget Styles - Miranda Pozuelo */
:root {
    --mp-primary: #1DD1A1;
    --mp-primary-dark: #0FB49B;
    --mp-primary-light: #00E7C7;
    --mp-accent: #FFD700;
    --mp-white: #FFFFFF;
    --mp-gray-50: #F8FAFC;
    --mp-gray-100: #F1F5F9;
    --mp-gray-200: #E2E8F0;
    --mp-gray-300: #CBD5E1;
    --mp-gray-400: #94A3B8;
    --mp-gray-500: #64748B;
    --mp-gray-600: #475569;
    --mp-gray-700: #334155;
    --mp-gray-800: #1E293B;
    --mp-gray-900: #0F172A;
    --mp-font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mp-border-radius: 12px;
    --mp-border-radius-lg: 20px;
    --mp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chatbot Widget Styles */

.mp-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--mp-font-family);
}

.mp-chat-trigger {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-light));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(29, 209, 161, 0.3);
    transition: var(--mp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
}

.mp-chat-trigger::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: rotate(-45deg);
    transition: var(--mp-transition);
}

.mp-chat-trigger:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(29, 209, 161, 0.4);
}

.mp-chat-trigger:hover::before {
    animation: mp-shine 0.6s ease-in-out;
}

@keyframes mp-shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(-45deg); }
}

.mp-chat-trigger.pulse {
    animation: mp-chatPulse 2s infinite;
}

@keyframes mp-chatPulse {
    0% { box-shadow: 0 8px 25px rgba(29, 209, 161, 0.3), 0 0 0 0 rgba(29, 209, 161, 0.7); }
    70% { box-shadow: 0 8px 25px rgba(29, 209, 161, 0.3), 0 0 0 10px rgba(29, 209, 161, 0); }
    100% { box-shadow: 0 8px 25px rgba(29, 209, 161, 0.3), 0 0 0 0 rgba(29, 209, 161, 0); }
}

.mp-chat-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--mp-accent);
    border-radius: 50%;
    color: var(--mp-gray-900);
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: mp-bounce 1s infinite;
}

@keyframes mp-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.mp-chat-notification.show {
    display: flex;
}

.mp-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: var(--mp-border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--mp-gray-200);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: var(--mp-transition);
}

.mp-chat-window.open {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
}

.mp-chat-header {
    background: var(--mp-gray-800);
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--mp-primary);
}

.mp-chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: mp-headerShimmer 4s infinite ease-in-out;
}

@keyframes mp-headerShimmer {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.5; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 1; }
}

.mp-chat-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.mp-chat-info {
    flex: 1;
    position: relative;
    z-index: 2;
}

.mp-chat-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.mp-chat-status {
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-chat-status::before {
    content: '🟢';
    font-size: 0.75rem;
}

.mp-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--mp-transition);
    position: relative;
    z-index: 2;
}

.mp-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mp-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mp-chat-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    background: var(--mp-gray-50);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mp-chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    animation: mp-messageSlideIn 0.5s ease forwards;
}

@keyframes mp-messageSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mp-chat-message.user {
    flex-direction: row-reverse;
}

.mp-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.mp-message-avatar.bot {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-light));
    color: white;
}

.mp-message-avatar.user {
    background: var(--mp-gray-400);
    color: white;
}

.mp-message-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.mp-message-bubble.bot {
    background: white;
    color: var(--mp-gray-700);
    border: 1px solid var(--mp-gray-200);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mp-message-bubble.user {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.mp-typing-indicator {
    display: none;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mp-typing-indicator.active {
    display: flex;
}

.mp-typing-dots {
    background: white;
    border: 1px solid var(--mp-gray-200);
    border-radius: 18px;
    padding: 0.875rem 1.125rem;
    display: flex;
    gap: 4px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mp-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--mp-gray-400);
    border-radius: 50%;
    animation: mp-typing 1.4s infinite ease-in-out;
}

.mp-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.mp-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes mp-typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.mp-chat-input-area {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid var(--mp-gray-200);
}

.mp-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mp-quick-question {
    background: var(--mp-gray-100);
    border: 1px solid var(--mp-gray-200);
    border-radius: 20px;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    color: var(--mp-gray-700);
    cursor: pointer;
    transition: var(--mp-transition);
    white-space: nowrap;
}

.mp-quick-question:hover {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-light));
    color: white;
    border-color: var(--mp-primary);
    transform: translateY(-1px);
}

.mp-chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.mp-chat-input {
    flex: 1;
    border: 2px solid var(--mp-gray-200);
    border-radius: 25px;
    padding: 0.875rem 1.125rem;
    font-size: 0.875rem;
    outline: none;
    transition: var(--mp-transition);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
}

.mp-chat-input:focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px rgba(29, 209, 161, 0.1);
}

.mp-chat-send {
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-dark));
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--mp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.mp-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(29, 209, 161, 0.3);
}

.mp-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mp-welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--mp-gray-500);
}

.mp-welcome-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mp-gray-700);
    margin-bottom: 0.5rem;
}

.mp-welcome-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.mp-chat-footer {
    padding: 0.75rem 1.25rem;
    text-align: center;
    background: var(--mp-gray-50);
    border-top: 1px solid var(--mp-gray-200);
}

.mp-powered-by {
    font-size: 0.75rem;
    color: var(--mp-gray-500);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--mp-transition);
}

.mp-powered-by:hover {
    color: var(--mp-primary);
}

.mp-powered-by .logo-icon {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--mp-primary), var(--mp-primary-light));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
    font-weight: 700;
}

@media (max-width: 768px) {
    .mp-chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    .mp-chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 150px);
        max-width: 380px;
        max-height: 600px;
    }
    .mp-quick-questions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .mp-quick-question {
        text-align: center;
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .mp-chat-trigger {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    .mp-chat-window {
        bottom: 75px;
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
    }
}

.mp-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.mp-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mp-chat-messages::-webkit-scrollbar-thumb {
    background: var(--mp-gray-300);
    border-radius: 2px;
}

.mp-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--mp-gray-400);
}