:root {
    --chat-primary: #8c2772;
    --chat-primary-hover: #a73389;
    --chat-primary-light: rgba(140, 39, 114, 0.12);
    --chat-dark: #111827;
    --chat-light: #f8fafc;
    --chat-surface: #ffffff;
    --chat-border: #e2e8f0;
    --chat-text: #1e293b;
    --chat-text-muted: #64748b;
    --chat-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    --chat-radius: 20px;
    --chat-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-success-bg: #f0fdf4;
    --chat-success-border: #bbf7d0;
    --chat-success-text: #15803d;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

#snash-chatbot {
    position: fixed;
    right: 25px;
    bottom: 95px;
    z-index: 99999;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#chatbot-window {
    width: 390px;
    max-width: calc(100vw - 30px);
    height: 650px;
    max-height: 80vh;
    background: var(--chat-surface);
    border-radius: var(--chat-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--chat-shadow);
    border: 1px solid var(--chat-border);
    animation: chatbotFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden {
    display: none !important;
}

@keyframes chatbotFade {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

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

.chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(140, 39, 114, 0.35);
}

.chat-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chat-header small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--chat-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-actions button:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px;
    background: var(--chat-light);
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

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

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

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#chatbot-messages {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.message-content {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--chat-text);
}

.message-content p {
    margin: 8px 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--chat-text);
    font-weight: 600;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-suggestion {
    border: 1px solid var(--chat-border);
    background: var(--chat-surface);
    color: var(--chat-text);
    border-radius: 50px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--chat-transition);
}

.chat-suggestion:hover {
    background: var(--chat-primary);
    color: #ffffff;
    border-color: var(--chat-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 39, 114, 0.25);
}

.chat-suggestion:active {
    transform: scale(0.96);
}

.user-message,
.bot-message {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    animation: messageIn 0.22s ease-out;
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover));
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 14px rgba(140, 39, 114, 0.28);
    word-break: break-word;
}

.bot-message .message-content {
    background: var(--chat-surface);
    color: var(--chat-text);
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--chat-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    word-break: break-word;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 10px 0 6px;
    font-weight: 700;
    color: inherit;
}

.message-content ul,
.message-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.message-content li {
    margin: 4px 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

.message-content pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content blockquote {
    border-left: 3px solid var(--chat-primary);
    padding-left: 12px;
    margin: 10px 0;
    color: var(--chat-text-muted);
}

.message-content a {
    color: var(--chat-primary);
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.chat-time {
    margin-top: 4px;
    font-size: 11px;
    color: var(--chat-text-muted);
    opacity: 0.8;
    align-self: flex-end;
}

#typing-indicator {
    padding: 0 18px 12px;
    background: var(--chat-light);
}

.typing-wrapper {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.typing-wrapper small {
    font-size: 11px;
    color: var(--chat-text-muted);
}

.typing-bubble {
    display: flex;
    gap: 5px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 18px;
    padding: 10px 14px;
    width: fit-content;
}

.typing-bubble span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.2s infinite;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-footer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 14px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
}

.chat-footer textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--chat-border);
    border-radius: 14px;
    padding: 10px 14px;
    min-height: 42px;
    max-height: 120px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    background: var(--chat-light);
    color: var(--chat-text);
    transition: var(--chat-transition);
    overflow-y: auto;
}

.chat-footer textarea:focus {
    border-color: var(--chat-primary);
    background: var(--chat-surface);
    box-shadow: 0 0 0 3px var(--chat-primary-light);
}

#chatbot-send {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--chat-transition);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(140, 39, 114, 0.3);
}

#chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(140, 39, 114, 0.4);
}

#chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#chatbot-send svg {
    width: 18px;
    height: 18px;
}

.chat-footer-note {
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
    padding: 8px 14px;
    text-align: center;
}

.chat-footer-note small {
    color: var(--chat-text-muted);
    line-height: 1.4;
    font-size: 11px;
}

