@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');

/* ============== ENHANCED SEARCH RESULTS STYLING ============== */

/* Search Results Header - Modern Gradient */
.search-results-header {
    margin-bottom: 40px;
    padding: 40px 30px;
    background: linear-gradient(135deg, #0d47a1 0%, #0a3d8a 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.15);
}

.search-query-title {
    font-size: 42px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.results-count {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Controls */
.search-controls {
    margin-bottom: 30px;
}

.filter-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 2fr);
    gap: 18px;
    align-items: end;
}

.filter-block {
    background: white;
    padding: 22px 22px 18px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.filter-block label {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
    font-weight: 700;
}

.filter-select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    padding: 14px 16px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.08);
}

.filter-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.filter-summary .results-count {
    margin: 0;
    font-size: 15px;
    color: #334155;
    font-weight: 600;
    text-align: right;
}

.search-main-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 30px;
}

.search-results-list {
    display: grid;
    gap: 28px;
}

.search-map-aside {
    display: grid;
    gap: 28px;
}

.search-main-grid .results-grid {
    margin-bottom: 0;
}

.search-results-page.section-padding {
    padding-top: 35px;
    padding-bottom: 35px;
}

/* Filter Cards - Enhanced */
.filter-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.filter-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #0d47a1;
}

.filter-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a2b4b;
    padding-bottom: 14px;
    border-bottom: 2px solid #0d47a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-list li {
    margin-bottom: 14px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1a2b4b;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.filter-checkbox:hover {
    background: #f8fafc;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0d47a1;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked {
    background-color: #0d47a1;
}

.search-map-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(13, 71, 161, 0.08);
    box-shadow: 0 8px 24px rgba(13, 71, 161, 0.08);
    margin-bottom: 30px;
}

.search-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    background: #f8fafc;
}

.search-map-header h2 {
    margin: 0 0 8px;
    font-size: 19px;
    color: #0f172a;
}

.search-map-header p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
}

.map-legend-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0d47a1;
    box-shadow: 0 0 0 6px rgba(13, 71, 161, 0.12);
}

.search-results-map {
    min-height: 420px;
    width: 100%;
}

.map-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    color: #475569;
    font-size: 15px;
    padding: 24px;
}

.service-card.active-card {
    outline: 3px solid rgba(13, 71, 161, 0.25);
    box-shadow: 0 0 0 2px rgba(13, 71, 161, 0.12);
}

/* Results Content */
.results-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 24px;
    border-bottom: 2px solid #f8fafc;
}

/* Results Grid - Horizontal Cards */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 45px;
}

.results-grid .service-card {
    display: flex;
    flex-direction: row;
    gap: 24px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
}

.results-grid .service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
    border-color: rgba(13, 71, 161, 0.2);
}

/* Service Image */
.service-image {
    position: relative;
    width: 320px;
    min-width: 320px;
    height: 240px;
    background: #f8fafc;
    border-radius: 20px 0 0 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
}

.results-grid .service-card:hover .service-image img {
    transform: scale(1.03);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, #0d47a1 0%, #0a3d8a 100%);
    color: white;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 16px rgba(13, 71, 161, 0.3);
    backdrop-filter: blur(10px);
}

/* Service Info */
.service-info {
    padding: 24px 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.service-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.15;
    max-width: calc(100% - 140px);
}

.service-stars {
    display: flex;
    gap: 5px;
    min-width: max-content;
    margin-top: 3px;
}

.service-stars i {
    font-size: 14px;
    color: #fbbf24;
    transition: all 0.2s ease;
}

.service-desc {
    font-size: 14px;
    color: #475569;
    margin: 8px 0 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
}

/* Location */
.service-location-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.location-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 600;
}

.distance-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 600;
}

.location-text i,
.distance-text i {
    color: #0d47a1;
    font-size: 16px;
}

/* Action Buttons */
.service-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
}

.service-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
    border: 1px solid transparent;
    text-decoration: none;
    width: auto;
    flex: 0 0 auto;
    min-width: 110px;
}

