* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #10b981;
    animation: none;
}

.status-dot.disconnected {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.welcome-message {
    background: #f3f4f6;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.welcome-message p {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.5;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

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

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

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

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

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.assistant .message-avatar {
    background: #10b981;
}

.message-content {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    color: #1f2937;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.message.user .message-content pre {
    background: rgba(255, 255, 255, 0.2);
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid #ef4444;
    margin: 8px 0;
}

.system-message {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.875rem;
}

.history-separator,
.new-messages-separator {
    text-align: center;
    color: #888;
    margin: 10px 0;
    padding: 8px 0;
    font-size: 12px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    background: #f9fafb;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 12px;
    width: fit-content;
    margin-left: 48px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#chatForm {
    display: flex;
    gap: 12px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#messageInput:focus {
    border-color: #667eea;
}

#messageInput:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

#sendButton {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#sendButton:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sendButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#sendButton:active:not(:disabled) {
    transform: scale(0.95);
}

/* Inventory Results Container */
.inventory-results {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
}

.inventory-header {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Vehicle Cards Grid */
.vehicle-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

/* Individual Vehicle Card */
.vehicle-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Vehicle Image Container */
.vehicle-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vehicle Image */
.vehicle-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-image-placeholder svg {
    width: 100%;
    height: 100%;
}

.vehicle-no-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #9ca3af;
}

/* Vehicle Details */
.vehicle-details {
    padding: 15px;
}

.vehicle-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.vehicle-price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 12px;
}

/* Info Grid */
.vehicle-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.vehicle-info-item {
    font-size: 13px;
    color: #555;
}

.info-label {
    font-weight: 600;
    color: #7f8c8d;
}

.info-value {
    color: #2c3e50;
}

/* Features */
.vehicle-features {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.features-title {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    font-size: 12px;
    color: #555;
    padding: 3px 0;
    padding-left: 16px;
    position: relative;
}

.features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* CTA Button */
.vehicle-cta-button {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.vehicle-cta-button:hover {
    opacity: 0.9;
}

.vehicle-cta-button:active {
    transform: scale(0.98);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .chat-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .message {
        max-width: 90%;
    }

    .vehicle-cards {
        grid-template-columns: 1fr;
    }
}
