/* AI Full Page Layout Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1625 0%, #2d1b3d 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Main Container */
.ai-fullpage-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header Styles */
.ai-fullpage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(42, 36, 56, 0.95);
    border-bottom: none;
    backdrop-filter: blur(10px);
    z-index: 100;
    min-height: 60px;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

/* Back to Widget Button - Elegant Design */
.ai-fullpage-header .back-to-widget-btn {
    position: relative !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.3rem 0.8rem !important;
    font-weight: 400 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.3px !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    transition: color 0.3s ease, transform 0.3s ease !important;
    z-index: 1 !important;
    box-shadow: none !important;
}

.ai-fullpage-header .back-to-widget-btn:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: transparent !important;
    transform: translateY(-1px) !important;
}

.ai-fullpage-header .back-to-widget-btn:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* Button divider line */
.ai-fullpage-header .back-to-widget-btn::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    width: 100% !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
}

/* Right-to-left fill effect for Back button */
.ai-fullpage-header .back-to-widget-btn::before {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    right: 0 !important;
    left: auto !important;
    width: 0 !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    transition: width 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    z-index: 1 !important;
    transform-origin: right !important;
}

.ai-fullpage-header .back-to-widget-btn:hover::before {
    width: 100% !important;
}

/* Shimmer effect - Right to left for back button */
.ai-fullpage-header .back-to-widget-btn .shimmer {
    position: absolute !important;
    bottom: -2px !important;
    right: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background: linear-gradient(-90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%) !important;
    background-size: 200% 100% !important;
    z-index: 3 !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
    pointer-events: none !important;
}

.ai-fullpage-header .back-to-widget-btn:hover .shimmer {
    opacity: 1 !important;
    animation: shimmerRTL 1.2s infinite !important;
}

/* Shimmer animation - Right to left movement */
@keyframes shimmerRTL {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Message Meta Container (for user messages) */
.message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    gap: 8px;
}

/* AI Message Meta Container (for AI messages - timestamp and actions in same row) */
.ai-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    gap: 8px;
}

/* Message Status Indicators */
.message-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 11px;
    color: rgba(212, 200, 232, 0.6);
    flex-shrink: 0;
}

.message-time {
    font-size: 11px;
    color: rgba(212, 200, 232, 0.6);
    flex-shrink: 0;
}

/* AI message timestamp within meta container */
.ai-message-meta .message-time {
    margin-top: 0;
}

.message-status i {
    font-size: 10px;
}

.message-status.delivered {
    color: #4CAF50;
}

.message-status.seen {
    color: #2196F3;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.message:hover .message-actions {
    opacity: 1;
}

/* Message actions within AI meta container */
.ai-message-meta .message-actions {
    margin-top: 0;
}

.message-action-btn {
    background: none;
    border: none;
    color: rgba(212, 200, 232, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    color: #fd5631;
}

/* Response Controls - Single Row Layout */
.message .response-controls {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: nowrap !important;
    min-height: 24px;
    width: 100% !important;
    box-sizing: border-box !important;
}

.message .response-controls .word-count-badge {
    font-size: 10px;
    color: rgba(212, 200, 232, 0.6);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 8px;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    display: inline-block !important;
    order: 1 !important;
}

.message .response-controls .response-actions {
    display: flex !important;
    gap: 6px;
    flex: 0 0 auto !important;
    align-items: center;
    order: 2 !important;
    margin-left: auto !important;
}

.response-action-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.response-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

.response-action-btn:active {
    transform: translateY(0);
}

/* Progressive Disclosure Overlays - Only cover conversation panel (20% section) */
.summary-overlay,
.original-overlay {
    position: fixed;
    top: 60px; /* Below header */
    left: 0;
    width: 20%; /* Only cover the conversation panel */
    bottom: 0;
    background: rgba(31, 27, 44, 0.95);
    border-radius: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.summary-content,
.original-content {
    background: #2a2438;
    border: 1px solid rgba(253, 86, 49, 0.3);
    border-radius: 12px;
    padding: 12px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
}

/* Custom scrollbar for overlay content */
.summary-content::-webkit-scrollbar,
.original-content::-webkit-scrollbar {
    width: 6px;
}

.summary-content::-webkit-scrollbar-track,
.original-content::-webkit-scrollbar-track {
    background: #2a2438;
    border-radius: 3px;
}

.summary-content::-webkit-scrollbar-thumb,
.original-content::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.summary-content::-webkit-scrollbar-thumb:hover,
.original-content::-webkit-scrollbar-thumb:hover {
    background: #ff6b47;
}

/* Firefox scrollbar styling for overlay content */
.summary-content,
.original-content {
    scrollbar-width: thin;
    scrollbar-color: #fd5631 #2a2438;
}

.summary-header,
.original-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-header span,
.original-header span {
    font-weight: 600;
    color: #fd5631;
    font-size: 12px;
}

.close-summary-btn,
.close-original-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(212, 200, 232, 0.8);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.close-summary-btn:hover,
.close-original-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.5);
    color: #fd5631;
    transform: translateY(-1px);
}

