/* Enhanced Truck Marketplace Styles - v2.0 */

/* =============================================== */
/* Marketplace Container Layout */
/* =============================================== */

.marketplace-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.marketplace-section {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(51, 65, 85, 0.5);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    font-size: 24px;
    color: #3b82f6;
}

.section-title.sell-section i {
    color: #10b981;
}

.section-title h3 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Search and Filters */
.marketplace-controls {
    margin-bottom: 1.5rem;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
}

.search-box input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 14px 16px 14px 48px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box input::placeholder {
    color: #64748b;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 999px;
    padding: 10px 18px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pill-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.pill-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pill-btn i {
    font-size: 12px;
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.loading-state i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    color: #3b82f6;
}

.loading-state p {
    font-size: 14px;
    margin: 0;
}

/* Ad Banner */
.ad-banner-horizontal {
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed #334155;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.ad-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

/* =============================================== */
/* Enhanced Listing Cards */
/* =============================================== */

.listing-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(51, 65, 85, 0.6);
    position: relative;
}

.listing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.listing-card:hover::before {
    opacity: 1;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.5);
    border-color: #3b82f6;
}

.listing-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    overflow: hidden;
}

.listing-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.image-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-badge.text-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
    border-color: rgba(16, 185, 129, 0.3);
}

.time-badge.text-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
    border-color: rgba(245, 158, 11, 0.3);
}

.time-badge.text-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
    border-color: rgba(239, 68, 68, 0.3);
}

.time-badge.text-muted {
    background: rgba(100, 116, 139, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

.listing-content {
    padding: 18px;
}

.listing-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.listing-title:hover {
    color: #3b82f6;
}

.listing-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.6);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.listing-meta span i {
    font-size: 11px;
    color: #64748b;
}

.listing-condition {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #cbd5e1;
}

.listing-condition span {
    color: #fbbf24;
}

.listing-location {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(51, 65, 85, 0.4);
    width: fit-content;
}

.listing-location i {
    color: #ef4444;
    font-size: 12px;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    margin-top: 8px;
}

.listing-price {
    flex: 1;
}

.price-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highest-bid {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.highest-bid i {
    font-size: 11px;
}

.highest-bid.text-muted {
    color: #64748b;
}

/* Button Improvements */
.btn-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .marketplace-container {
        grid-template-columns: 1fr;
    }
    
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .marketplace-section {
        padding: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header .btn {
        width: 100%;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-pills {
        flex-direction: column;
    }
    
    .pill-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ad-content ins {
        width: 100% !important;
        max-width: 320px;
    }
}

/* =============================================== */
/* Seller Form Modal (keeping existing styles) */
/* =============================================== */

/* Seller Form Modal */
.seller-form-enhanced {
    padding: 0;
}

.form-section {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #334155;
}

.form-section h3 {
    color: #f1f5f9;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: white;
    padding: 12px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.star {
    font-size: 32px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.star:hover {
    transform: scale(1.2);
}

.rating-label {
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
}

/* Tyre Grid */
.tyre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tyre-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
}

.tyre-item label {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.tyre-item select {
    width: 100%;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    color: white;
    padding: 8px;
    font-size: 13px;
}

/* Image Upload Grid */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.image-upload-slot {
    position: relative;
    border: 2px dashed #475569;
    border-radius: 12px;
    padding: 16px;
    background: #0f172a;
    transition: all 0.3s;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.image-upload-slot:hover {
    border-color: var(--primary-color);
    background: #1e293b;
}

.image-upload-slot label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    text-align: center;
}

.image-upload-slot label i {
    font-size: 32px;
    color: var(--primary-color);
}

.image-upload-slot label span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
}

.required-badge {
    background: #dc2626;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-top: 4px;
}

.image-upload-slot input[type="file"] {
    display: none;
}

.image-preview {
    display: none;
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.remove-image-btn:hover {
    background: #dc2626;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #334155;
    margin-top: 20px;
}

.form-actions .btn {
    min-width: 140px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .image-upload-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .tyre-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Modal overrides for seller form */
#seller-form-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: #1e293b;
    position: sticky;
    top: 0;
    z-index: 100;
}

.modal-header h2 {
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

/* Text muted */
.text-muted {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 8px;
}


/* =============================================== */
/* Phase 3: Enhanced Listing Cards */
/* =============================================== */

.listing-card {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #334155;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.listing-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.image-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.time-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.time-badge.text-success {
    background: rgba(16, 185, 129, 0.9);
}

.time-badge.text-warning {
    background: rgba(245, 158, 11, 0.9);
}

.time-badge.text-danger {
    background: rgba(239, 68, 68, 0.9);
}

.time-badge.text-muted {
    background: rgba(148, 163, 184, 0.9);
}

.listing-content {
    padding: 16px;
}

.listing-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.listing-title:hover {
    color: var(--primary-color);
}

.listing-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    font-size: 13px;
    color: #94a3b8;
}

.listing-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-condition {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #cbd5e1;
}

.listing-condition span {
    color: #fbbf24;
}

.listing-location {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #334155;
}

.listing-price {
    flex: 1;
}

.price-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.price-value {
    font-size: 22px;
    font-weight: 700;
    color: #10b981;
}

.highest-bid {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 4px;
    font-weight: 600;
}

.highest-bid.text-muted {
    color: #64748b;
}

/* Marketplace Grid */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .marketplace-grid {
        grid-template-columns: 1fr;
    }
    
    .listing-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .listing-footer .btn {
        width: 100%;
    }
}
