.ai-chat-container {
    font-family: inherit;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.ai-chat-toggle {
    background: linear-gradient(135deg,
    rgba(70, 130, 180, 0.9) 0%,
    rgba(100, 149, 237, 0.95) 25%,
    rgba(65, 105, 225, 0.85) 50%,
    rgba(72, 118, 255, 0.9) 75%,
    rgba(70, 130, 180, 0.95) 100%);
    background-size: 400% 400%;
    animation: movingGradient 4s ease-in-out infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(70, 130, 180, 0.4),
    0 4px 16px rgba(70, 130, 180, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.ai-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(70, 130, 180, 0.5),
    0 8px 24px rgba(70, 130, 180, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

@keyframes movingGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.ai-chat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent);
    animation: shimmer 3s infinite;
}

.ai-chat-toggle img {
    max-height: 40px;
    transform: scaleX(-1);
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.ai-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 500px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    background: linear-gradient(135deg, #e1e1fe 0%, #e1e1fe 55%, #e1e1fe 100%);
    color: #615ced;
    padding: .75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-close {
    background: none;
    border: none;
    color: #615ced;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: var(--light-bg);
}

.ai-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg,
    rgba(70, 130, 180, 0.6) 0%,
    rgba(100, 149, 237, 0.7) 50%,
    rgba(70, 130, 180, 0.6) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg,
    rgba(70, 130, 180, 0.8) 0%,
    rgba(100, 149, 237, 0.9) 50%,
    rgba(70, 130, 180, 0.8) 100%);
}

.ai-message,
.user-message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease;
}

.message-content {
    padding: .75rem 1rem;
    border-radius: 1rem;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}

.ai-message .message-content {
    background: white;
    border: 1px solid #e9ecef;
    margin-right: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ChatGPT-like formatting styles */
.ai-message .message-content h1,
.ai-message .message-content h2,
.ai-message .message-content h3,
.ai-message .message-content h4,
.ai-message .message-content h5,
.ai-message .message-content h6 {
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #1a1a1a;
}

.ai-message .message-content h1 {
    font-size: 1.5em;
}

.ai-message .message-content h2 {
    font-size: 1.3em;
}

.ai-message .message-content h3 {
    font-size: 1.2em;
}

.ai-message .message-content h4 {
    font-size: 1.1em;
}

.ai-message .message-content h5 {
    font-size: 1em;
}

.ai-message .message-content h6 {
    font-size: 0.9em;
}

.ai-message .message-content p {
    margin: 8px 0;
    color: #374151;
}

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

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

.ai-message .message-content strong,
.ai-message .message-content b {
    font-weight: 600;
    color: #1a1a1a;
}

.ai-message .message-content ul,
.ai-message .message-content ol {
    margin: 12px 0;
    background: #f9fafb;
    border-radius: 6px;
    padding: .75rem 1rem;
    border-left: 3px solid #e5e7eb;
}

.ai-message .message-content li {
    margin: 6px 0;
    color: #374151;
    line-height: 1.5;
}

.ai-message .message-content ul li {
    list-style-type: disc;
}

.ai-message .message-content ol li {
    list-style-type: decimal;
}

.ai-message .message-content li a {
    color: #2563eb;
    font-weight: 500;
}

.ai-message .message-content blockquote {
    border-left: 4px solid #e5e7eb;
    margin: 16px 0;
    padding: 8px 16px;
    background: #f9fafb;
    font-style: italic;
    color: #6b7280;
}

.ai-message .message-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #1f2937;
}

.ai-message .message-content pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.ai-message .message-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.ai-message .message-content a :not(.room-card a) {
    color: #2563eb;
    text-decoration: none;
}

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

.ai-message .message-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

.ai-message .message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}

.ai-message .message-content th,
.ai-message .message-content td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}

.ai-message .message-content th {
    background: #f9fafb;
    font-weight: 600;
}

/* Contact information styling */
.ai-message .message-content .contact-info {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-message .message-content .contact-item {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.ai-message .message-content .contact-item:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.ai-message .message-content .contact-item strong {
    min-width: 90px;
    margin-right: 12px;
    color: #1f2937;
    font-weight: 600;
}

.ai-message .message-content .contact-item a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ai-message .message-content .contact-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(70, 130, 180, 0.9) 0%, rgba(100, 149, 237, 0.95) 25%, rgba(65, 105, 225, 0.85) 50%, rgba(72, 118, 255, 0.9) 75%, rgba(70, 130, 180, 0.95) 100%);
    background-size: 400% 400%;
    animation: movingGradient 4s ease-in-out infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(70, 130, 180, 0.4), 0 4px 16px rgba(70, 130, 180, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    margin-left: auto;
}

.message-time {
    font-size: 11px;
    color: var(--muted-color);
    margin-top: 5px;
    text-align: right;
}

.ai-message .message-time {
    text-align: left;
}

.ai-chat-input {
    padding: .75rem 1rem;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.input-group {
    display: flex;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    border: 1px solid #DCDCDC;
    border-radius: 20px;
    padding: 0.75rem 1rem;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .25rem rgba(99, 171, 69, .25);
}

.input-group button {
    border-radius: 50%;
    width: 40px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgb(97 92 237 / var(--tw-bg-opacity, 1));
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}

.input-group button:hover {
    transform: scale(1.03);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.quick-action-btn {
    background: #FFF;
    border: 1px solid #d8dae3;
    color: #2b2b31;
    border-radius: 10px;
}

#ai-chat-window input:focus, #ai-chat-window input:focus-visible, #ai-chat-window input:focus-within {
    border-color: #615ced !important;
    box-shadow: 0 0 0 .25rem #e1e1fe !important;
}

#ai-chat-window .room-card {
    -webkit-box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
    -moz-box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
    box-shadow: 0px 5px 10px 2px rgba(34, 60, 80, 0.2);
}


.roomtype-results .swiper-slide {
    margin: 0.5rem 0;
}

.quick-action-btn:hover {
    background: #e1e1fe;
    color: #615ced;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    max-width: 85%;
    margin-right: auto;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

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

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

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

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

@media (max-width: 480px) {
    .ai-chat-window {
        width: 320px;
        height: 450px;
    }
}