.summary-text,
.original-text {
    font-size: 12px;
    line-height: 1.4;
    color: #d4c8e8;
    margin-bottom: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Custom scrollbar for text content areas */
.summary-text::-webkit-scrollbar,
.original-text::-webkit-scrollbar {
    width: 6px;
}

.summary-text::-webkit-scrollbar-track,
.original-text::-webkit-scrollbar-track {
    background: #2a2438;
    border-radius: 3px;
}

.summary-text::-webkit-scrollbar-thumb,
.original-text::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.summary-text::-webkit-scrollbar-thumb:hover,
.original-text::-webkit-scrollbar-thumb:hover {
    background: #ff6b47;
}

/* Firefox scrollbar styling for text content */
.summary-text,
.original-text {
    scrollbar-width: thin;
    scrollbar-color: #fd5631 #2a2438;
}

.summary-actions,
.original-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Overlay action buttons */
.summary-actions button,
.original-actions button {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.summary-actions button:hover,
.original-actions button:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

.summary-actions button:active,
.original-actions button:active {
    transform: translateY(0);
}

/* Specific overlay button styles */
.expand-summary-btn,
.use-original-btn,
.keep-optimized-btn,
.use-detailed-btn,
.keep-summary-btn,
.use-summary-btn,
.keep-detailed-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expand-summary-btn:hover,
.use-original-btn:hover,
.keep-optimized-btn:hover,
.use-detailed-btn:hover,
.keep-summary-btn:hover,
.use-summary-btn:hover,
.keep-detailed-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

/* Feedback Container */
.feedback-container {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-prompt {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-question {
    font-size: 11px;
    color: #fd5631;
    font-weight: 600;
}

.feedback-buttons {
    display: flex;
    gap: 6px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4c8e8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    color: #fd5631;
}

.feedback-btn.positive:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
}

.feedback-btn.negative:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #F44336;
    color: #F44336;
}

.feedback-btn i {
    font-size: 9px;
}

/* Detailed Feedback */
.detailed-feedback {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #d4c8e8;
    cursor: pointer;
}

.feedback-option input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #fd5631;
}

.feedback-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    color: #d4c8e8;
    font-size: 10px;
    resize: vertical;
    min-height: 40px;
    max-height: 80px;
}

.feedback-text::placeholder {
    color: rgba(212, 200, 232, 0.5);
}

.feedback-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.feedback-submit-btn,
.feedback-cancel-btn {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-submit-btn {
    background: rgba(253, 86, 49, 0.2);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
}

.feedback-submit-btn:hover {
    background: rgba(253, 86, 49, 0.3);
    border-color: #fd5631;
}

.feedback-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d4c8e8;
}

