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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo img {
    width: 32px;
    height: 32px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.user-info strong {
    color: var(--text-primary);
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-user {
    background-color: #dbeafe;
    color: #1e40af;
}

.role-admin {
    background-color: #fef3c7;
    color: #92400e;
}

/* Main Content */
main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Features Grid */
.features {
    padding: 4rem 0;
}

.features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* App Layout */
.app-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    width: 250px;
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--background);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.content {
    flex: 1;
    background-color: var(--surface);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Test Results */
.test-results {
    margin-top: 2rem;
}

/* Test Setup Styles */
.test-setup {
    background: var(--background);
    padding: 0;
    border-radius: 8px;
    margin-top: 2rem;
}

.collapsible-header {
    width: 100%;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-header:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}

.collapsible-content {
    padding: 2rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.test-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.test-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.test-card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.test-card button {
    margin-top: 0.5rem;
    width: 100%;
}

.llm-test {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.llm-test input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.test-success {
    background: #10b981;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    text-align: center;
}

.test-success h4 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Items */
.items-list {
    display: grid;
    gap: 1rem;
}

.item-card {
    background-color: var(--background);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.item-card h4 {
    margin-bottom: 0.5rem;
}

.item-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input:disabled {
    background-color: var(--background);
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--surface);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal form {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #dcfce7;
    color: #14532d;
    border: 1px solid #86efac;
}

.alert-error {
    background-color: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

/* Footer */
footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .feature-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
}

/* Car Assistant Styles */
.assistant-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.chat-area {
    display: flex;
    flex-direction: column;
}

.chat-area h2 {
    margin-bottom: 1.5rem;
}

#conversation-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 1rem;
}

.question-card {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: none;
}

.question-card.active {
    display: block;
}

.question-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.question-card textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
}

.question-card .btn {
    float: right;
}

.insights-sidebar {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
}

.insights-sidebar h3 {
    margin-bottom: 1rem;
    color: #0369a1;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.insight-item {
    background-color: var(--surface);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid #0284c7;
    font-size: 0.9rem;
}

.empty-insights {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

/* Recommendations Styles */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.recommendation-card {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.car-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: #f3f4f6;
}

.car-info {
    padding: 1.5rem;
}

.car-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.car-reasoning {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.car-tradeoffs {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.car-actions {
    display: flex;
    gap: 0.5rem;
}

.car-actions .btn {
    flex: 1;
}

/* Modal Improvements */
.modal-large {
    max-width: 900px;
    width: 90%;
}

.car-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.car-images-carousel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-car-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.image-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.image-thumbnails img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.image-thumbnails img.active {
    border-color: var(--primary-color);
}

.car-specs {
    overflow-y: auto;
    max-height: 500px;
}

.spec-section {
    margin-bottom: 1.5rem;
}

.spec-section h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.spec-label {
    font-weight: 500;
}

.spec-value {
    color: var(--text-secondary);
}

/* Feedback Section */
.feedback-section {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.feedback-section h3 {
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feedback-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.feedback-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
}
EOF < /dev/null