/**
 * TQ Map - Styles (v1.4)
 * Datei: /wp-content/plugins/tq-map/assets/css/tq-map.css
 */

.tq-map-wrapper {
    width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid #e9ecef;
}

/* INFO-BAR */
.tq-map-infobar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}
.tq-map-title { font-weight: 600; color: #2d2d2d; }
.tq-map-distance {
    margin-left: auto;
    background: #228B22;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ROUTING BAR */
.tq-routing-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}
.tq-routing-label { font-size: 12px; color: #6c757d; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.tq-route-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px;
    border: 1.5px solid #dee2e6; border-radius: 20px;
    background: #fff; color: #495057;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.18s ease;
}
.tq-route-btn:hover  { border-color: #228B22; color: #228B22; background: #f0faf0; }
.tq-route-btn.active { background: #228B22; border-color: #228B22; color: #fff; box-shadow: 0 2px 8px rgba(34,139,34,0.3); }

.tq-start-routing {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 16px;
    background: #2563EB; color: #fff; border: none;
    border-radius: 20px; font-size: 13px; font-weight: 600;
    cursor: pointer; margin-left: 6px;
    transition: background 0.18s ease;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.tq-start-routing:hover { background: #1d4ed8; }
.tq-route-loading { font-size: 12px; color: #6c757d; font-style: italic; }
.tq-route-clear {
    display: inline-flex; align-items: center;
    padding: 5px 10px;
    border: 1.5px solid #dee2e6; border-radius: 20px;
    background: #fff; color: #adb5bd; font-size: 12px;
    cursor: pointer; margin-left: auto;
    transition: all 0.18s ease;
}
.tq-route-clear:hover { border-color: #dc3545; color: #dc3545; background: #fff5f5; }

/* FEHLER + CONTROLS */
.tq-route-error { background: #fff3cd; border-left: 4px solid #ffc107; color: #856404; padding: 8px 14px; font-size: 13px; }
.tq-map-controls { display: flex; gap: 6px; padding: 7px 14px; background: #fff; border-bottom: 1px solid #e9ecef; flex-wrap: wrap; }
.tq-map-controls button {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px;
    border: 1.5px solid #dee2e6; border-radius: 20px;
    background: #fff; color: #495057;
    font-size: 12px; font-weight: 500; cursor: pointer;
    transition: all 0.18s ease;
}
.tq-map-controls button:hover { border-color: #2563EB; color: #2563EB; background: #eff6ff; }

/* KARTE */
.tq-map-canvas { width: 100%; display: block; z-index: 1; }
.tq-map-no-coords { padding: 16px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; color: #856404; font-size: 14px; }

/* ============================================
   BAUM PIN - Einfacher klassischer Marker
   iconSize [36,46], iconAnchor [18,46]
   = Spitze zeigt exakt auf Koordinate
   ============================================ */
.tq-pin {
    position: relative;
    width: 36px;
    height: 46px;
}

/* Puls-Ringe */
.tq-pin-pulse {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    background: rgba(34,139,34,0.3);
    border-radius: 50%;
    animation: tq-shadow-pulse 2s ease-out infinite;
}
.tq-pin-pulse--2 { animation-delay: 0.8s; background: rgba(34,139,34,0.15); }

@keyframes tq-shadow-pulse {
    0%   { transform: translateX(-50%) scale(1);   opacity: 0.6; }
    100% { transform: translateX(-50%) scale(2.5); opacity: 0; }
}

/* Pin-Körper: Kreis mit Spitze nach unten */
.tq-pin-body {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    background: #228B22;
    border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}
/* Spitze des Pins nach unten */
.tq-pin-body::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid #228B22;
}

/* NUTZER DOT */
.tq-user-dot {
    width: 16px; height: 16px;
    background: #2563EB;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #2563EB, 0 2px 8px rgba(0,0,0,0.25);
    animation: tq-user-pulse 2s ease-out infinite;
}
@keyframes tq-user-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.5), 0 2px 8px rgba(0,0,0,0.25); }
    70%  { box-shadow: 0 0 0 10px rgba(37,99,235,0), 0 2px 8px rgba(0,0,0,0.25); }
    100% { box-shadow: 0 0 0 0 rgba(37,99,235,0), 0 2px 8px rgba(0,0,0,0.25); }
}

/* BADGES */
.tq-badge, .tq-zustand {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
    white-space: nowrap; line-height: 1.6;
}
.tq-badge--geprueft        { background: #d4edda; color: #155724; }
.tq-badge--in-pruefung     { background: #fff3cd; color: #856404; }
.tq-badge--nicht-geprueft  { background: #f8f9fa; color: #6c757d; border: 1px solid #dee2e6; }
.tq-zustand--unauffaellig  { background: #d4edda; color: #155724; }
.tq-zustand--auffaellig    { background: #fff3cd; color: #856404; }
.tq-zustand--beschaedigt   { background: #f8d7da; color: #721c24; }

/* LEAFLET OVERRIDES */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
}
.leaflet-popup-content { margin: 10px 14px !important; line-height: 1.6 !important; }
.leaflet-routing-container { display: none !important; }

/* RESPONSIVE */
@media (max-width: 600px) {
    .tq-map-infobar  { flex-direction: column; align-items: flex-start; }
    .tq-map-distance { margin-left: 0; }
    .tq-route-btn    { font-size: 12px; padding: 4px 8px; }
    .tq-route-clear  { margin-left: 0; }
    .tq-start-routing { font-size: 12px; padding: 5px 12px; margin-left: 0; }
}
