/* ============================================
   AI ASSISTANT - MODERN CHAT INTERFACE
   ============================================ */

:root {
    --ai-primary: #4CAF50;
    --ai-primary-darker: #3e8e41;
    --ai-primary-light: #e8f5e9;
    --ai-primary-hover: #43a047;
    --ai-primary-dark: #2e7d32;
    --ai-primary-dark-hover: #1b5e20;
    --ai-bg: #f8fafc;
    --ai-lighter-bg: #f8f8f8;
    --ai-chat-bg: #ffffff;
    --ai-user-bubble: #1a1a1a;
    --ai-assistant-bubble: #f5f5f5;
    --ai-text: #1e293b;
    --ai-text-dark: #495057;
    --ai-text-light: #6c6c6c;
    --ai-text-muted: #9ca3af;
    --ai-border: #e5e7eb;
    --ai-border-light: #f3f4f6;
    --ai-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ai-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --ai-radius: 16px;
    --ai-radius-sm: 12px;
    --sidebar-width: 320px;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.ai-assistant-wrapper {
    display: flex;
    height: calc(var(--vh, 100vh) - 150px);
    padding-bottom: 20px;
    font-family: 'commonNovaKola', sans-serif;
    /* Prevent scroll chaining to page */
    overscroll-behavior: contain;
}

/* ============================================
   SIDEBAR
   ============================================ */
.ai-sidebar-content-container {
    background: #f0f0f0;
    border-radius: 25px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex: 1;
    width: 350px;
    overflow: hidden;
    position: relative;
}

.ai-sidebar {
    margin-left: 30px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* Make sidebar sticky so it stays in view while scrolling */
    position: sticky;
    height: 100%;
    align-self: flex-start;
}

.ai-sidebar-header {
    padding: 10px 0 15px 0;
}

.ai-sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ai-text-light);
    margin: 0;
}

.ai-sidebar-content {
    flex: 1;
    overflow-y: auto;
    /* Hide scrollbar but keep scroll functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.ai-sidebar-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Chat History List */
.chat-history-list {
    position: relative;
}

.chat-history-loading {
    color: var(--ai-text-muted);
    font-size: 0.875rem;
}

.chat-history-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--ai-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: start;
    gap: 10px;
}

.chat-history-item:hover {
    background-color: var(--ai-chat-bg);
}

.chat-history-item.active {
    background-color: var(--ai-chat-bg);
}

.chat-history-item.active svg path {
    fill: var(--ai-primary);
}

.chat-history-item.active .chat-history-title {
    color: var(--ai-primary);
}

.chat-history-item-content {
    flex: 1;
}

