/*
 * Copyright (C) 2025 TomTom Navigation B.V.
 * Licensed under the Apache License, Version 2.0
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    min-height: 600px;
    background: transparent;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

#sdk-map {
    width: 100%;
    height: 100%;
    min-height: 600px;
}

/* ---------------------------------------------------------------------------
   Dynamic Map popup styling (uses shared poi-popup-container base)
   --------------------------------------------------------------------------- */

.dynamic-map-popup-container .maplibregl-popup-tip {
    border-top-color: #fff;
}

.dm-popup {
    padding: 14px 20px 16px;
    min-width: 220px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.dm-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    margin-right: 28px;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.dm-popup-category {
    font-size: 13px;
    font-weight: 500;
    color: #504f4f;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

.dm-popup-description {
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 6px;
}

.dm-popup-address {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 8px;
}

.dm-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.dm-popup-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f3f4f6;
    color: #374151;
}

.dm-popup-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.dm-badge-critical { background: #fef2f2; color: #dc2626; }
.dm-badge-high     { background: #fff7ed; color: #ea580c; }
.dm-badge-normal   { background: #eff6ff; color: #2563eb; }
.dm-badge-low      { background: #f0fdf4; color: #16a34a; }

.dm-popup-details {
    border-top: 1px solid #e5e7eb;
    margin-top: 4px;
    padding-top: 8px;
}

.dm-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.dm-popup-key {
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 70px;
}

.dm-popup-value {
    word-break: break-word;
}

.dm-traffic-delay {
    color: #ea580c;
    font-weight: 600;
}

/* Navigation controls positioning */
.maplibregl-ctrl-top-left {
    top: 10px;
    left: 10px;
}

.maplibregl-ctrl-bottom-left {
    bottom: 30px;
    left: 10px;
}

/* ---------------------------------------------------------------------------
   Polygon label pill — HTML marker on the map
   --------------------------------------------------------------------------- */

.polygon-label-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

.polygon-label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.polygon-label-text {
    font-size: 12px;
    font-weight: 700;
    color: #333333;
    line-height: 1;
}

/* ---------------------------------------------------------------------------
   Incident popup styles (for traffic incidents toggle)
   --------------------------------------------------------------------------- */

.incident-popup {
    padding: 16px 20px 14px;
    min-width: 220px;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.incident-popup-title {
    font-size: 16px;
    color: #111827;
    font-weight: 700;
    margin-bottom: 12px;
    margin-right: 20px;
    line-height: 1.3;
}

.incident-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.incident-popup-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-top: 1px;
    color: #9ca3af;
}