.feedback-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Feedback Thank You */
.feedback-thank-you {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4CAF50;
    font-size: 10px;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.feedback-thank-you i {
    font-size: 9px;
}

/* Responsive Design for New Features */
@media (max-width: 768px) {
    .response-controls {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .response-actions {
        justify-content: flex-end !important;
        margin-left: auto !important;
    }

    .word-count-badge {
        align-self: center !important;
    }

    .summary-content,
    .original-content {
        max-width: 95%;
        max-height: 85%;
        padding: 10px;
    }

    .response-action-btn {
        font-size: 9px;
        padding: 3px 6px;
    }

    /* Mobile overlay adjustments */
    .summary-overlay,
    .original-overlay {
        width: 100%; /* Full width on mobile */
        left: 0;
        right: 0;
    }
}

/* AI Branding */
.ai-branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-branding .ai-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.ai-branding h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.ai-branding p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Session Info */
.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.session-status-indicator {
    font-size: 8px;
    color: #4ade80;
}

.session-status-indicator.disconnected {
    color: #ef4444;
}

/* Main Content Area */
.ai-fullpage-main {
    display: grid;
    grid-template-columns: 20% 80%;
    flex: 1;
    overflow: visible; /* Allow thread dropdown to overflow */
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    min-height: 0; /* Important for grid children to shrink */
    max-height: calc(100vh - 60px); /* Reserve space for header */
}

/* Conversation Panel (20%) */
.conversation-panel {
    background: rgba(31, 27, 44, 0.95);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    min-height: 0; /* Important for flex children to shrink */
    overflow: visible; /* Allow dropdown to overflow */
    z-index: 10; /* Ensure panel is above other content */
    max-height: 100vh; /* Prevent panel from exceeding viewport */
}

.conversation-header {
    position: relative; /* Added for thread dropdown positioning */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: none;
    background: rgba(42, 36, 56, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10000; /* Create new stacking context for dropdown */
}

.conversation-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.conversation-controls {
    display: flex;
    gap: 8px;
}

.conversation-controls button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.conversation-controls button:hover {
    background: rgba(253, 86, 49, 0.1);
    color: #fd5631;
}

/* Conversation Messages - Using Widget Styles */
.expult-ai-messages {
    flex: 1;
    padding: 2px 4px 30px 4px; /* Increased bottom padding from 20px to 30px for better spacing */
    overflow-y: auto;
    background: #1f1b2c;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0; /* Important for flex children to shrink */
    max-height: calc(100vh - 200px); /* Reserve space for main header (60px), conversation header (60px), and input (80px) */
    height: 0; /* Force flex child to respect max-height */
}

.expult-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.expult-ai-messages::-webkit-scrollbar-track {
    background: #2a2438;
}

.expult-ai-messages::-webkit-scrollbar-thumb {
    background: #fd5631;
    border-radius: 3px;
}

.loading-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    gap: 12px;
}

.loading-conversation i {
    font-size: 24px;
    color: #fd5631;
}

/* Message Styles - Exact Widget Styles */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

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

.message.ai {
    align-self: flex-start;
    flex-direction: column;
    align-items: flex-start;
    max-width: 95%;
    gap: 8px;
}

.message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
    border-radius: 8px;
    width: auto;
    height: auto;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
}

.message.user .message-avatar {
    background: #2a2438;
    color: #d4c8e8;
}

.message-content {
    background: #2a2438;
    color: #d4c8e8;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
}

.message.ai .message-content {
    background: #2a2438;
    color: #d4c8e8;
}

/* Ensure last message has extra bottom margin to prevent cropping */
.expult-ai-messages .message:last-child {
    margin-bottom: 15px;
}

/* Extra margin for AI messages to prevent cropping */
.message.ai:last-child {
    margin-bottom: 20px;
}

/* Ensure loading elements in conversation have proper spacing */
.expult-ai-messages .loading-spinner,
.expult-ai-messages .loading-placeholder {
    margin-bottom: 15px;
}

/* Welcome Message */
.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.8);
}

.welcome-message .ai-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.welcome-content h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #ffffff;
}

.welcome-content p {
    font-size: 14px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.welcome-content ul {
    text-align: left;
    margin: 16px 0;
    padding-left: 20px;
}

.welcome-content li {
    margin-bottom: 8px;
    font-size: 13px;
}

/* Typing Indicator - Widget Style */
.typing-indicator {
    opacity: 0.8;
    margin-bottom: 15px; /* Extra margin to prevent cropping by input section */
}

.typing-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: #fd5631;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

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

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

.typing-text {
    color: rgba(212, 200, 232, 0.8);
    font-size: 11px;
    font-style: italic;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}



/* PHASE 3: Enhanced Car Suggestions Grid - 5 cards per row with optimized spacing */
.car-suggestions-grid.enhanced-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 12px 0;
    width: 100%;
    max-width: 100%;
}

