:root {
    --primary-color: #5F9494;
    --secondary-color: #333333;
    --accent-color: #f5c4c1;
    --bg-color: #fbfbfb;
    --msg-bg-user: #5F9494;
    --msg-text-user: #ffffff;
    --msg-bg-bot: #f8f9fa;
    --msg-text-bot: #333333;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* Chat Layout Fixes for Bootstrap */
.chat-container {
    height: 75vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.chat-history {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: var(--bg-color);
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Added to make offsetTop relative to this container */
}

/* Message Styles */
.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

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

.message-content {
    padding: 0.8rem 1.2rem;
    border-radius: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message .message-content {
    background-color: var(--msg-bg-bot);
    color: var(--msg-text-bot);
    border-bottom-left-radius: 0.3rem;
    border: 1px solid #e9ecef;
}

.user-message .message-content {
    background-color: var(--msg-bg-user);
    color: var(--msg-text-user);
    border-bottom-right-radius: 0.3rem;
}

/* Product Carousel */
.products-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0 1rem 0;
    margin-top: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

.products-carousel::-webkit-scrollbar {
    height: 6px;
}

.products-carousel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.product-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    min-width: 240px;
    max-width: 250px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.product-image {
    height: 180px;
    background-color: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--secondary-color);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-ref {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.product-price {
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-cta {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.product-card:hover .product-cta {
    background-color: #4e7a7a;
    transform: scale(1.05);
}

/* Modal Overlay Fix */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    z-index: 2000;
}

/* Landing Page Specific Style */
.landing-page-gate {
    background-color: #fff !important;
    backdrop-filter: none !important;
}

.landing-page-gate .container-fluid {
    min-height: 100%;
    display: flex;
    align-items: center;
}

.benefit-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--primary-color);
}

/* System Messages */
.system-message {
    align-self: center;
    max-width: 100%;
    margin: 1.5rem 0;
    text-align: center;
}

.system-text {
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.7rem;
    padding: 0.3rem 1rem;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: #4e7a7a !important;
    border-color: #4e7a7a !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-outline-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

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

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

/* Responsive Overrides */
@media (max-width: 768px) {
    .chat-container {
        height: 75vh;
    }

    .message {
        max-width: 90%;
    }
}