/* Tagespflegestellen Karte */

.tp-map-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin: 25px 0;
    min-height: 500px;
}

.tp-map-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#tpMap {
    height: 500px;
    width: 100%;
}

/* Marker */
.tp-marker-icon {
    background: none !important;
    border: none !important;
}

.tp-marker {
    width: 28px;
    height: 36px;
    background: var(--primary-blue);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    border: 3px solid white;
    position: relative;
}

.tp-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.tp-marker--active {
    background: var(--primary-orange);
    transform: rotate(-45deg) scale(1.2);
}

/* Cluster Icons – Corporate Design */
.marker-cluster-small {
    background-color: rgba(0, 100, 173, 0.25);
}
.marker-cluster-small div {
    background-color: var(--primary-blue, #0064ad);
}

.marker-cluster-medium {
    background-color: rgba(232, 89, 12, 0.25);
}
.marker-cluster-medium div {
    background-color: #e8590c;
}

.marker-cluster-large {
    background-color: rgba(232, 89, 12, 0.3);
}
.marker-cluster-large div {
    background-color: #d63c00;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    color: white;
    font-weight: 700;
    font-family: var(--font-body, 'PT Sans Narrow', sans-serif);
}

/* Detail Panel */
.tp-detail-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 25px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    overflow-y: auto;
    height: 500px;
}

.tp-detail--visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Detail empty state */
.tp-detail-panel:not(.tp-detail--visible)::after {
    content: 'Klicken Sie auf einen Marker, um Details anzuzeigen.';
    color: var(--text-medium);
    font-size: 0.9rem;
    text-align: center;
    padding: 40px 20px;
    opacity: 1;
}

.tp-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-medium);
    line-height: 1;
    padding: 4px 8px;
}

.tp-detail-close:hover {
    color: var(--text-dark);
}

.tp-detail-panel {
    position: relative;
}

/* Header mit Avatar */
.tp-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tp-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    background: #e8f0f5;
}

.tp-detail-header-text {
    min-width: 0;
}

.tp-detail-name {
    color: var(--primary-blue);
    font-size: 1.1rem;
    margin: 0 0 3px;
    line-height: 1.3;
}

.tp-detail-person {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin: 0;
}

/* Steckbrief-Auszug */
.tp-detail-excerpt {
    font-size: 0.88rem;
    color: var(--text-medium);
    line-height: 1.5;
    margin: 0 0 16px;
    font-style: italic;
}

/* Profil-Button */
.tp-detail-btn {
    display: block;
    text-align: center;
    background: var(--primary-blue);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 18px;
    transition: background 0.2s ease;
}

.tp-detail-btn:hover {
    background: var(--primary-blue-dark);
    color: white;
}

.tp-detail-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.tp-detail-row svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary-blue);
}

.tp-detail-row a {
    color: var(--primary-blue);
    text-decoration: none;
}

.tp-detail-row a:hover {
    text-decoration: underline;
}

/* Filter */
.tp-filter {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tp-filter label {
    font-weight: 500;
    white-space: nowrap;
}

.tp-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.tp-filter .tp-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 350px;
}

.tp-filter .tp-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.tp-filter .tp-search-wrapper input[type="text"] {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 8px 30px 8px 34px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.tp-filter .tp-search-wrapper input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-blue, #0064ad);
    box-shadow: 0 0 0 2px rgba(0, 100, 173, 0.15);
}

.tp-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.tp-search-clear:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .tp-map-wrapper {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    #tpMap {
        height: 350px;
    }

    .tp-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tp-filter label {
        display: none;
    }

    .tp-filter select {
        width: 100%;
    }

    .tp-filter .tp-search-wrapper {
        max-width: none;
        min-width: 0;
    }

    .tp-detail-panel {
        max-height: none;
        height: auto !important;
        position: static;
        border-radius: 12px;
        margin-top: 15px;
    }

    .tp-detail-panel:not(.tp-detail--visible) {
        display: none;
    }

    .tp-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .tp-detail-avatar {
        margin: 0 auto;
    }
}