/* Fallback for regular grid */
.car-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* PHASE 3: Enhanced AI cards styling - make cards wider and better proportioned */
.enhanced-ai-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.enhanced-ai-card .card {
    width: 100%;
    height: 100%;
    margin: 0;
    min-height: 380px; /* Ensure consistent card height */
}

.enhanced-ai-card .card-img-wrapper {
    height: 200px; /* Fixed height for images */
}

.enhanced-ai-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Better image fitting */
}

.enhanced-ai-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Ensure cards fill the grid properly */
.car-suggestions-grid.enhanced-layout .enhanced-ai-card {
    display: flex;
    flex-direction: column;
}

.car-suggestions-grid.enhanced-layout .enhanced-ai-card .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-suggestions-grid.enhanced-layout .enhanced-ai-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* PHASE 3: Responsive adjustments for enhanced layout with better proportions */
@media (min-width: 1600px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        max-width: 1800px;
        margin: 0 auto;
    }
}

@media (max-width: 1599px) and (min-width: 1400px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
}

@media (max-width: 1399px) and (min-width: 1200px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

@media (max-width: 1199px) and (min-width: 900px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (max-width: 899px) and (min-width: 600px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px 0;
    }

    .enhanced-ai-card .card {
        min-height: 360px;
    }
}

@media (max-width: 599px) {
    .car-suggestions-grid.enhanced-layout {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 8px 0;
    }

    .enhanced-ai-card .card {
        min-height: 340px;
    }
}

/* Car suggestions list view */
.car-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
}