.chat-history-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.chat-history-date {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Legacy conversation item classes (kept for compatibility) */
.ai-conversation-item {
    padding: 14px 16px;
    border-radius: var(--ai-radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-conversation-item:hover {
    background: var(--ai-border-light);
}

.ai-conversation-item.active {
    background: var(--ai-primary-light);
}

.ai-conversation-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ai-text);
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-conversation-date {
    font-size: 0.75rem;
    color: var(--ai-text-muted);
}

/* Sidebar Footer */
.ai-sidebar-footer {
    /* border-top: 1px solid var(--ai-border-light); */
    margin-top: auto;
    padding-top: 10px;
    position: relative;
    /* Push to bottom */
}

.ai-daily-limit {
    margin-bottom: 16px;
    padding: 20px;
    font-size: 0.85rem;
    border-radius: 15px;
    background: var(--ai-lighter-bg);
}

.ai-daily-limit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-daily-limit-count {
    font-size: 0.875rem;
    color: var(--ai-text-muted);
}

.ai-daily-limit-remaining {
    color: #6c6c6c;
    padding-bottom: 10px;
}

.ai-daily-limit-remaining span {
    /* font-weight: 600; */
    color: #6c6c6c;
}

.ai-daily-limit-bar {
    height: 4px;
    background: var(--ai-border);
    border-radius: 2px;
    overflow: hidden;
}

.ai-daily-limit-progress {
    height: 100%;
    background: var(--ai-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.ai-sidebar-illustration {
    text-align: center;
    padding: 20px 0;
}

.ai-sidebar-illustration img,
.ai-sidebar-illustration svg {
    max-width: 200px;
    height: auto;
    max-height: 150px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.ai-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 0 48px;
    width: 100%;
    height: 100%;
    align-self: flex-start;
    /* Prevent scroll chaining */
    overscroll-behavior: contain;
}

/* ============================================
   WELCOME SCREEN
   ============================================ */

.ai-welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 30px !important;
}

.ai-welcome-screen.hidden {
    display: none;
}

.ai-welcome-input-wrapper {
    width: 100%;
    position: relative;
    margin-bottom: 24px;
    border-width: 0px !important;
}

.ai-welcome-input {
    width: 100%;
    padding: 20px 70px 20px 20px;
    /* Right padding for send button */
    border-radius: 15px;
    border: 1px solid var(--ai-border);
    background: #f0f0f0;
    outline: none;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.ai-welcome-input:focus {
    border-color: var(--ai-border);
    outline: none;
    box-shadow: none;
    color: var(--ai-text-dark) !important;
    font-weight: 400 !important;
}

.ai-welcome-send-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--ai-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.ai-welcome-send-btn:hover {
    background: var(--ai-primary-light);
}

.ai-welcome-send-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.beta-version-text {
    color: #ff9800;
}

.quick-start-options-title {
    font-size: 1rem;
    color: #6c6c6c;
}

.ai-quick-start-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ai-quick-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: #ffffff;
    color: #6c6c6c;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-quick-start-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}
.ai-quick-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   CHAT CONTAINER
   ============================================ */

.ai-chat-container {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    /* Prevent scroll chaining */
    overscroll-behavior: contain;
    /* Safari touch scrolling fix */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.ai-chat-container.active {
    display: flex;
}

/* Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 0;
    /* Prevent scroll chaining to parent containers */
    overscroll-behavior: contain;
    /* Safari smooth scrolling - critical for Safari touch scrolling */
    -webkit-overflow-scrolling: touch;
    /* Ensure touch events are handled correctly */
    touch-action: pan-y;
    /* Hide scrollbar but keep scroll functionality */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.ai-chat-messages::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

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

.ai-message {
    display: flex;
    margin-bottom: 32px;
    animation: fadeInUp 0.3s ease-out;
}

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

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

.ai-message.user {
    justify-content: flex-end;
}

.ai-message.assistant {
    justify-content: flex-start;
}

.ai-message-content {
    width: 100%;
    font-size: 1rem;
    line-height: 1.7;
}

.ai-message.user .ai-message-content {
    background: #f0f2f5;
    color: var(--ai-text-dark);
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 600px;
}

.ai-message.assistant .ai-message-content {
    color: var(--ai-text);
    font-size: 1rem;
}

.ai-message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.ai-message.user .ai-message-avatar {
    display: none;
}

/* Message Text */
.ai-message-content:has(.ai-typing-indicator):not(:has(.ai-cars-container)) {
    display: flex;
    align-items: center;
}

.ai-message-text:has(.ai-typing-indicator) {
    margin-bottom: 0px;
}

.ai-message-text {
    margin-bottom: 24px;
    display: flex;
    max-width: 85%;
}

.ai-message-text p {
    font-size: 1.1rem;
    margin: 0;
    color: var(--ai-text-light);
}

/* Verbatim inventory tip (appended by ai-sales-agent); styled in JS via .ai-inventory-choose-hint */
.ai-message-text .ai-inventory-choose-hint {
    display: block;
    margin-top: 0.65em;
    font-size: 0.85em;
    font-style: italic;
    line-height: 1.45;
}

.ai-message-text a {
    color: var(--ai-primary);
    text-decoration: underline;
}

.ai-message-text a:hover {
    color: var(--ai-primary-hover);
}

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

.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--ai-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ============================================
   CHAT LOADING SPINNER
   ============================================ */

.ai-chat-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

.ai-loading-spinner-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--ai-text-light);
    font-size: 0.9rem;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ai-border);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   SIMILARITY TABS (Euclidean vs Cosine)
   ============================================ */

.ai-similarity-tabs-container {
    margin-top: 16px;
}

.ai-similarity-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.ai-similarity-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.ai-similarity-tab:hover {
    color: var(--ai-primary);
}

.ai-similarity-tab.active {
    color: var(--ai-primary);
    font-weight: 600;
    border-bottom-color: var(--ai-primary);
}

.ai-similarity-grid {
    margin-top: 0;
}

/* ============================================
   CAR CARDS GRID
   ============================================ */

.ai-cars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 16px;
    padding-left: 62px;
}

.ai-car-card {
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 17px;
    background-color: #fafafa;
    padding: 15px;
}

/* Skeleton Card Styles */
.ai-car-card-skeleton {
    cursor: default;
    pointer-events: none;
}

.ai-car-card-skeleton:hover {
    transform: none;
}

.ai-car-image-skeleton {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 15px;
    animation: shimmer 1.5s infinite;
}

.ai-car-card-title-skeleton {
    height: 20px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 12px;
    width: 80%;
    animation: shimmer 1.5s infinite;
}

.ai-spec-item-skeleton {
    height: 14px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 6px;
    width: 60%;
    animation: shimmer 1.5s infinite;
}

.ai-spec-item-skeleton:nth-child(2) {
    width: 70%;
    animation-delay: 0.2s;
}

.ai-spec-item-skeleton:nth-child(3) {
    width: 50%;
    animation-delay: 0.4s;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Not Found Card Styles */
.ai-car-card-not-found {
    cursor: default;
    pointer-events: none;
    opacity: 0.7;
}

.ai-car-card-not-found:hover {
    transform: none;
}

.ai-car-image-not-found {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.ai-car-image-not-found svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.ai-car-card-title-not-found {
    font-weight: 600;
    font-size: 1rem !important;
    margin: 0 0 8px 0;
    color: var(--ai-text-light);
    text-align: center;
}

.ai-spec-item-not-found {
    color: #999;
    font-size: 0.875rem;
    text-align: center;
    font-style: italic;
}

.ai-car-card:hover {
    /* transform: translateY(-2px); */
    background-color: #f5f5f5;
}

.ai-car-card:hover .ai-car-image {
    filter: brightness(0.95);
}

/* When hovering the card, apply button hover effect */
.ai-car-card:hover .ai-car-select-btn {
    background: transparent;
    transform: scale(1.12);
    box-shadow: none;
}

/* When hovering the button, apply card hover effect */
.ai-car-card:has(.ai-car-select-btn:hover) {
    background-color: #f5f5f5;
}

.ai-car-card:has(.ai-car-select-btn:hover) .ai-car-image {
    filter: brightness(0.95);
}

.ai-car-card.selected {
    /* border: 2px solid var(--ai-primary); */
    border-radius: 17px;
    background: linear-gradient(120deg, #4CAF50 0, #EBF8EB 30%) !important
}

.ai-car-image-container {
    position: relative;
    width: 200px;
    height: 150px;
    background: transparent;
    flex-shrink: 0;
}

.ai-car-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

/* Selection Button in top-left corner - positioned relative to card */
.ai-car-select-btn {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: none;
    overflow: visible;
}

.ai-car-select-btn:hover {
    background: transparent;
    transform: scale(1.12);
    box-shadow: none;
}

.ai-car-select-btn .ai-select-icon-pitaj {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
}

.ai-car-select-btn .ai-select-icon-pitaj--selected {
    display: none;
}

.ai-car-card.selected .ai-car-select-btn .ai-select-icon-pitaj--default {
    display: none;
}

.ai-car-card.selected .ai-car-select-btn .ai-select-icon-pitaj--selected {
    display: block;
}

.ai-car-select-btn .ai-select-icon-check {
    color: #fff;
    display: none;
    position: absolute;
    z-index: 1;
    width: 30px;
    height: 30px;
}

.ai-car-card.selected .ai-car-select-btn {
    background: transparent;
    box-shadow: none;
}

.ai-car-card.selected .ai-car-select-btn .ai-select-icon-check {
    display: block;
    color: var(--ai-primary-dark);
    width: 35px;
    height: 35px;
    margin-top: -16px;
}

.ai-price-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: white;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--ai-primary);
    border-radius: 0 15px 0 15px;
}

.ai-price-overlay .price-details {
    font-size: 0.6rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
}

.ai-car-card-body {
    padding: 5px 15px;
    flex: 1;
    min-width: 0
}

.ai-car-card-title {
    font-weight: 700;
    font-size: 1rem !important;
    margin: 0 0 8px 0;
    color: var(--ai-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-specs-container {
    display: flex;
    flex-direction: column;
    /* gap: 6px; */
}

.ai-spec-item {
    display: flex;
    align-items: center;
}

.ai-spec-item svg {
    width: auto;
    height: 14px;
    fill: #6c6c6c !important;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Action buttons on grid car cards (details, similar) – visible before selecting with + */
.ai-car-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

/* Details button positioned at bottom right of card */
.ai-car-card-details-btn-wrapper {
    position: absolute;
    bottom: 0px;
    right: 0px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border-radius: 15px 0 15px 0;
    padding: 6px;
    padding-bottom: 12px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.ai-car-card-details-btn-wrapper:hover {
    background: #e8e8e8;
}

.ai-car-card-details-label {
    padding: 4px 8px 0 8px;
    color: var(--ai-primary);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ai-car-card-details-btn-wrapper:hover .ai-car-card-details-label {
    opacity: 1;
    transform: translateY(0);
}

.ai-car-card-details-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    color: var(--ai-primary);
    transition: all 0.2s ease;
    pointer-events: none;
}

.ai-car-card-details-btn-wrapper:hover .ai-car-card-details-btn {
    background: none;
    transform: scale(1.2);
}

.ai-car-card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.ai-car-card-action-btn-details {
    background: #e8e8e8;
    color: #444;
}

.ai-car-card-action-btn-details:hover {
    background: #ddd;
    color: #222;
}

.ai-car-card-action-btn-primary {
    background: var(--ai-primary);
    color: #fff;
}

.ai-car-card-action-btn-primary:hover {
    background: #3da83d;
    color: #fff;
    box-shadow: 0 2px 8px rgba(77, 188, 77, 0.35);
}

.ai-expand-cars-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.ai-expand-cars-btn {
    background-color: transparent !important;
    border: none;
    /* color: #4CAF50; */
    color: #3c3c3c;
    font-size: 1rem;
    /* make it not active */
    cursor: none;
}

.ai-expand-cars-btn:hover {
    cursor: default !important;
}

.ai-car-link-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--ai-primary);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.ai-car-link-btn:hover {
    background: var(--ai-primary-hover);
    color: white !important;
}

/* ============================================
   MOBILE SIDEBAR OVERLAY (Hidden on desktop)
   ============================================ */

.ai-sidebar-overlay {
    display: none;
}

/* ============================================
   WELCOME SCREEN SIDEBAR TOGGLE BUTTON
   ============================================ */

.ai-sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px auto 0;
    padding: 12px 24px;
    background: var(--ai-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'commonNovaKola', sans-serif;
}

.ai-sidebar-toggle-btn:hover {
    background: var(--ai-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-sidebar-toggle-btn svg {
    width: 20px;
    height: 20px;
}

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

.ai-chat-input-area {
    /* padding: 20px 0; */
    flex-shrink: 0;
    position: sticky;
    bottom: 0px;
    z-index: 10;
    /* Prevent scroll chaining - don't let scroll events propagate to page */
    overscroll-behavior: none;
    /* Prevent input area from capturing scroll when input is focused */
    overscroll-behavior-y: none;
}

/* Ensure parent flex container allows proper spacing */
.ai-chat-input-area > .d-flex {
    gap: 0;
    flex-wrap: nowrap;
}

/* Prevent input container from causing page scroll when input is focused */
.ai-chat-input-area:has(.ai-chat-input:focus) {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}


.ai-chat-input-icon {
    color: var(--ai-primary);
    display: flex;
    align-items: center;
}

.ai-chat-input-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ai-chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: white;
    min-height: 24px;
    resize: none;
    min-width: 0;
    /* Prevent input from capturing scroll events that cause page scroll */
    overscroll-behavior: none;
    font-weight: 300;
    letter-spacing: 0.01em;
    color: var(--ai-primary) !important;
}

.ai-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ai-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    background: none;
    border-width: 0px !important;
    color: white;
}

.ai-chat-send-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.ai-chat-send-btn:disabled {
    cursor: not-allowed;
    transform: none;
}

.ai-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ai-new-chat-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-decoration: none !important;
    border-radius: 12px;
    /* Prevent button from shrinking */
    flex-shrink: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-new-chat-btn:hover {
    color: var(--ai-primary);
}

.ai-new-chat-icon {
    display: none;
}

.ai-input-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 12px;
    padding: 0;
    width: 100%;
}

/* ============================================
   SELECTED CARS PREVIEW (vehicle card design)
   ============================================ */

.ai-selected-preview {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-bottom: 0;
    background: linear-gradient(90deg, var(--ai-primary) 0%, var(--ai-primary-darker) 100%);
    border-radius: 20px 20px 0 0;
}

/* Style input with green gradient all the time */
#regularChatInputWrapper {
    background: linear-gradient(90deg, var(--ai-primary) 0%, var(--ai-primary-darker) 100%);
    border-radius: 20px;
    padding: 20px;
    padding-left: 50px;
    gap: 0;
    position: relative;
}

/* When cars are selected, adjust border radius to connect with preview */
#regularChatInputWrapper.has-selected-cars {
    border-radius: 0 0 20px 20px;
    padding-top: 10px;
    margin-top: 0;
}

#regularChatInputWrapper.has-selected-cars .ai-selected-preview-sparkles {
    top: 30px;
}

#regularChatInputWrapper > .d-flex {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Input container styles - consolidated since it's always inside regularChatInputWrapper */
#regularChatInputWrapper .ai-chat-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 12px;
    padding: 8px 8px 8px 20px;
    /* Prevent scroll events from propagating when input is focused */
    overscroll-behavior: none;
    /* Allow flex shrinking to make room for button */
    flex: 1;
    min-width: 0;
}

#regularChatInputWrapper.has-selected-cars .ai-chat-input-container {
    margin-bottom: 0;
}

