/* ==========================================================
   Animapet – „Platz im Regenbogen-Blumen-Land" (Leaflet-UI)
   WMS/WFS-Karte mit Parzellen-Buchung.
   ========================================================== */

.animapet-place {
    margin-top: 0.5rem;
}

/* „Grab ändern oder freigeben“- + „Spielfreunde auswählen“-Regler */
.animapet-place__toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem 1rem;
    margin: 0 0 0.6rem;
}

.animapet-place__editswitch {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2f4a2a;
}

.animapet-place__editswitch-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.animapet-place__editswitch-track {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #c2ccbe;
    transition: background 0.15s ease;
}

.animapet-place__editswitch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.animapet-place__editswitch-cb:checked + .animapet-place__editswitch-track {
    background: #3f7a34;
}

.animapet-place__editswitch-cb:checked + .animapet-place__editswitch-track .animapet-place__editswitch-thumb {
    transform: translateX(20px);
}

.animapet-place__editswitch-cb:focus-visible + .animapet-place__editswitch-track {
    outline: 2px solid #3f7a34;
    outline-offset: 2px;
}

/* „Gedenkort buchen“ als Pro-Funktion gekennzeichnet (Nicht-Pro) */
.animapet-place__toolbar--locked {
    align-items: center;
    gap: 0.5rem;
}

.animapet-place__toolbar--locked .animapet-place__editswitch {
    opacity: 0.5;
    filter: grayscale(1);
    cursor: not-allowed;
    pointer-events: none;
}

