/**
 * Locator-Karte Styles
 * Nur auf /amateurfunk/locator-karte/ geladen
 */

/* ==================== Tool-Bereich ==================== */
.locator-tool {
    margin: 1.5rem 0 2rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius, 8px);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==================== Suchleiste ==================== */
.locator-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.locator-search input {
    flex: 1;
    min-width: 140px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #dee2e6);
    border-radius: 4px;
    font-size: 1rem;
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.locator-search input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.locator-search input.error {
    border-color: #dc3545;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.locator-search-buttons {
    display: flex;
    gap: 0.5rem;
}

.locator-search button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

#locator-search-btn {
    background: var(--primary, #2563eb);
    color: white;
}

#locator-search-btn:hover {
    background: var(--primary-dark, #1d4ed8);
}

#locator-geo-btn {
    background: #f8f9fa;
    color: var(--text, #212529);
    border: 1px solid var(--border, #dee2e6);
}

#locator-geo-btn:hover {
    background: #e9ecef;
}

#locator-geo-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ==================== Karten-Container ==================== */
#locator-map {
    width: 100%;
    height: 500px;
    border-radius: 4px;
    z-index: 1;
}

/* ==================== Info-Panel ==================== */
.locator-info {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border, #dee2e6);
    align-items: center;
    gap: 1rem;
}

.locator-info.visible {
    display: flex;
}

.locator-info-locator {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, #2563eb);
    font-family: monospace;
    letter-spacing: 1px;
}

.locator-info-coords {
    font-size: 0.9rem;
    color: #6c757d;
    font-family: monospace;
}

.locator-copy-btn {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border, #dee2e6);
    border-radius: 4px;
    background: white;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-light, #6c757d);
    transition: all 0.2s;
}

.locator-copy-btn:hover {
    background: var(--primary, #2563eb);
    color: white;
    border-color: var(--primary, #2563eb);
}

/* ==================== Entfernungsrechner ==================== */
.locator-distance {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #dee2e6);
}

.locator-distance strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.locator-distance-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.locator-distance-inputs input {
    width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #dee2e6);
    border-radius: 4px;
    font-size: 1rem;
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.locator-distance-inputs input:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.locator-distance-arrow {
    color: #6c757d;
    font-size: 1.2rem;
}

.locator-distance-inputs button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    background: var(--primary, #2563eb);
    color: white;
    transition: background 0.2s;
}

.locator-distance-inputs button:hover {
    background: var(--primary-dark, #1d4ed8);
}

.locator-distance-result {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--text, #212529);
    min-height: 1.5em;
}

.locator-distance-result .distance-value {
    font-weight: 700;
    color: var(--primary, #2563eb);
    font-size: 1.1rem;
}

/* ==================== Grid-Labels ==================== */
.grid-label {
    background: none;
    border: none;
    text-align: center;
    font-weight: 600;
    color: #2563eb;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.9),
                 -1px -1px 2px rgba(255,255,255,0.9);
    white-space: nowrap;
    pointer-events: none;
}

.grid-label-field {
    font-size: 14px;
}

.grid-label-square {
    font-size: 11px;
}

.grid-label-subsquare {
    font-size: 10px;
    font-weight: 500;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .locator-tool {
        padding: 0.75rem;
    }

    #locator-map {
        height: 400px;
    }

    .locator-search {
        flex-wrap: wrap;
    }

    .locator-search input {
        min-width: 100%;
    }

    .locator-search-buttons {
        width: 100%;
    }

    .locator-search-buttons button {
        flex: 1;
    }

    .locator-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .locator-distance-inputs {
        flex-wrap: wrap;
    }

    .locator-distance-inputs input {
        flex: 1;
        min-width: 0;
    }

    .locator-distance-arrow {
        display: none;
    }

    .locator-distance-inputs button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #locator-map {
        height: 320px;
    }
}

/* ==================== Geolocation-Spinner ==================== */
.locator-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Geolocation-Modal ==================== */
.geo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.geo-modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.geo-modal h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.geo-modal > p {
    margin: 0 0 1rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.geo-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.geo-modal-close:hover {
    color: #212529;
}

.geo-modal-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.geo-modal-step {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.geo-modal-step strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.geo-modal-step ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