#regularChatInputWrapper .ai-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Send button always white on green background */
#regularChatInputWrapper .ai-chat-send-btn {
    color: white;
}

#regularChatInputWrapper .ai-chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#regularChatInputWrapper.has-selected-cars .ai-selected-preview-info-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

#regularChatInputWrapper.has-selected-cars .ai-selected-preview-info-icon svg {
    width: 14px;
    height: 14px;
}

#regularChatInputWrapper.has-selected-cars .ai-selected-preview-info-text {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    flex: 1;
}


/* Top Section: Car Selection and Comparison Bar */
.ai-selected-preview-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    flex-wrap: wrap;
    margin-top: -25px;
    padding: 5px 20px;
    margin-bottom: 0;
}

/* Apply margin-top to all direct children */
.ai-selected-preview-top > * {
    margin-top: 30px;
}

/* Car image container should extend upward */
.ai-selected-preview-top > .ai-selected-cars-scroll-container {
    margin-top: 0px;
}
.ai-selected-preview-top > .ai-selected-cars-scroll-container .ai-selected-car-actions {
    margin-top: 25px;
}

.ai-selected-preview-sparkles {
    display: flex;
    gap: 4px;
    color: white;
    opacity: 0.9;
    position: absolute;
    top: 40px;
    left: 10px;
    transform: translateY(-50%);
    z-index: 1;
}