.booking-form-card {
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    padding: 16px;
    max-width: 100%;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.booking-form-header {
    margin-bottom: 14px;
}

.booking-form-header strong {
    font-size: 14px;
    color: var(--chat-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.booking-form-header p {
    font-size: 12px;
    color: var(--chat-text-muted);
    margin: 4px 0 0;
    line-height: 1.4;
}

.chat-booking-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-booking-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-booking-form label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--chat-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chat-booking-form input,
.chat-booking-form select {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    outline: none;
    background: var(--chat-light);
    color: var(--chat-text);
    transition: var(--chat-transition);
}

.chat-booking-form input:focus,
.chat-booking-form select:focus {
    border-color: var(--chat-primary);
    background: var(--chat-surface);
    box-shadow: 0 0 0 3px var(--chat-primary-light);
}

.btn-submit-booking {
    margin-top: 4px;
    padding: 11px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover));
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--chat-transition);
    box-shadow: 0 4px 12px rgba(140, 39, 114, 0.3);
}

.btn-submit-booking:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(140, 39, 114, 0.4);
}

.btn-submit-booking:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.booking-success {
    font-size: 13px;
    color: var(--chat-success-text);
    background-color: var(--chat-success-bg);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--chat-success-border);
    line-height: 1.5;
}

.book-cta-btn {
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover)) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    cursor: pointer;
    transition: var(--chat-transition) !important;
    box-shadow: 0 4px 12px rgba(140, 39, 114, 0.3) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.book-cta-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(140, 39, 114, 0.45) !important;
}

.floating-contact-buttons {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    align-items: flex-end;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    font-size: 22px;
    transition: var(--chat-transition);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.whatsapp-btn {
    background: #25D366;
}

.call-btn {
    background: var(--chat-primary);
}

.floating-btn:hover {
    color: #ffffff;
    transform: translateY(-3px) scale(1.03);
}

.whatsapp-btn {
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(37, 211, 102, .45),
            0 8px 24px rgba(0, 0, 0, .18);
    }

    70% {
        box-shadow:
            0 0 0 16px rgba(37, 211, 102, 0),
            0 8px 24px rgba(0, 0, 0, .18);
    }

    100% {
        box-shadow:
            0 0 0 0 rgba(37, 211, 102, 0),
            0 8px 24px rgba(0, 0, 0, .18);
    }
}

#chatbot-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-primary-hover));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(140, 39, 114, 0.4);
    transition: var(--chat-transition);
    z-index: 99999;
    font-size: 24px;
}

#chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(140, 39, 114, 0.5);
}

.chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

@media (max-width: 768px) {
    .floating-contact-buttons {
        right: 15px;
        bottom: 15px;
        gap: 10px;
    }

    .floating-btn,
    #chatbot-toggle {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    #snash-chatbot {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
    }

    #chatbot-window {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .chat-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .chat-header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --chat-light: #0b0f17;
        --chat-surface: #151c28;
        --chat-border: #232d3f;
        --chat-text: #e2e8f0;
        --chat-text-muted: #94a3b8;
        --chat-primary-light: rgba(140, 39, 114, 0.25);
        --chat-success-bg: rgba(22, 101, 52, 0.2);
        --chat-success-border: #15803d;
        --chat-success-text: #86efac;
    }

    #chatbot-window {
        background: var(--chat-surface);
    }

    #chatbot-messages {
        background: var(--chat-light);
    }

    .bot-message .message-content,
    .booking-form-card {
        background: var(--chat-surface);
        color: var(--chat-text);
        border-color: var(--chat-border);
    }

    .chat-booking-form input,
    .chat-booking-form select,
    .chat-footer textarea {
        background: #0f172a;
        border-color: var(--chat-border);
        color: #f8fafc;
    }

    .chat-suggestion {
        background: var(--chat-surface);
        color: var(--chat-text);
        border-color: var(--chat-border);
    }

    .chat-footer,
    .chat-footer-note {
        background: var(--chat-surface);
        border-color: var(--chat-border);
    }

    .message-content code {
        background: rgba(255, 255, 255, 0.1);
    }
}
