/* Marketplace Styles */

/* Category Sidebar */
.category-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.category-item:hover {
    background-color: var(--dropdown-hover);
    padding-left: 20px;
}

.category-item.active {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 3px solid #7d00bb;
    font-weight: bold;
}

/* Listing Cards */
.listing-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
}

.listing-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.listing-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.listing-card .btn-outline-primary {
    border-color: #0d6efd;
    color: #0d6efd;
}

.listing-card .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.listing-card.d-flex.flex-row {
    flex-direction: row !important;
}

.listing-card.d-flex.flex-row img {
    width: 250px;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.listing-card.d-flex.flex-row .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* List View Styles */
#latestListings.list-view {
    display: flex;
    flex-direction: column;
}

#latestListings.list-view > div {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.listing-card-list {
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.listing-card-list:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.list-view-img-compact {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px 0 0 6px;
    display: block;
}

.listing-card-list .verified-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #1976d2;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.listing-card-list .years-badge {
    position: absolute;
    top: 32px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.wishlist-btn-list {
    z-index: 3;
    background: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wishlist-btn-list:hover {
    background: #f8f9fa;
    transform: scale(1.1);
}

/* Vendor Logos */
.vendor-logo {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    flex-shrink: 0;
    text-transform: uppercase;
    user-select: none;
}

.vendor-logo-small {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    flex-shrink: 0;
    text-transform: uppercase;
    user-select: none;
}

.vendor-logo-img {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e0e0e0;
    flex-shrink: 0;
    background: #f5f5f5;
}

.vendor-logo-img-small {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e0e0e0;
    flex-shrink: 0;
    background: #f5f5f5;
}

/* Wishlist Buttons */
.wishlist-btn {
    z-index: 10;
    text-decoration: none !important;
    transition: transform 0.2s;
    background: transparent;
    border: none;
}

.wishlist-btn:hover i {
    transform: scale(1.2);
}

.wishlist-btn-grid {
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 8px;
    text-decoration: none !important;
    background: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
    border: none;
}

.wishlist-btn-grid:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.wishlist-btn-grid i,
.wishlist-btn i {
    transition: all 0.2s;
}

.wishlist-btn-grid .fas,
.wishlist-btn .fas {
    color: #e74c3c !important;
    font-weight: 900;
}

/* Premium Badge */
.premium-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6);
    }
}

/* Seller Info */
.seller-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.seller-info > img,
.seller-info > div:first-child {
    flex-shrink: 0;
}

.seller-info .flex-grow-1 {
    min-width: 0;
    overflow: hidden;
}

.seller-info .fw-bold {
    font-size: 0.875rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seller-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.time-posted {
    font-size: 0.75rem;
    color: #999;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

.filter-tag .remove-filter {
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.filter-tag .remove-filter:hover {
    color: #333;
}

/* Location Modal */
.location-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.location-modal.show {
    display: flex;
}

.location-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.location-modal-header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.location-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.location-modal-close:hover {
    color: #111827;
}

.location-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.location-search-wrapper {
    position: relative;
}

.location-search-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.location-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.location-search-input:focus {
    outline: none;
    border-color: #7c3aed;
}

.btn-current-location {
    width: 100%;
    padding: 12px 20px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-current-location:hover:not(:disabled) {
    background: #6d28d9;
}

.btn-current-location:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.popular-cities-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.city-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.city-item:hover {
    background: #f9fafb;
}

.city-name {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.city-state {
    font-size: 13px;
    color: #6b7280;
}

.city-count {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

.location-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-clear-location {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #7c3aed;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-location:hover {
    background: #7c3aed;
    color: white;
}

/* Responsive */
@media (max-width: 576px) {
    .location-modal {
        padding: 0;
    }
    
    .location-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
}