.ai-selected-preview-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-selected-preview-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.ai-selected-preview-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-selected-preview-nav-btn svg {
    width: 16px;
    height: 16px;
}

.ai-selected-cars-scroll-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ai-selected-cars-list {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 5px 0;
}

.ai-selected-cars-list::-webkit-scrollbar {
    display: none;
}

/* Circular car thumbnails */
.ai-selected-vehicle-card-inline {
    position: relative;
    width: 80px;
    height: 80px;
}

.ai-selected-card-image-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.ai-selected-card-image-wrap:hover {
    transform: scale(1.05);
}

.ai-selected-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Orange X button on top-right of circular thumbnail */
.ai-selected-card-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff9800;
    border: 0px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.15s ease;
    z-index: 10;
}

.ai-selected-card-remove:hover {
    background: #f57c00;
    transform: scale(1.1);
}

.ai-selected-card-remove svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

/* Wrapper for car card and action buttons */
.ai-selected-vehicle-card-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 0 0 auto;
}

/* Action buttons for each car */
.ai-selected-car-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.ai-selected-car-action-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.ai-selected-car-action-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--ai-primary-dark);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 10px;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    left: 0;
    top: 0;
}

.ai-selected-car-action-btn:hover {
    width: 120px;
    padding: 0 12px;
    border-radius: 20px;
    z-index: 100;
    transform: none;
    gap: 8px;
}