.service-actions .btn-primary-solid {
    background: #0d47a1;
    color: #ffffff;
    border-color: transparent;
}

.service-actions .btn-primary-solid:hover {
    background: #0b3b8d;
}

.service-actions .btn-outline {
    background: transparent;
    color: #0d47a1;
    border: 1px solid #0d47a1;
}

.service-actions .btn-outline:hover {
    background: rgba(13, 71, 161, 0.08);
}

/* Responsive: allow stacking on very small screens */
@media (max-width: 420px) {
    .service-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .service-actions .btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.service-actions .btn-primary-solid {
    background: linear-gradient(135deg, #0d47a1 0%, #0a3d8a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.2);
}

.service-actions .btn-primary-solid:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(13, 71, 161, 0.35);
}

.service-actions .btn-outline {
    background: transparent;
    color: #0d47a1;
    border: 2px solid #0d47a1;
}

.service-actions .btn-outline:hover {
    background: #0d47a1;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(13, 71, 161, 0.2);
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 100px 40px;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.03) 0%, rgba(13, 71, 161, 0.01) 100%);
    border-radius: 16px;
    grid-column: 1 / -1;
    border: 2px dashed #e2e8f0;
}

.no-results::before {
    content: '🔍';
    display: block;
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.4;
}

.no-results p {
    font-size: 18px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
    padding-top: 35px;
    border-top: 2px solid #f8fafc;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    background: white;
    color: #1a2b4b;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    margin: 4px;
    cursor: pointer;
    text-decoration: none;
}

.page-link:hover {
    background: #0d47a1;
    color: white;
    border-color: #0d47a1;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.25);
}

.page-link.active {
    background: linear-gradient(135deg, #0d47a1 0%, #0a3d8a 100%);
    color: white;
    border-color: #0d47a1;
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.3);
}

.page-link.prev, .page-link.next {
    padding: 0 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Tablet & Small Desktop */
@media (max-width: 1200px) {
    .search-layout {
        grid-template-columns: 260px 1fr;
        gap: 28px;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .search-controls {
        margin-bottom: 24px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .filter-block {
        padding: 18px;
    }

    .filter-summary {
        justify-content: flex-start;
    }

    .search-main-grid {
        grid-template-columns: 1fr;
    }

    .search-map-aside {
        order: 2;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        flex-direction: column;
    }

    .service-image {
        width: 100%;
        min-width: auto;
        height: 260px;
        border-radius: 20px 20px 0 0;
    }

    .service-info {
        padding: 22px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .search-results-page {
        padding: 25px 0;
    }
    
    .search-results-header {
        padding: 35px 25px;
        margin-bottom: 35px;
        border-radius: 16px;
    }
    
    .search-query-title {
        font-size: 32px;
    }
    
    .search-layout {
        gap: 20px;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-card {
        padding: 22px;
    }
    
    .results-content {
        padding: 24px;
    }
    
    .results-grid {
        gap: 20px;
    }
    
    .service-image {
        height: 200px;
    }
    
    .service-info {
        padding: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .search-results-header {
        padding: 28px 20px;
        margin-bottom: 25px;
    }
    
    .search-query-title {
        font-size: 26px;
        margin-bottom: 10px;
    }
    
    .results-count {
        font-size: 14px;
    }
    
    .search-layout {
        gap: 16px;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .filter-card {
        padding: 18px;
        margin-bottom: 0;
    }
    
    .filter-title {
        font-size: 14px;
        margin-bottom: 14px;
    }
    
    .results-content {
        padding: 18px;
    }
    
    .results-grid {
        gap: 16px;
    }
    
    .service-image {
        height: 180px;
    }
    
    .service-info {
        padding: 16px;
    }
    
    .service-title {
        font-size: 15px;
    }
    
    .service-desc {
        font-size: 12px;
    }
    
    .service-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 12px;
        margin: 2px;
    }
}