.result-car-card {
    background: rgba(42, 36, 56, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.result-car-card:hover {
    transform: translateY(-2px);
    border-color: rgba(253, 86, 49, 0.3);
    box-shadow: 0 8px 25px rgba(253, 86, 49, 0.1);
}

.result-car-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.result-car-info {
    padding: 16px;
}

.result-car-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.result-car-price {
    font-size: 18px;
    font-weight: 700;
    color: #fd5631;
    margin-bottom: 4px;
}

.result-car-location {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.result-action-btn {
    width: 100%;
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.result-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 86, 49, 0.4);
}

/* Input Area - Exact Widget Styles */
.expult-ai-input {
    padding: 15px 20px;
    background: #18151f;
    border-top: none;
    flex-shrink: 0; /* Prevent input area from shrinking */
    position: sticky; /* Keep input area visible */
    bottom: 0; /* Stick to bottom of container */
    z-index: 5; /* Ensure it stays above messages */
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2a2438;
    border-radius: 25px;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.2s ease;
}

.input-container:focus-within {
    border-color: #fd5631;
}

.message-input {
    flex: 1;
    background: none;
    border: none;
    color: #d4c8e8;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    overflow-y: auto;
}

.message-input::placeholder {
    color: rgba(212, 200, 232, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-action-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.5);
    color: #fd5631;
}

/* Results Panel (80%) */
.results-panel {
    background: rgba(26, 22, 37, 0.95);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0; /* Important for flex children to shrink */
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: none;
    background: rgba(42, 36, 56, 0.4);
    flex-shrink: 0;
    min-height: auto;
    flex-wrap: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.results-title {
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.results-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    line-height: 1;
}

.results-title h2 i {
    color: #fd5631;
    font-size: 20px;
}

.results-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.results-count {
    font-weight: 600;
    color: #fd5631;
    font-size: 14px;
}

.results-page-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
}

.results-page-info::before {
    content: "•";
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.4);
}

/* PHASE 3 ENHANCEMENT: Enhanced results controls - redesigned to match website */
.results-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

/* View toggle buttons - redesigned to match main website style */
.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.view-btn {
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.view-btn i {
    font-size: 16px;
}

.view-btn:hover {
    background: rgba(253, 86, 49, 0.15);
    color: #fd5631;
    transform: translateY(-1px);
}

.view-btn.active {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(253, 86, 49, 0.3);
}

.view-btn:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

/* Sort controls - redesigned with sort icon inside dropdown */
.sort-controls {
    display: flex;
    align-items: center;
    position: relative;
}

.sort-select {
    padding: 6px 32px 6px 8px; /* Extra padding on right for custom icon */
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    cursor: pointer;
    min-width: 150px;
    height: 32px;
    transition: all 0.3s ease;
    box-shadow: none;
    appearance: none; /* Remove default dropdown arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
}

.sort-select:focus {
    outline: none;
    color: #fd5631;
    background: transparent;
}

.sort-select:hover {
    color: #fd5631;
    background: transparent;
}

/* Custom sort icon inside dropdown */
.sort-controls::after {
    content: '\f0dc'; /* FontAwesome sort icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.sort-controls:hover::after {
    color: #fd5631;
}

/* Style the dropdown options */
.sort-select option {
    background: rgba(26, 22, 37, 0.95);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border: none;
}

.sort-select option:hover,
.sort-select option:checked {
    background: rgba(253, 86, 49, 0.2);
    color: #fd5631;
}

/* Refresh button - clean transparent style */
.refresh-results-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 8px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    min-width: 32px;
    box-shadow: none;
}

.refresh-results-btn:hover {
    background: transparent;
    color: #fd5631;
    border: none;
    transform: none;
}

.refresh-results-btn i {
    font-size: 14px;
}

/* PHASE 3 ENHANCEMENT: Results Content with scrolling */
.results-content {
    flex: 1;
    overflow: hidden; /* Prevent double scrollbars */
    padding: 0; /* Remove padding to allow full scrolling */
    min-height: 0; /* Important for flex children to shrink */
    display: flex;
    flex-direction: column;
    border-top: none; /* Ensure no top border */
}

/* Scrollable wrapper for car cards and pagination */
.results-scrollable-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    min-height: 0; /* Important for flex children to shrink */
}

/* Custom scrollbar styling */
.results-scrollable-wrapper::-webkit-scrollbar {
    width: 8px;
}

.results-scrollable-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.results-scrollable-wrapper::-webkit-scrollbar-thumb {
    background: rgba(253, 86, 49, 0.6);
    border-radius: 4px;
}

.results-scrollable-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(253, 86, 49, 0.8);
}

/* No Results State */
.no-results-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.no-results-icon {
    font-size: 48px;
    color: rgba(253, 86, 49, 0.3);
    margin-bottom: 16px;
}

.no-results-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.no-results-state p {
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
}

.suggested-queries {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggested-query-btn {
    background: rgba(253, 86, 49, 0.1);
    border: 1px solid rgba(253, 86, 49, 0.3);
    color: #fd5631;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.suggested-query-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: #fd5631;
    transform: translateY(-1px);
}

/* Results Loading */
.results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    gap: 16px;
}

.loading-spinner {
    font-size: 32px;
    color: #fd5631;
}

/* Footer */
.ai-fullpage-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    background: rgba(42, 36, 56, 0.95);
    border-top: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    min-height: 40px;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    color: rgba(255, 255, 255, 0.3);
}

.footer-actions {
    display: flex;
    gap: 8px;
}