.ai-selected-car-action-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: none;
}

.ai-selected-car-action-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.15s ease 0s, max-width 0.15s ease 0s;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.ai-selected-car-action-btn:hover .ai-selected-car-action-text {
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.3s ease 0.15s, max-width 0.3s ease 0.15s;
}

/* Compare button */
.ai-selected-preview-compare-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--ai-primary-dark);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-selected-preview-compare-btn:hover {
    background: var(--ai-primary-dark-hover);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Input wrapper in top section */
.ai-selected-preview-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    min-height: 48px;
    min-width: 200px;
}

.ai-selected-preview-input-wrapper .ai-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    font-size: 0.95rem;
    font-weight: 300;
    padding: 0;
    min-width: 0;
}

.ai-selected-preview-input-wrapper .ai-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.ai-selected-preview-input-wrapper .ai-chat-send-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.ai-selected-preview-input-wrapper .ai-chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.ai-selected-preview-input-wrapper .ai-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ai-selected-preview-new-chat-btn {
    padding: 10px 20px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-selected-preview-new-chat-btn:hover {
    background: #1b5e20;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ai-selected-preview-new-chat-btn .ai-new-chat-icon {
    display: none;
}

/* Bottom Section: Information Message (inside input wrapper) */

.ai-selected-preview-info-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-selected-preview-info-icon svg {
    width: 14px;
    height: 14px;
}

.ai-selected-preview-info-text {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    flex: 1;
}

/* Legacy styles for backward compatibility */
.ai-selected-vehicle-card {
    position: relative;
}

/* Mobile: Move button to left and make it icon-only */
@media (max-width: 1024px) {
    #regularChatInputWrapper {
        flex-direction: row;
        padding-left: 20px;
    }

    .ai-selected-preview-sparkles {
        display: none;
    }

    .ai-spec-item svg {
        margin-right: 2px;
    }

    .ai-new-chat-btn {
        order: -1;
        margin-left: 0;
        margin-right: 6px;
        padding: 8px;
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 50%;
        background: var(--ai-bg);
        color: #4DBC4D;
        opacity: 0.7;
        justify-content: center;
        align-items: center;
    }
    
    .ai-new-chat-text {
        display: none;
    }
    
    .ai-new-chat-icon {
        display: block;
    }
    
    .ai-new-chat-btn:hover {
        opacity: 0.9;
        background: var(--ai-bg);
        text-decoration: none;
        color: #4DBC4D;
    }
    
    .ai-new-chat-btn:active {
        opacity: 1;
        background: var(--ai-bg);
        color: #4DBC4D;
    }
}

