/* VIN Automotive Marketplace Styles */
:root {
    --vin-primary: #8B4513;
    --vin-secondary: #DAA520;
    --vin-accent: #F5DEB3;
    --vin-dark: #654321;
    --vin-light: #FFF8DC;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Arabic Font Support */
[lang="ar"], .rtl {
    font-family: 'Cairo', 'Inter', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Screen Management */
.screen {
    display: none;
    min-height: calc(100vh - 140px);
}

.screen.active {
    display: block;
}

/* VIN Logo Styling */
.vin-logo {
    background: linear-gradient(135deg, var(--vin-secondary), var(--vin-primary));
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Navigation Styles */
.nav-btn.active {
    color: var(--vin-primary);
}

.nav-btn:hover {
    color: var(--vin-primary);
    background-color: var(--vin-light);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--vin-secondary);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
}

/* Listing Cards */
.listing-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
    border-color: var(--vin-secondary);
}

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.vin-verified-badge {
    background: linear-gradient(135deg, var(--vin-primary), var(--vin-dark));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: 12px;
    left: 12px;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

/* Profile Type Cards */
.profile-type-card {
    transition: all 0.3s ease;
}

.profile-type-card:hover,
.profile-type-card.selected {
    border-color: var(--vin-secondary);
    background-color: var(--vin-light);
    transform: translateY(-2px);
}

/* Listing Package Cards */
.listing-package {
    transition: all 0.3s ease;
    position: relative;
}

.listing-package:hover,
.listing-package.selected {
    border-color: var(--vin-primary);
    background-color: var(--vin-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.15);
}

.listing-package[data-package="inspection"] {
    background: linear-gradient(135deg, var(--vin-light), #fff);
    border-color: var(--vin-secondary);
}

/* Photo Upload Areas */
.photo-upload {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.photo-upload:hover {
    border-color: var(--vin-secondary);
    background-color: var(--vin-light);
}

/* Form Enhancements */
input:focus,
select:focus,
textarea:focus {
    border-color: var(--vin-secondary);
    ring-color: var(--vin-secondary);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.1);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--vin-primary), var(--vin-dark));
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--vin-dark), #4a2c14);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--vin-secondary), #b8941c);
    color: var(--vin-dark);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--vin-accent);
    transform: translateY(-1px);
}

/* Search Bar Enhancement */
.search-container {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: var(--vin-light);
}

/* Filters Panel */
.filters-panel {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Price Display */
.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vin-primary);
}

/* Location Badge */
.location-badge {
    background: var(--vin-accent);
    color: var(--vin-dark);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Trust Indicators */
.trust-indicator {
    text-align: center;
    padding: 20px;
}

.trust-indicator i {
    color: var(--vin-secondary);
    margin-bottom: 12px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--vin-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .hero-text {
        font-size: 2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .listing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .hero-text {
        font-size: 1.75rem;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .nav-text {
        font-size: 0.6rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .auto-dark {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .auto-dark .bg-white {
        background-color: #2d2d2d;
    }
    
    .auto-dark .text-gray-600 {
        color: #b0b0b0;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Success/Error States */
.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.error-message {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--vin-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--vin-primary);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--vin-secondary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --vin-primary: #000000;
        --vin-secondary: #0066cc;
        --vin-accent: #ffff00;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}