/* SVG World Map – Frontend Styles */

.swm-map-wrapper {
    position: relative;
    width: 100%;
    background: transparent;
    overflow: visible;   /* Tooltip darf nach unten/außen ragen */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    user-select: none;
}

/* ── SVG Container ───────────────────────────────── */
.swm-svg-container {
    width: 100%;
    /* Höhe kommt von JS via inline style – position:relative damit Block-Höhe gilt */
    position: relative;
    cursor: grab;
    overflow: hidden;
    background: transparent;
}

/* SVG hat feste Pixel-Größe, kein width:100% → immer scharf */
.swm-svg-container svg {
    display: block;
    transform-origin: 0 0;
    image-rendering: auto;
}

.swm-svg-container svg path,
.swm-svg-container svg polygon {
    transition: fill 0.15s, opacity 0.15s;
}

/* ── Zoom Controls ───────────────────────────────── */
.swm-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.swm-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #1e3a5f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    backdrop-filter: blur(4px);
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
    padding: 0;
}

.swm-btn:hover {
    background: #fff;
    transform: scale(1.08);
}

.swm-zoom-reset { font-size: 14px; }

@media (max-width: 768px) {
    /* Auf Mobile: nur Reset-Button, kein Zoom-In/Out */
    .swm-zoom-in,
    .swm-zoom-out { display: none; }
}

/* ── Hint-Overlay ──────────────────────────────────── */
.swm-hint-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(2px);
    z-index: 20;
    pointer-events: none;
    border-radius: inherit;
    animation: swm-hint-fade 0.3s ease-out;
}

@keyframes swm-hint-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.swm-hint-overlay.swm-hint-hiding {
    animation: swm-hint-fadeout 0.4s ease-in forwards;
}

@keyframes swm-hint-fadeout {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.swm-hint-line {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.92);
    border-radius: 20px;
    padding: 7px 14px 7px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    white-space: nowrap;
}

/* ── Tooltip ─────────────────────────────────────── */
.swm-tooltip {
    position: fixed;
    width:         var(--swm-tt-width,  320px);
    max-width:     calc(100vw - 16px);
    background:    var(--swm-tt-bg,     #ffffff);
    border-radius: var(--swm-tt-radius, 12px);
    border:        var(--swm-tt-border, none);
    box-shadow:    var(--swm-tt-shadow, 0 8px 32px rgba(0,0,0,0.18));
    z-index: 2147483647;
    overflow: hidden;
    animation: swm-tooltip-in 0.18s ease-out;
}

@keyframes swm-tooltip-in {
    from { opacity: 0; transform: scale(0.92) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.swm-tooltip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: background 0.15s;
    z-index: 1;
}

.swm-tooltip-close:hover { background: #e2e8f0; }

.swm-tooltip-content {
    padding: 16px 18px 18px;
    max-height: 70vh;
    overflow-y: auto;
}

.swm-tooltip-title {
    font-size:     var(--swm-tt-title-size,   16px)  !important;
    font-weight:   var(--swm-tt-title-weight, 700)   !important;
    color:         var(--swm-tt-title-color,  #1e293b) !important;
    line-height:   1.3  !important;
    margin:        0 0 10px !important;
    padding:       0 24px 8px 0 !important;
    border:        none !important;
    border-bottom: var(--swm-tt-title-border, 2px solid #e2e8f0) !important;
    font-family:   inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.swm-tooltip-content p  { margin: 0 0 8px; font-size: 14px; color: #374151; line-height: 1.6; }
.swm-tooltip-content h2 { font-size: 15px; margin: 12px 0 6px; color: #1e293b; }
.swm-tooltip-content h3 { font-size: 14px; margin: 10px 0 4px; color: #1e293b; }
.swm-tooltip-content img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.swm-tooltip-content ul,
.swm-tooltip-content ol  { padding-left: 20px; margin: 6px 0; }
.swm-tooltip-content li  { font-size: 13px; color: #374151; margin-bottom: 3px; }
.swm-tooltip-content a   { color: #2563eb; text-decoration: underline; }

.swm-tooltip-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 14px;
}

.swm-tooltip-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: swm-spin 0.6s linear infinite;
    margin-right: 10px;
}

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

/* ── Pin pulse animation ─────────────────────────── */
@keyframes swm-pulse {
    0%   { r: 10px; opacity: 0.4; }
    100% { r: 20px; opacity: 0; }
}

/* ── Error state ─────────────────────────────────── */
.swm-error {
    color: #dc2626;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}
