/**
 * Kliniksuche (suche.php) – Formular, Ergebnisliste, Karte, Paginierung
 */

.search-guide {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.35rem;
    background: linear-gradient(165deg, #f8fafc 0%, #fff 42%);
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.search-guide__title {
    font-size: clamp(1.05rem, 2.2vw, 1.2rem);
    margin: 0 0 0.45rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    line-height: 1.3;
}
.search-guide__lead {
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #334155;
}
.search-guide__steps {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}
.search-guide__steps li { margin-bottom: 0.4rem; }
.search-guide__steps li:last-child { margin-bottom: 0; }
.search-guide__subhead {
    font-size: 1rem;
    margin: 0 0 0.45rem;
    font-weight: 600;
    color: #1e40af;
    line-height: 1.3;
}
.search-guide__p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #334155;
}
.search-guide__p:last-of-type { margin-bottom: 0.45rem; }
.search-guide__list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}
.search-guide__list li { margin-bottom: 0.35rem; }
.search-guide__list li:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
    .search-guide { padding: 1rem; margin-bottom: 1.2rem; }
}
.search-form { width: 100%; max-width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.75rem; align-items: end; margin-bottom: 1.5rem; padding: 1.25rem 1.35rem; background: #fff; border-radius: 0.5rem; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.search-form .form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.search-form .form-row-full { grid-column: 1 / -1; }
.search-form .form-row-ort-km { display: flex; flex-direction: row; gap: 1.25rem; align-items: flex-end; }
.search-form .form-row-ort-km .flex-1 { flex: 1 1 55%; min-width: 0; }
.search-form .form-row-ort-km .form-row-km { flex: 0 0 clamp(5.5rem, 12vw, 7.5rem); }
.search-form .form-row-ort-km .form-row-km input { height: 2.5rem !important; min-height: 2.5rem !important; }
.search-form .form-row-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.search-form .form-row-actions .form-row-year { flex: 0 1 min(100%, 11rem); min-width: 8rem; }
.search-form .form-row-actions .form-row-submit { flex: 1 1 auto; display: flex; flex-direction: column; align-items: stretch; margin-top: 0; min-width: min(100%, 12rem); }
@media (min-width: 640px) {
    .search-form .form-row-actions .form-row-submit { align-items: flex-end; }
}
.search-form label { font-weight: 500; font-size: 0.9rem; }
.search-form input[type="number"],
.search-form select,
.search-form button { height: 2.5rem; min-height: 2.5rem; padding: 0 0.75rem; font-size: 1rem; border: 1px solid #d1d5db; border-radius: 0.375rem; box-sizing: border-box; }
.search-form input[type="number"] { width: 100%; line-height: 1; }
.search-form select { min-width: 0; }
.search-form button { background: var(--color-primary); color: white; border: none; cursor: pointer; font-weight: 500; }
.search-form button:hover { opacity: 0.9; }
.autocomplete-wrap { position: relative; }
.autocomplete-input { width: 100%; height: 2.5rem; padding: 0 0.75rem; font-size: 1rem; border: 1px solid #d1d5db; border-radius: 0.375rem; box-sizing: border-box; }
#ortInput.ort-input-invalid { border-color: #faa; background-color: #faa; }
#ortInput.ort-input-valid { border-color: #6a6; background-color: #afa; }
#behandlungInput.behandlung-input-invalid { border-color: #faa; background-color: #faa; }
#behandlungInput.behandlung-input-valid { border-color: #6a6; background-color: #afa; }
#radiusInput.radius-input-invalid { border-color: #faa; background-color: #faa; }
#radiusInput.radius-input-valid { border-color: #6a6; background-color: #afa; }
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #ccc; border-top: none; max-height: 200px; overflow-y: auto; z-index: 100; box-shadow: 0 4px 6px rgba(0,0,0,0.1); border-radius: 0 0 0.375rem 0.375rem; }
.autocomplete-item { padding: 0.5rem 0.75rem; cursor: pointer; }
.autocomplete-item:hover { background: #f0f0f0; }
.results { width: 100%; max-width: 100%; }
.results-heading-map { display: grid; grid-template-columns: 1fr min(440px, 64vw); gap: 1rem 1.25rem; align-items: start; margin-bottom: 0.35rem; }
.results-heading-text { min-width: 0; }
.results h2 { font-size: clamp(1.15rem, 2.5vw, 1.35rem); margin: 0 0 0.35rem 0; }
.results-heading-text .data-source-info { margin-top: 0.35rem; }
.search-map-wrap { width: 100%; justify-self: end; }
/* Feste Kartengröße: Leaflet braucht zuverlässige Pixelmaße (absolute-only Kind im aspect-ratio-Kasten führt in manchen Browsern zu _map-Fehlern). */
.search-map-inner { width: 100%; max-width: 440px; min-width: 320px; height: 440px; position: relative; border-radius: 0.5rem; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.08); background: #e5e7eb; }
#searchResultsMap { position: relative; width: 100%; height: 440px; min-height: 440px; z-index: 1; }
.leaflet-div-icon.search-map-num-marker { margin: 0 !important; border: 2px solid #fff !important; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.search-map-num-marker { background: #1e40af !important; color: #fff !important; border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex !important; align-items: center; justify-content: center; }
.search-map-num-marker span { line-height: 1; }
.search-map-legend { font-size: 0.72rem; color: var(--color-muted); line-height: 1.35; margin-top: 0.35rem; max-width: 440px; margin-left: auto; text-align: right; }
@media (max-width: 640px) {
    .results-heading-map { grid-template-columns: 1fr; }
    .search-map-wrap { justify-self: stretch; max-width: 560px; margin: 0 auto; }
    .search-map-inner { max-width: none; min-width: 0; width: 100%; height: min(440px, 85vw); margin: 0 auto; }
    #searchResultsMap { height: min(440px, 85vw); min-height: min(440px, 85vw); }
    .search-map-legend { margin-left: 0; text-align: left; max-width: none; }
}
.results-table-wrap { margin: 0 0 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0.5rem; border: 1px solid #e5e7eb; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.results-table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 0.95rem; }
.results-table.results-table--no-treatment { min-width: 28rem; }
.search-farther-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.search-farther-section h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.search-farther-hint { font-size: 0.88rem; color: var(--color-muted); margin: 0 0 1rem; max-width: 65ch; }
.search-in-radius-empty { color: var(--color-muted); margin: 0 0 1rem; }
.results-table th, .results-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.results-table thead th { background: #f3f4f6; font-weight: 600; font-size: 0.875rem; color: var(--color-text); }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr:hover { background: #f9fafb; }
.results-table .col-compare { width: 2.75rem; text-align: center; vertical-align: middle; }
.results-table .col-compare label { cursor: pointer; display: flex; justify-content: center; align-items: center; min-height: 2rem; }
.results-table .col-dist { text-align: right; white-space: nowrap; vertical-align: middle; }
.results-table .col-treatment { vertical-align: middle; }
.results-table .col-link { white-space: nowrap; vertical-align: middle; }
.results-table .clinic-name { font-weight: 600; color: inherit; text-decoration: none; }
.results-table .clinic-name:hover { text-decoration: underline; color: var(--color-primary); }
.results-table .clinic-meta { font-size: 0.82rem; color: var(--color-muted); margin-top: 0.25rem; display: block; line-height: 1.4; }
.results-table .clinic-ext-url { font-size: 0.8rem; margin-top: 0.35rem; display: inline-block; }
.results-table .treatment-pill { font-weight: 600; color: #1e40af; background: #dbeafe; padding: 0.12rem 0.4rem; border-radius: 0.25rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.data-source-info { font-size: 0.85rem; color: var(--color-muted, #666); margin: 0.5rem 0 1rem 0; max-width: 65ch; }
.search-synonym-info {
    margin: 0.25rem 0 0.75rem 0;
    padding: 0.65rem 0.85rem;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 70ch;
}
.results-meta { margin-bottom: 1.15rem; padding: 0.65rem 0.85rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 0.375rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.65rem; }
.results-meta .sort-select { padding: 0.25rem 0.5rem; font-size: 0.9rem; border-radius: 0.25rem; }
.back-link { margin-top: 1.5rem; }
.results-top-ad { margin-bottom: 1rem; }
.pagination { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.pagination-info { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--color-muted); }
.pagination-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pagination-btn, .pagination-num { padding: 0.35rem 0.75rem; font-size: 0.9rem; background: #f3f4f6; color: var(--color-text); text-decoration: none; border-radius: 0.375rem; }
.pagination-btn:hover, .pagination-num:hover { background: #e5e7eb; color: var(--color-primary); }
.pagination-current { padding: 0.35rem 0.75rem; font-size: 0.9rem; font-weight: 600; color: var(--color-primary); }
.pagination-ellipsis { padding: 0 0.25rem; color: var(--color-muted); }
.results-scroll-top { font-size: 0.9rem; color: var(--color-primary); text-decoration: none; }
.results-scroll-top:hover { text-decoration: underline; }
@media (max-width: 600px) {
    .search-form { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
    .search-form .form-row-ort-km { flex-direction: column; align-items: stretch; }
    .search-form .form-row-ort-km .form-row-km { flex: 1 1 auto; }
    .search-form .form-row-actions { flex-direction: column; align-items: stretch; }
    .search-form .form-row-actions .form-row-submit { justify-content: stretch; }
    .search-form .form-row-actions .form-row-submit button { width: 100%; }
}

/* Ladebalken beim Absenden der Suche */
.search-loadingbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: rgba(37, 99, 235, 0.18);
    z-index: 9999;
    display: none;
}
.search-loadingbar .bar {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, rgba(37,99,235,0), rgba(37,99,235,1), rgba(37,99,235,0));
    transform: translateX(-100%);
    animation: search-loadingbar-move 0.95s ease-in-out infinite;
}
@keyframes search-loadingbar-move {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(320%); }
}