/* Keep selected cars layout like desktop on mobile; allow horizontal scroll if needed */
@media (max-width: 768px) {
    .ai-selected-preview {
        padding: 0px;
        margin-bottom: -1px;
    }

    .ai-selected-preview-top {
        flex-wrap: wrap;
        gap: 6px;
        padding: 3px 12px;
        margin-top: -20px;
    }

    .ai-selected-preview-top > * {
        margin-top: 20px;
    }

    .ai-selected-preview-top > .ai-selected-cars-scroll-container .ai-selected-car-actions {
        margin-top: 18px;
    }

    .ai-selected-preview-nav-btn {
        width: 28px;
        height: 28px;
    }

    .ai-selected-preview-nav-btn svg {
        width: 12px;
        height: 12px;
    }

    .ai-selected-preview-compare-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .ai-selected-preview-new-chat-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .ai-selected-preview-input-wrapper {
        width: 100%;
        min-width: 0;
        padding: 6px 10px;
        min-height: 40px;
    }

    .ai-selected-preview-input-wrapper .ai-chat-input {
        font-size: 0.85rem;
    }

    .ai-selected-preview-input-wrapper .ai-chat-send-btn {
        width: 28px;
        height: 28px;
    }

    .ai-selected-preview-input-wrapper .ai-chat-send-btn svg {
        width: 16px;
        height: 16px;
    }

    .ai-selected-vehicle-card-inline {
        width: 60px;
        height: 60px;
    }

    .ai-selected-card-image-wrap {
        width: 60px;
        height: 60px;
    }

    .ai-selected-card-remove {
        width: 20px;
        height: 20px;
    }

    .ai-selected-card-remove svg {
        width: 10px;
        height: 10px;
    }

    .ai-selected-car-action-wrapper {
        width: 32px;
        height: 32px;
    }

    .ai-selected-car-action-btn {
        width: 32px;
        height: 32px;
        padding: 0 8px;
    }

    .ai-selected-car-action-btn:hover {
        width: 100px;
        padding: 0 10px;
    }

    .ai-selected-car-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .ai-selected-car-action-text {
        font-size: 0.75rem;
    }

    .ai-selected-cars-list {
        gap: 8px;
        padding: 3px 0;
    }
}