.footer-actions button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-actions button:hover {
    color: #fd5631;
    background: rgba(253, 86, 49, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 22, 37, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-content {
    text-align: center;
    color: #ffffff;
}

.loading-content .loading-slider {
    font-size: 48px;
    color: #fd5631;
    margin-bottom: 24px;
    width: 200px;
    height: 60px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.loading-content .loading-slider i {
    position: absolute;
    animation: slideLeftToRight 2s ease-in-out infinite;
}

/* Left-to-right sliding animation */
@keyframes slideLeftToRight {
    0% {
        left: -60px;
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 200px;
        opacity: 0.3;
    }
}

.loading-content h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.loading-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ai-fullpage-main {
        grid-template-columns: 25% 75%;
    }
}

@media (max-width: 768px) {
    .ai-fullpage-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    .conversation-panel {
        display: none;
    }
    
    .results-panel {
        grid-column: 1;
        grid-row: 1;
    }
    
    .ai-fullpage-header {
        padding: 8px 16px;
    }
    
    .header-center .ai-info p {
        display: none;
    }
    
    .back-to-widget-btn span {
        display: none;
    }
}

/* Enhanced responsive design for results header */
@media (max-width: 1200px) {
    .results-header {
        padding: 16px 20px;
    }

    .results-title {
        gap: 16px;
    }

    .results-controls {
        gap: 12px;
    }

    .sort-select {
        min-width: 130px;
        font-size: 12px;
    }

    .sort-controls::after {
        font-size: 12px;
        right: 10px;
    }
}

@media (max-width: 900px) {
    .results-header {
        padding: 16px 16px;
    }

    .results-title h2 {
        font-size: 16px;
    }

    .results-summary {
        font-size: 12px;
    }

    .results-controls {
        gap: 10px;
    }

    .sort-select {
        min-width: 120px;
        padding: 4px 28px 4px 8px;
        height: 28px;
    }

    .sort-controls::after {
        font-size: 10px;
        right: 6px;
    }

    .refresh-results-btn {
        padding: 4px 8px;
        height: 28px;
        min-width: 28px;
    }
}

@media (max-width: 768px) {
    .results-header {
        padding: 16px 16px;
    }

    .results-title {
        gap: 12px;
    }

    .results-title h2 {
        font-size: 15px;
    }

    .results-summary {
        font-size: 11px;
        gap: 8px;
    }

    .results-controls {
        gap: 8px;
    }

    .sort-select {
        min-width: 100px;
        padding: 8px 28px 8px 12px;
        font-size: 11px;
    }

    .sort-controls::after {
        font-size: 10px;
        right: 8px;
    }
}

@media (max-width: 480px) {
    .ai-fullpage-header {
        padding: 8px 12px;
    }

    .results-header {
        padding: 16px 12px;
        flex-wrap: nowrap;
    }

    .results-title {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .results-title h2 {
        font-size: 14px;
    }

    .results-summary {
        font-size: 10px;
        gap: 6px;
    }

    .results-controls {
        gap: 6px;
        flex-shrink: 0;
    }

    .sort-select {
        min-width: 80px;
        padding: 4px 20px 4px 6px;
        height: 24px;
        font-size: 10px;
    }

    .sort-controls::after {
        font-size: 8px;
        right: 4px;
    }

    .refresh-results-btn {
        padding: 4px 6px;
        height: 24px;
        min-width: 24px;
        font-size: 11px;
    }

    .results-content {
        padding: 16px;
    }

    .suggested-queries {
        flex-direction: column;
        align-items: center;
    }
}

/* PHASE 1 ENHANCEMENT: Use existing carcard.css styling for uniformity */

/* Hover overlay - keep existing carcard.js styling */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.car-card:hover .hover-overlay {
    opacity: 1;
}

.view-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    color: #333 !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Remove problematic CSS that interferes with existing carcard.css */

/* Legacy support for existing feature icons */
.feature-icon {
    color: #fd5631;
    margin-right: 6px;
    font-size: 14px;
}

/* Use existing carcard.css features styling - don't override */

/* Like button */
.btn-like {
    z-index: 3;
    transition: all 0.2s ease;
}

.btn-like:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.9) !important;
}

.btn-like.processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Featured badge */
.featured-badge-container {
    z-index: 3;
    margin: 10px;
}

.featured-badge {
    background: linear-gradient(135deg, #fd5631 0%, #ff3a40 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(253, 86, 49, 0.3);
}

/* PHASE 3: Work with existing Bootstrap grid - don't override */
/* Remove custom grid that interferes with existing UI */

/* PHASE 3: Loading and lazy loading styles */
.loading-placeholder {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: rgba(42, 36, 56, 0.3);
    border-radius: 12px;
    margin-top: 20px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.loading-spinner i {
    font-size: 24px;
    color: #fd5631;
}

.loading-spinner .spin {
    animation: spin 1s linear infinite;
}

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

/* PHASE 3: Pagination styles */
.pagination-container {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    background-color: rgba(42, 36, 56, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    margin: 0 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.pagination .page-link:hover {
    background-color: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background-color: #fd5631;
    border-color: #fd5631;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(253, 86, 49, 0.3);
}

.pagination .page-item.disabled .page-link {
    background-color: rgba(42, 36, 56, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    background-color: rgba(42, 36, 56, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    transform: none;
}

.results-summary {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
}

/* PHASE 3: Minimal performance optimizations that don't interfere */
.enhanced-ai-card {
    will-change: transform;
    backface-visibility: hidden;
}

.enhanced-ai-card:hover {
    will-change: transform;
}

/* PHASE 3: Minimal responsive adjustments that don't interfere with existing UI */
@media (max-width: 768px) {
    /* Only add necessary adjustments for AI components */
    .pagination-container {
        margin-top: 20px;
        padding: 16px 0;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        margin-top: 20px;
        padding: 16px 0;
    }

    .pagination .page-link {
        padding: 8px 12px;
        margin: 0 2px;
        font-size: 14px;
    }

    .results-summary {
        font-size: 13px;
        margin-top: 12px;
    }
}

/* PHASE 3 ENHANCEMENT: Enhanced car cards with view support */
.result-car-card.list-view {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.result-car-card.list-view .result-car-thumbnail {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
}

.result-car-card.list-view .result-car-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-car-card.list-view .result-car-details {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.result-car-card.list-view .car-detail {
    font-size: 12px;
    color: #adb5bd;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.result-car-card.list-view .result-action-btn {
    align-self: flex-start;
    margin-left: auto;
    width: auto;
    padding: 8px 16px;
}

/* Grid view specific styling (default) */
.result-car-card.grid-view {
    display: flex;
    flex-direction: column;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    margin-top: 20px;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(42, 36, 56, 0.5);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.5);
    color: #fd5631;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(42, 36, 56, 0.3);
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(42, 36, 56, 0.5);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: rgba(253, 86, 49, 0.2);
    border-color: rgba(253, 86, 49, 0.5);
    color: #fd5631;
}

.page-btn.active {
    background: #fd5631;
    border-color: #fd5631;
    color: #fff;
}

/* Enhanced responsive design for Phase 3 */
@media (max-width: 768px) {
    .pagination-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .results-controls {
        gap: 8px;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    /* Ensure controls stay in one row on mobile */
    .view-toggle {
        flex-shrink: 0;
    }

    .sort-controls {
        flex-shrink: 0;
    }

    .refresh-results-btn {
        flex-shrink: 0;
    }

    .view-toggle {
        justify-content: center;
    }

    .sort-controls {
        justify-content: center;
    }

    .sort-select {
        min-width: 120px;
    }

    .result-car-card.list-view {
        flex-direction: column;
        text-align: center;
    }

    .result-car-card.list-view .result-car-thumbnail {
        width: 100%;
        height: 150px;
    }

    .result-car-card.list-view .result-action-btn {
        margin-left: 0;
        width: 100%;
    }

    .results-scrollable-wrapper {
        padding: 16px;
    }
}

/* Car Loading Indicator Animation (for re-fetch operations) */
.car-loading-indicator .message-avatar i {
    color: #28a745; /* Green car icon */
}

.car-loading-animation {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.car-loading-bar {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997, #28a745);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: carLoading 2s infinite ease-in-out;
    width: 100%;
}

.loading-text {
    color: #28a745;
    font-weight: 500;
    font-size: 14px;
}

@keyframes carLoading {
    0% {
        transform: translateX(-100%);
        background-position: 200% 0;
    }
    50% {
        background-position: 0% 0;
    }
    100% {
        transform: translateX(100%);
        background-position: -200% 0;
    }
}

/* Car Loading State in Results Panel */
.car-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
}

.car-loading-spinner {
    font-size: 48px;
    color: #fd5631;
    margin-bottom: 24px;
    animation: carSpinning 2s linear infinite;
}

.car-loading-state h3 {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.car-loading-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 24px;
}

.loading-progress-bar {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fd5631, #ff7849, #fd5631);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progressLoading 2s infinite ease-in-out;
    width: 100%;
}

@keyframes carSpinning {
    0% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(-10px);
    }
}

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

/* ========================================
   THREAD UI COMPONENTS - AUGMENT INSPIRED
   ======================================== */

/* Thread Controls Container */
.thread-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 0;
}

/* Thread Dropdown Button (Top-left) */
.thread-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.thread-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.thread-dropdown-btn:active {
    transform: translateY(0);
}

.thread-chevron {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.thread-dropdown-btn.active .thread-chevron {
    transform: rotate(180deg);
}

/* New Conversation Button (Top-right) */
.new-conversation-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.new-conversation-btn:hover {
    background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.new-conversation-btn:active {
    transform: translateY(0);
}

/* Thread Dropdown Panel */
.thread-dropdown-panel {
    position: fixed !important; /* Keep fixed positioning that was working */
    top: 120px !important; /* Fixed position for visibility */
    left: 20px !important;
    right: 80% !important;
    background: rgba(15, 12, 20, 0.95); /* Deep elegant background */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin: 8px;
    max-height: 320px;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(180%); /* Enhanced blur for out-of-focus effect */
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1); /* Subtle inner highlight */
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.98);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Smooth easing */
}

.thread-dropdown-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Thread Dropdown Header */
.thread-dropdown-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.thread-dropdown-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    letter-spacing: 0.3px;
}

.thread-dropdown-header i {
    color: #a78bfa;
    font-size: 14px;
    opacity: 0.9;
}

/* Thread List */
.thread-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0 8px 0;
}

.thread-list::-webkit-scrollbar {
    width: 3px;
}

.thread-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
}

.thread-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.4) 0%, rgba(99, 102, 241, 0.3) 100%);
    border-radius: 2px;
}

.thread-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.6) 0%, rgba(99, 102, 241, 0.5) 100%);
}

