/**
 * Steuerberater Map Styles v2.0
 */

/* Container */
.stb-map-container {
    width: 100%;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Map */
#stb-map {
    width: 100%;
    min-height: 400px;
    position: relative;
}

/* Filter Section */
.stb-map-filters {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.stb-filter-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stb-filter-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.stb-filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.stb-search-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#stb-search-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
}

#stb-search-btn,
#stb-reset-btn {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

#stb-search-btn:hover,
#stb-reset-btn:hover {
    background: #005a87;
}

#stb-reset-btn {
    background: #6c757d;
}

#stb-reset-btn:hover {
    background: #545b62;
}

/* Umkreissuche Section */
.stb-umkreis-suche {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 2px solid #5a67d8;
}

.stb-umkreis-suche h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.stb-umkreis-controls {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.stb-umkreis-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stb-umkreis-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

#stb-umkreis-plz {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    width: 120px;
}

#stb-umkreis-plz::placeholder {
    color: rgba(255,255,255,0.6);
}

#stb-umkreis-plz:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

#stb-umkreis-radius,
#stb-umkreis-type {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    min-width: 150px;
}

#stb-umkreis-radius option,
#stb-umkreis-type option {
    background: #5a67d8;
    color: white;
}

.stb-btn-primary,
.stb-btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stb-btn-primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stb-btn-primary:hover {
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stb-btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.stb-btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

/* Umkreis Ergebnisse */
.stb-umkreis-results {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

.stb-umkreis-results h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: white;
}

.stb-results-count {
    margin-bottom: 15px;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

.stb-results-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.stb-results-list::-webkit-scrollbar {
    width: 8px;
}

.stb-results-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.stb-results-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.stb-results-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

.stb-result-item {
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.stb-result-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateX(5px);
}

.stb-result-item.stb-result-kunde {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.15);
}

.stb-result-item.stb-result-bewerber {
    border-left-color: #28a745;
}

.stb-result-item.stb-result-kanzlei {
    border-left-color: #007bff;
}

.stb-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.stb-result-type {
    font-size: 20px;
    min-width: 28px;
}

.stb-result-header strong {
    flex-grow: 1;
    font-size: 15px;
    color: white;
}

.stb-result-distance {
    padding: 3px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.stb-result-location {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-left: 38px;
}

.stb-result-detail {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-left: 38px;
    margin-top: 3px;
}

.stb-no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-style: italic;
}

/* Webhook Section */
.stb-webhook-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 152, 0, 0.1);
    border: 2px solid rgba(255, 152, 0, 0.3);
    border-radius: 6px;
}

.stb-webhook-alert {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 4px;
}

.stb-webhook-alert p {
    margin: 0;
    color: white;
    font-size: 14px;
}

.stb-webhook-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stb-webhook-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stb-webhook-input-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

#stb-webhook-url {
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    width: 100%;
}

#stb-webhook-url::placeholder {
    color: rgba(255,255,255,0.5);
}

#stb-webhook-url:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.stb-btn-webhook {
    padding: 12px 20px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.stb-btn-webhook:hover:not(:disabled) {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.stb-btn-webhook:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.stb-webhook-status {
    margin-top: 10px;
}

.stb-webhook-status > div {
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.stb-webhook-success {
    background: rgba(40, 167, 69, 0.2);
    color: #90EE90;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.stb-webhook-error {
    background: rgba(220, 53, 69, 0.2);
    color: #ffb3ba;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.stb-webhook-info {
    background: rgba(0, 123, 255, 0.2);
    color: #a6d8ff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

/* Custom Markers */
.stb-custom-marker {
    background: none !important;
    border: none !important;
}

.stb-marker {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.stb-marker svg {
    transform: rotate(45deg);
    width: 18px;
    height: 18px;
}

.stb-marker:hover {
    transform: rotate(-45deg) scale(1.1);
}

/* Marker hervorgehoben */
.stb-marker-highlight .stb-marker {
    animation: pulse 2s infinite;
    transform: rotate(-45deg) scale(1.2);
    z-index: 1000 !important;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* Marker Colors */
.stb-marker-bewerber {
    background: #28a745;
    border: 2px solid #1e7e34;
}

.stb-marker-bewerber svg {
    color: white;
}

.stb-marker-kanzlei {
    background: #007bff;
    border: 2px solid #0056b3;
}

.stb-marker-kanzlei svg {
    color: white;
}

.stb-marker-kunde {
    background: #ffc107;
    border: 2px solid #d39e00;
}

.stb-marker-kunde svg {
    color: #212529;
}

.stb-marker-center {
    background: #e83e8c;
    border: 2px solid #c21e62;
    border-radius: 50%;
    transform: none;
}

.stb-marker-center svg {
    color: white;
    transform: none;
}

/* Filter Labels */
.stb-filter-label {
    position: relative;
    padding-left: 22px;
}

.stb-filter-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.stb-filter-bewerber::before {
    background: #28a745;
}

.stb-filter-kanzlei::before {
    background: #007bff;
}

.stb-filter-kunde::before {
    background: #ffc107;
}

/* Popup Styles */
.stb-popup {
    min-width: 250px;
    max-width: 350px;
}

.stb-popup h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.stb-popup-content {
    margin-top: 10px;
}

.stb-popup-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.stb-popup-content strong {
    color: #333;
    font-weight: 600;
}

.stb-popup-content a {
    color: #007bff;
    text-decoration: none;
}

.stb-popup-content a:hover {
    text-decoration: underline;
}

.stb-kunde-badge {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
}

/* Legend */
.stb-map-legend {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.stb-map-legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.stb-legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-size: 14px;
    color: #666;
}

.stb-legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    margin-right: 8px;
    display: inline-block;
}

.stb-legend-marker.stb-marker-bewerber {
    background: #28a745;
    border: 2px solid #1e7e34;
}

.stb-legend-marker.stb-marker-kanzlei {
    background: #007bff;
    border: 2px solid #0056b3;
}

.stb-legend-marker.stb-marker-kunde {
    background: #ffc107;
    border: 2px solid #d39e00;
}

.stb-legend-marker.stb-marker-radius {
    background: rgba(0, 123, 255, 0.2);
    border: 2px solid #007bff;
    border-radius: 50%;
    transform: none;
}

/* Cluster Styles */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .stb-map-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stb-filter-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .stb-search-group {
        flex-direction: column;
        width: 100%;
    }
    
    #stb-search-input {
        width: 100%;
    }
    
    #stb-search-btn,
    #stb-reset-btn {
        width: 100%;
    }
    
    .stb-umkreis-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stb-umkreis-input-group {
        width: 100%;
    }
    
    #stb-umkreis-plz,
    #stb-umkreis-radius,
    #stb-umkreis-type {
        width: 100%;
    }
    
    .stb-btn-primary,
    .stb-btn-secondary {
        width: 100%;
    }
    
    .stb-legend-item {
        display: block;
        margin-bottom: 5px;
    }
}

/* Loading State */
.stb-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.stb-map-loading::after {
    content: 'Lade Kartendaten...';
    display: block;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* WordPress Admin Styles */
.wrap .card {
    max-width: 100%;
    padding: 20px;
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.wrap .card h2 {
    margin-top: 0;
    color: #23282d;
}

.wrap .card h3 {
    color: #555;
    margin-top: 20px;
}

.wrap .card code {
    background: #f3f4f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
}