/* Browse Listings Page Styles */

.breadcrumb {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

    .breadcrumb-nav a {
        color: var(--primary-teal);
        text-decoration: none;
    }

        .breadcrumb-nav a:hover {
            text-decoration: underline;
        }

    .breadcrumb-nav span {
        color: #718096;
    }

.browse-header {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.page-title small {
    font-size: 18px;
    color: #666;
    font-weight: 400;
    display: block;
}

.results-count {
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
}

.browse-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sort-dropdown .form-select {
    min-width: 150px;
}

.browse-content {
    padding: 20px 0;
}

.filters-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.filters-sidebar h5 {
    color: #333;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h6 {
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
}

/* Autocomplete results dropdown */
.location-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
}

.location-search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.location-search-result-item:last-child {
    border-bottom: none;
}

.location-search-result-item:hover {
    background: #f0fffe;
}

.location-result-main {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.location-result-sub {
    font-size: 12px;
    color: #6b7280;
}

.location-result-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.location-result-type.country {
    background: #f3e8ff;
    color: #6b21a8;
}

.location-result-type.lan {
    background: #dbeafe;
    color: #1e40af;
}

.location-result-type.kommun {
    background: #fef3c7;
    color: #92400e;
}

.location-result-type.omrade {
    background: #d1fae5;
    color: #065f46;
}

/* Selected locations pills */
.selected-locations-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.location-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--primary-teal);
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
}

.location-pill:hover {
    background: #f0fffe;
    border-color: #22a8a1;
}

.location-pill-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.location-pill-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-pill-name {
    font-weight: 500;
    font-size: 14px;
}

.location-pill-meta {
    color: #6b7280;
    font-size: 11px;
}

.location-pill-remove {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.location-pill-remove:hover {
    color: #ef4444;
}

/* Type badges in pills - smaller than in search results */
.location-pill .location-result-type {
    font-size: 10px;
    padding: 2px 6px;
}

.form-check {
    margin-bottom: 8px;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-range input {
    flex: 1;
}

.price-range span {
    color: #666;
    font-weight: 500;
}

/* Skeleton loading cards */
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.skeleton-image {
    aspect-ratio: 3 / 4;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-info {
    padding: 20px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.title {
    width: 80%;
    height: 16px;
}

.skeleton-line.price {
    width: 40%;
    height: 16px;
}

.skeleton-line.location {
    width: 50%;
    height: 12px;
    margin-bottom: 0;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Make no-results span full width in grid */
.listings-grid > .col-12 {
    grid-column: 1 / -1;
}

.listing-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(42, 189, 189, 0.2);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-decoration: none !important;
}

.listing-image {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.no-image {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
}

.no-image i {
    font-size: 48px;
    margin-bottom: 8px;
}

.listing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 189, 189, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.listing-card:hover .listing-overlay {
    opacity: 1;
}

.listing-info {
    padding: 20px;
}

.listing-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.listing-title a:hover {
    color: #2ABDB5;
}

.listing-price {
    font-size: 16px;
    font-weight: 700;
    color: #2ABDB5;
    margin-bottom: 2px;
}

.listing-location,
.listing-category,
.listing-condition,
.listing-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.no-results-icon i {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #333;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.no-results-suggestions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.no-results-suggestions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

.no-results-suggestions .btn:hover {
    background: #fff;
    border-color: #adb5bd;
    color: #212529;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-results-suggestions .btn i {
    font-size: 16px;
    color: #6c757d;
}

.no-results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Neutral styling for no-results action buttons */
.no-results-actions .btn {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.no-results-actions .btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.no-results-actions .btn-primary {
    background: #4b5563;
    border: 1px solid #4b5563;
    color: #ffffff;
}

.no-results-actions .btn-primary:hover {
    background: #374151;
    border-color: #374151;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.no-results-actions .btn-outline-primary {
    background: #ffffff;
    border: 1px solid #6b7280;
    color: #6b7280;
}

.no-results-actions .btn-outline-primary:hover {
    background: #f9fafb;
    border-color: #4b5563;
    color: #4b5563;
}

/* Ad Sidebar */
.ad-sidebar {
    position: sticky;
    top: 20px;
}

.ad-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
}

.ad-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: #adb5bd;
    text-align: center;
}

.ad-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

.ad-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* Tablet Styles */
@media (max-width: 1200px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .listings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        background: #fff;
        padding: 20px;
        overflow-y: auto;
    }

    .filters-sidebar.show {
        display: block;
    }

    .browse-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* Remove padding/margin on mobile for tight layout */
    .browse-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    .browse-content .container {
        padding-left: 6px !important;
        padding-right: 6px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
    }

    .browse-content .row {
        margin: 0 !important;
        padding: 0 !important;
    }

    .browse-content .col-lg-9,
    .browse-content .col-12 {
        padding: 0 !important;
    }

    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-title {
        font-size: 24px;
    }

    .no-results-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ===== Infinite Scroll ===== */
#scroll-sentinel {
    height: 1px;
    width: 100%;
}

#infinite-scroll-spinner {
    padding: 30px 0;
}

#no-more-listings {
    padding: 20px 0;
    font-size: 14px;
    color: #6c757d;
}