.login-register-block a {
    vertical-align: middle;
    font-weight: bold;
    color: var(--ai-primary);
    text-decoration: none;
}

.login-register-block a:hover {
    text-decoration: underline;
}
.sidebar-image-illustration {
   position: absolute;
   right: -180px;
   bottom: 10px;
}
.sidebar-image-illustration img {
   max-width: 300px;
   opacity: 0.75;
}
/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1700px) {
    .ai-cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1250px) {
    .ai-cars-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .ai-assistant-wrapper {
        margin-top: 43px;
    }
}

@media (max-width: 1024px) {
    .ai-cars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding-left: 0;
    }

    .ai-message-text {
        max-width: 100%;
    }

    .ai-sidebar-toggle-btn {
        display: flex;
    }

    .ai-sidebar-content-container {
        background: #f0f0f0;
        border-radius: 25px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        flex: 1;
    }
    .ai-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        /* width: 320px; */
        height: var(--vh, 100vh);
        z-index: 1000;
        margin-left: 0;
        transition: left 0.3s ease-in-out;
        overflow: hidden;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        align-self: flex-start;
    }

    .ai-sidebar.open {
        left: 0;
    }

    .ai-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .ai-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .ai-sidebar-close {
        display: block !important;
        font-size: 32px;
        line-height: 1;
        padding: 0;
        margin: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ai-sidebar-close:hover {
        color: #333;
    }

    .ai-sidebar-header {
        flex-shrink: 0;
        padding-top: 0;
    }

    .ai-sidebar-header h2 {
        padding: 0;
    }

    .ai-sidebar-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }

    .ai-sidebar-footer {
        flex-shrink: 0;
        padding-bottom: 20px;
    }
    
    .ai-daily-limit-remaining, .ai-welcome-screen p {
        font-size: 0.9rem !important;
    }
    .ai-main-content {
        padding: 0 16px;
        /* Adjust height for mobile header */
        max-height: calc(var(--vh, 100vh) - 80px);
        height: calc(var(--vh, 100vh) - 80px);
    }

    .ai-message.assistant {
        flex-direction: column;
        justify-content: flex-start;
    }

    .ai-assistant-wrapper {
        margin-top: 0px;
    }

    .ai-input-hint {
        display: none;
    }

    .text-muted {
        font-size: 1rem !important;
        padding-bottom: 15px;
    }

    .ai-welcome-title {
        font-size: 2rem;
    }

    .ai-car-card,
    .ai-car-card-skeleton,
    .ai-car-card-not-found {
        flex-direction: column;
        align-items: stretch;
    }

    .ai-car-image-container {
        width: 100%;
        height: 150px;
    }

    .ai-car-card-body {
        padding: 10px 5px;
    }

    .ai-specs-container {
        /* display: grid; */
        /* grid-template-columns: repeat(2, 1fr); */
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2px;
    }

    .ai-car-card-not-found .ai-specs-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ai-car-card-title-skeleton, .ai-spec-item-skeleton, .ai-spec-item-skeleton:nth-child(2), .ai-spec-item-skeleton:nth-child(3) {
        width: 100%;
    }

    .ai-message-content {
        width: 100%;
    }

    .ai-chat-input-area {
        padding: 5px 0 10px 0;
    }

    .ai-chat-send-btn {
        height: 30px;
    }

    /* .ai-car-select-btn {
        left: 5px;
    } */
}

