/* ========================================
   MUDARTE.VIP CHATBOT - Premium AI Assistant
   Elegant & Sophisticated Design
   ======================================== */

:root {
    --chatbot-primary: #c9a45c;
    --chatbot-primary-dark: #a88947;
    --chatbot-dark: #1a1a1a;
    --chatbot-white: #ffffff;
    --chatbot-gray: #6b6b6b;
    --chatbot-gray-light: #e8e7e3;
    --chatbot-bg: #fafaf8;
}

/* ========================================
   CHATBOT TOGGLE BUTTON
   ======================================== */

.chatbot-toggle {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(201, 164, 92, 0.4);
    z-index: 1001;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: none !important;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(201, 164, 92, 0.5);
}

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chatbot-primary);
    opacity: 0.5;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.chatbot-toggle i {
    position: relative;
    z-index: 1;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ========================================
   CHATBOT WINDOW
   ======================================== */

.chatbot-window {
    position: fixed;
    bottom: 120px;
    right: 2.5rem;
    width: 420px;
    max-width: calc(100vw - 50px);
    height: 650px;
    max-height: calc(100vh - 200px);
    background: var(--chatbot-white);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(201, 164, 92, 0.2);
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   CHATBOT HEADER
   ======================================== */

.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(201, 164, 92, 0.2);
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chatbot-info h3 {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
    font-family: var(--font-serif);
    letter-spacing: 0.02em;
}

.chatbot-status {
    font-size: 0.8125rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 8px #4CAF50;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--chatbot-white);
    font-size: 1.375rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   MESSAGES AREA
   ======================================== */

.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--chatbot-bg);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 164, 92, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 164, 92, 0.5);
}

/* ========================================
   MESSAGE BUBBLES
   ======================================== */

.chatbot-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeInMessage 0.4s ease;
}

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

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201, 164, 92, 0.3);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--chatbot-dark), #2d2d2d);
}

.message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-content p {
    background: var(--chatbot-white);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    font-size: 0.95rem;
    border: 1px solid rgba(201, 164, 92, 0.1);
}

.user-message .message-content p {
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    border: none;
    box-shadow: 0 4px 15px rgba(201, 164, 92, 0.25);
}

.message-time {
    font-size: 0.75rem;
    color: var(--chatbot-gray);
    margin-top: 0.25rem;
    padding: 0 0.5rem;
    font-weight: 300;
}

/* ========================================
   QUICK ACTIONS
   ======================================== */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.quick-action-btn {
    background: var(--chatbot-white);
    border: 1px solid var(--chatbot-gray-light);
    padding: 0.625rem 1rem;
    border-radius: 24px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--chatbot-dark);
    font-weight: 400;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    border-color: var(--chatbot-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 164, 92, 0.3);
}

/* ========================================
   TYPING INDICATOR
   ======================================== */

.chatbot-typing {
    display: flex;
    gap: 0.375rem;
    padding: 1rem 1.25rem;
    background: var(--chatbot-white);
    border-radius: 16px;
    width: fit-content;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(201, 164, 92, 0.1);
}

.chatbot-typing span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    animation: typing-bounce 1.4s ease-in-out infinite;
}

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

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

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

/* ========================================
   INPUT AREA
   ======================================== */

.chatbot-input-area {
    border-top: 1px solid var(--chatbot-gray-light);
    padding: 1.25rem 1.5rem;
    background: var(--chatbot-white);
}

.chatbot-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--chatbot-gray-light);
    border-radius: 28px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--chatbot-bg);
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.1);
    background: var(--chatbot-white);
}

.chatbot-input::placeholder {
    color: var(--chatbot-gray);
    opacity: 0.6;
}

.chatbot-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary-dark), var(--chatbot-primary));
    color: var(--chatbot-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(201, 164, 92, 0.3);
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(201, 164, 92, 0.4);
}

.chatbot-send-btn:active {
    transform: scale(0.95);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */

.error-message {
    background: linear-gradient(135deg, #fee, #fdd);
    color: #c00;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(204, 0, 0, 0.2);
}

.error-message strong {
    font-weight: 600;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }

    .message-content {
        max-width: 80%;
    }
}

@media (max-width: 480px) {
    .chatbot-header {
        padding: 1rem 1.25rem;
    }

    .chatbot-avatar {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
    }

    .chatbot-info h3 {
        font-size: 1rem;
    }

    .chatbot-status {
        font-size: 0.75rem;
    }

    .chatbot-messages {
        padding: 1rem;
        gap: 1rem;
    }

    .quick-action-btn {
        font-size: 0.8125rem;
        padding: 0.5rem 0.875rem;
    }
}

/* ========================================
   SMOOTH ANIMATIONS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
