:root {
    --primary-color: #007bff;
    --secondary-color: #6c63ff;
    --background-dark: #1a202c;
    --background-card: #2d3748;
    --background-light: #2d3748;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --highlight: #00ccff;
    --accent: #ff3b81;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body {
    background-color:#151e2c;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.metadata-label {
    /*font-size: 11px;*/
    text-transform: uppercase;
    letter-spacing: 1px;
    /*color: var(--text-tertiary);*/
    margin-bottom: 3px;
}

#guided-tour-btn {
    background-color: #2d3748;
    border: 1px solid #00ccff !important;
    color: #e2e8f0;
}

#explore-categories-btn {
    border: 1px solid #007bff !important;
    color: #007bff;
}

#explore-categories-btn:hover {
    --tw-bg-opacity: 1;
    background-color: rgb(1,123,254 / var(--tw-bg-opacity));
}

.custom-category-button:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(1,123,254 / var(--tw-ring-opacity))}

.bg-brand-primary {
    background-color: #007bff;
}

.bg-brand-secondary {
    background-color:#232937;
}

.border-brand-primary {
    border: 1px solid #007bff;
}

.border-brand-highlight {
    border: 1px solid #00ccff;
}

.text-uppercase {
    text-transform: uppercase;
}

/* Override support chat button position for this page */
.support-chat-button-desktop {
    top: 20px !important;
    bottom: auto !important;
    right: 20px !important;
}

.support-chat-button-mobile {
    top: 20px !important;
    right: 20px !important; /* No hamburger menu, so can use right edge */
}

/* Custom slide animation for the drawer */
.drawer-transition {
    transition: transform 0.3s ease-in-out;
}

.drawer-hidden {
    transform: translateX(200%);
}

.drawer-visible {
    transform: translateX(0%);
}

/* Custom slide animation for system chat bubble */
.chat-transition {
    transition: transform 0.8s ease-in-out;
}

.chat-hidden {
    transform: translateX(-200%);
}

.chat-visible {
    transform: translateX(0%);
}

/* Custom animation for smooth expanding */
.transition-max-height {
    transition: max-height 0.4s ease-in-out;
    overflow: hidden;
}

.max-height-0 {
    max-height: 0;
}

.max-height-full {
    max-height: 1150px; /* adjust based on expected content height */
}

.keypoint-span {
    cursor: pointer;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s ease-in-out;
}

.recommendation-card:hover {
    transform: translateY(-2px);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #017bfd; /* Amber color */
    border-radius: 50%;
    opacity: 0.3;
    animation: blink 1.4s infinite;
}

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

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

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.3;
        transform: translateY(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-3px);
    }
    40% {
        opacity: 0.3;
        transform: translateY(0);
    }
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
}

/* For loading indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #017bfd; /* Amber color */
    border-radius: 50%;
    opacity: 0.3;
    animation: blink 1.4s infinite;
}

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

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

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.3;
        transform: translateY(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-3px);
    }
    40% {
        opacity: 0.3;
        transform: translateY(0);
    }
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }
}

/* Sidebar */
.bg-secondary {
    background-color: #1E1E1E;
    color: white !important;
}

/* Responsive layout adjustments */
@media (min-width: 768px) {
    #chat-window {
        padding-top: 2rem;
    }

    /* Adjust chat bubbles to look better in sidebar layout */
    .chat-transition.chat-visible,
    .chat-transition.chat-hidden {
        max-width: calc(100% - 2rem);
    }
}

/* Style the sidebar scrollbar */
#sidebar .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#sidebar .overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

#sidebar .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Highlight active category in sidebar */
#sidebar .custom-category-button.active {
    background-color: #FFC107;
    color: black;
    font-weight: bold;
}

/* Style the scrollable categories container */
#more-categories .max-h-64 {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#more-categories .max-h-64::-webkit-scrollbar {
    width: 6px;
}

#more-categories .max-h-64::-webkit-scrollbar-track {
    background: transparent;
}

#more-categories .max-h-64::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#more-categories .max-h-64::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Toast notification styling */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 12000;
}

.toast {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    transform: translateX(120%);
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background-color: #10B981;
    color: white;
}

.toast-error {
    background-color: #EF4444;
    color: white;
}

.toast-icon {
    margin-right: 12px;
    font-size: 20px;
}

.toast-message {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: currentColor;
    opacity: 0.7;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    margin-left: 8px;
}

.toast-close:hover {
    opacity: 1;
}


/* Mobile-specific text handling */
@media (max-width: 767px) {
    .text-sm {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Ensure images don't overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix for recommendation cards */
    .bg-white.rounded-lg {
        width: 100%;
        overflow: hidden;
    }

    /* Make logo container smaller on mobile */
    .w-24.h-24.flex-shrink-0 {
        width: 4rem;
        height: 4rem;
        margin-bottom: 0.5rem;
    }
}

/* Add this to your Mobile-specific text handling CSS */
@media (max-width: 767px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
        width: 100%;
        max-width: 100vw;
    }

    /* Fix content width inside chat bubbles */
    #chat-window .bg-black,
    #chat-window .bg-secondary {
        width: 100% !important;
        box-sizing: border-box;
        padding: 10px !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }

    /* Adjust the chat window padding */
    #chat-window {
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }
}

@media (max-width: 767px) {
    #chat-window {
        padding-bottom: 80px !important; /* Add space at bottom for input box */
    }

    /* Fix for the last chat message margin */
    #chat-window > div:last-child {
        margin-bottom: 80px !important;
    }
}

@media (max-width: 767px) {
    /* Fix for recommendation cards */
    .bg-white.rounded-lg {
        width: 100% !important;
        padding: 12px !important;
        box-sizing: border-box;
    }

    /* Make flex containers stack on mobile */
    .flex.items-center.gap-6 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Smaller logo container on mobile */
    .w-24.h-24.flex-shrink-0 {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 8px !important;
    }

    /* Adjust content container to take full width */
    .flex-grow {
        width: 100% !important;
    }
}