@media (max-width: 768px) {
    /* .ai-cars-grid {
        grid-template-columns: 1fr;
    } */

    .ai-quick-start-options {
        justify-content: flex-start;
    }

    .ai-quick-start-btn {
        flex: 0 0 calc(50% - 5px);
        box-sizing: border-box;
        min-width: 0;
        text-align: start;
        min-height: 80px;
    }

    #regularChatInputWrapper .ai-chat-input-container {
        padding: 6px 6px 6px 12px;
        gap: 6px;
    }

    .ai-new-chat-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 6px;
        margin-right: 0px;
    }
}

@media (max-width: 480px) {
    .ai-welcome-title {
        font-size: 1.5rem;
    }

    .ai-welcome-subtitle {
        font-size: 0.75rem;
    }
}

/* ============================================
   STREAMING CURSOR ANIMATION
   ============================================ */

/* Hide cursor when typing indicator is visible */
#streamingMessage .ai-message-text.typing-active::after {
    display: none !important;
    content: none !important;
}

#streamingMessage .ai-message-text::after {
    content: '▋';
    display: inline-block;
    color: var(--ai-primary);
    animation: blink-cursor 0.8s infinite;
    margin-left: 2px;
    font-weight: normal;
}

@keyframes blink-cursor {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0;
    }
}

/* Smooth text appearance during streaming */
#streamingMessage .ai-message-text {
    animation: fadeIn 0.1s ease-in;
}

/* Cars container animation during streaming */
#streamingMessage .ai-cars-container .ai-car-card {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   PAGINATION CONTROLS
   ============================================ */

.ai-pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 16px 0;
}

.ai-pagination-info {
    font-size: 0.875rem;
    color: var(--ai-text-light);
}

.ai-pagination-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: center;
}

.ai-pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--ai-border);
    border-radius: 25px;
    background: white;
    color: var(--ai-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--ai-primary-light);
    border-color: var(--ai-primary);
    color: var(--ai-primary);
}

.ai-pagination-btn.active {
    background: var(--ai-primary);
    border-color: var(--ai-primary);
    color: white;
}

.ai-pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-pagination-btn svg {
    width: 16px;
    height: 16px;
}

.ai-pagination-ellipsis {
    padding: 0 8px;
    color: var(--ai-text-muted);
    font-size: 0.875rem;
}

.ai-pagination-prev,
.ai-pagination-next {
    padding: 0 8px;
}

/* Pagination Loading State */
.ai-pagination-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--ai-text-light);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

.ai-pagination-loading .spinner-border {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* Responsive pagination */
@media (max-width: 480px) {
    .ai-pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .ai-pagination-info {
        font-size: 0.8rem;
        text-align: center;
    }
}