/* Thread List Loading */
.thread-list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.thread-list-loading i {
    color: #8b5cf6;
}

/* Thread Item */
.thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 2px solid transparent;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.thread-item:hover {
    z-index: 10;
}

.thread-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thread-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-left-color: #a78bfa;
    z-index: 10;
}

.thread-item:hover::before {
    opacity: 1;
}

.thread-item.active {
    background: rgba(139, 92, 246, 0.08);
    border-left-color: #8b5cf6;
    border-left-width: 3px;
}

.thread-item.active::before {
    opacity: 1;
}

.thread-item-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.thread-item-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}

.thread-item-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.thread-item-time {
    white-space: nowrap;
    opacity: 0.8;
}

/* Thread Management Actions */
.thread-item-actions {
    position: relative;
    flex-shrink: 0;
    z-index: 100;
}

.thread-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.9);
}

.thread-item:hover .thread-menu-btn {
    opacity: 1;
    transform: scale(1);
}

.thread-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.thread-menu-btn:active {
    transform: scale(0.95);
}

/* Thread Menu Dropdown */
.thread-menu-dropdown {
    position: fixed !important;
    background: rgba(15, 12, 20, 0.95) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 8px !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    min-width: 140px !important;
    max-width: 140px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.95) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

.thread-menu-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
}

.thread-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.thread-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.thread-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.thread-menu-item:only-child {
    border-radius: 8px;
}

.thread-menu-item:hover {
    background: rgba(139, 92, 246, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.thread-menu-item.delete-thread:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.thread-menu-item i {
    width: 14px;
    font-size: 12px;
    opacity: 0.8;
}

/* Thread Rename Input */
.thread-rename-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
}

.thread-rename-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .thread-controls {
        padding: 6px 0;
    }

    .thread-dropdown-btn,
    .new-conversation-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .thread-dropdown-btn span,
    .new-conversation-btn span {
        display: none;
    }

    .thread-dropdown-panel {
        margin: 4px;
        max-height: 250px;
    }

    .thread-item {
        padding: 10px 16px;
    }

    .thread-menu-btn {
        opacity: 1;
        transform: scale(1);
    }

    .thread-menu-dropdown {
        min-width: 120px;
    }

    .thread-menu-item {
        padding: 8px 12px;
        font-size: 12px;
    }
}