.animapet-place__probadge {
    display: inline-flex;
    align-items: center;
    padding: 0.12em 0.6em;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: #6d28d9;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Karte + Status-Overlay */
.animapet-place__mapwrap {
    position: relative;
}

.animapet-place__map {
    height: 70vh;
    min-height: 460px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid #d8e3d4;
    background: #dce7d7;
    overflow: hidden;
    z-index: 0;
}

/* Schrift an die Theme-Schrift binden: bricht eine geerbte Monospace-Schrift
   (z. B. Shortcode in einem Preformatted-/Code-Block) auf und überschreibt zugleich
   Leaflets fest gesetzte „Helvetica Neue“ auf .leaflet-container. */
.animapet-place,
.animapet-place .leaflet-container {
    font-family: var(--global-body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}

/* Status-Badge, mittig über der Karte (leer → ausgeblendet) */
.animapet-place__status {
    position: absolute;
    z-index: 500;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #3f7a34;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.animapet-place__status:empty {
    display: none;
}

/* ── Buchen/Freigeben-Popup ────────────────────────────── */
.animapet-place__popup .leaflet-popup-content {
    margin: 0.75rem 0.9rem;
}

.animapet-place__pop {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 190px;
    font-size: 0.92rem;
    color: #333;
}

.animapet-place__pop p {
    margin: 0;
}

.animapet-place__pop-drag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.2rem -0.2rem -0.2rem;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    background: #eef5ea;
    color: #5f7d57;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
}

.animapet-place__pop-drag::before {
    content: "\2830";
    font-size: 1.05rem;
    line-height: 1;
}

.animapet-place__pop-label {
    font-weight: 600;
    color: #2f4a2a;
}

.animapet-place__pop-select,
.animapet-place__pop-symbol {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cddccb;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.animapet-place__pop-btn,
.animapet-place__pop-release {
    width: 100%;
}

.animapet-place__pop-msg {
    min-height: 1rem;
    font-size: 0.82rem;
    color: #b3261e;
}

.animapet-place__pop-msg:empty {
    display: none;
}

/* Info-Popup (fremd belegte Parzelle / GetFeatureInfo) */
.rbl-gfi {
    font-size: 0.9rem;
    line-height: 1.45;
}

.rbl-gfi strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #3f7a34;
}

.rbl-gfi-row { display: flex; gap: 0.5rem; }
.rbl-gfi-k   { min-width: 5rem; color: #667; }
.rbl-tip-type { color: #666; font-weight: 400; }

/* Fallback-Buttons, falls Basis-Styles fehlen */
.animapet-place .animapet-btn,
.animapet-place__popup .animapet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.animapet-place .animapet-btn--primary,
.animapet-place__popup .animapet-btn--primary {
    background: #3f7a34;
    color: #fff;
}

.animapet-place .animapet-btn--primary:hover,
.animapet-place__popup .animapet-btn--primary:hover {
    background: #356b2c;
}

.animapet-place__popup .animapet-btn--danger {
    background: #b3261e;
    color: #fff;
}

.animapet-place__popup .animapet-btn--danger:hover {
    background: #97201a;
}

.animapet-btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ── Bereichsübersicht: freie Plätze je Bereich ────────── */
.animapet-place__areas {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #d8e3d4;
    border-radius: 12px;
}

.animapet-place__areas:empty {
    display: none;
}

.animapet-place__areas-title {
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2f4a2a;
}

.animapet-place__areas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.animapet-place__area {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #d8e3d4;
    border-radius: 999px;
    background: #f2f8ef;
    color: #1f2a24;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.animapet-place__area:hover {
    background: #e4f1dd;
    border-color: #b8d4ab;
}

.animapet-place__area-name {
    font-weight: 600;
}

.animapet-place__area-count {
    color: #3f7a34;
    font-variant-numeric: tabular-nums;
}

.animapet-place__area--full .animapet-place__area-count {
    color: #b3261e;
}

/* Deine Tiere & Ruhestätten – oberhalb der Karte */
.animapet-place__mypets {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #d8e3d4;
    border-radius: 12px;
}

.animapet-place__mypets:empty {
    display: none;
}

.animapet-place__mypets-title {
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2f4a2a;
}

.animapet-place__mypets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
}

.animapet-place__pet {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #cfe0c8;
    border-radius: 10px;
    background: #f2f8ef;
    color: #1f2a24;
    font: inherit;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.animapet-place__pet:hover {
    background: #e4f1dd;
    border-color: #b8d4ab;
}

.animapet-place__pet--none {
    background: #f4f4f2;
    border-color: #e0e0dc;
    cursor: default;
}

.animapet-place__pet-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.animapet-place__pet-grave {
    font-size: 0.78rem;
    color: #3f7a34;
}

.animapet-place__pet--none .animapet-place__pet-grave {
    color: #8a8a84;
}

/* „Spielfreunde auswählen“ – Regler (lila) + Tier-Auswahlmenü */
.animapet-place__playswitch .animapet-place__editswitch-cb:checked + .animapet-place__editswitch-track {
    background: #c026d3;
}

.animapet-place__playswitch .animapet-place__editswitch-cb:focus-visible + .animapet-place__editswitch-track {
    outline-color: #c026d3;
}

.animapet-place__playpick {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2f4a2a;
}

.animapet-place__playpick[hidden] {
    display: none;
}

.animapet-place__playpick-select {
    padding: 0.3rem 0.5rem;
    border: 1px solid #cfe0c8;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: #1f2a24;
}

/* Spielfreunde je Tier im „Deine Tiere“-Panel */
.animapet-place__mypet {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1 1 240px;
    min-width: 220px;
    max-width: 360px;
}

.animapet-place__playmates {
    align-self: stretch;
    padding: 0.45rem 0.55rem;
    background: #faf7fd;
    border: 1px solid #ecdcf7;
    border-radius: 10px;
}

.animapet-place__playmates.is-active {
    border-color: #d8a7ef;
    box-shadow: 0 0 0 2px rgba(192, 38, 211, 0.15);
}

.animapet-place__playmates-title {
    margin-bottom: 0.3rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: #7a2ea6;
}

.animapet-place__playmates-subtitle {
    margin: 0.5rem 0 0.3rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: #7a2ea6;
}

.animapet-place__playmates-subtitle:first-child {
    margin-top: 0;
}

.animapet-place__playmates-hint {
    margin-bottom: 0.35rem;
    font-size: 0.76rem;
    color: #6d5480;
}

.animapet-place__playmates-empty {
    font-size: 0.78rem;
    color: #9a86a8;
}

.animapet-place__playmates-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.animapet-place__playmate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.3rem;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2a24;
}

a.animapet-place__playmate:hover {
    background: #f1e6f9;
}

.animapet-place__playmate-img {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #efe7f5;
}

.animapet-place__playmate-img--none {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.animapet-place__playmate-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.animapet-place__playmate-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.animapet-place__playmate-art {
    font-size: 0.74rem;
    color: #7a2ea6;
}

/* Spielfreunde-Hinweis im WFS-Info-Popup */
.animapet-place__pop-playhint {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid #eee;
    font-size: 0.82rem;
    color: #7a2ea6;
}

/* Testmodus-Schalter (Pro) im Profil-Tab „Meine Daten“ */
.animapet-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.animapet-check input {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .animapet-place__map {
        height: 60vh;
        min-height: 360px;
    }
}
