body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', Helvetica, Arial, sans-serif;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background: radial-gradient(circle at center, #19304f, #0c1729);
}

/* Simulator filter styling */
.simulator-filter {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(4px);
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.simulator-filter label {
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
    color: #374151;
}

.simulator-filter select {
    border: none;
    background: transparent;
    font-size: 12px;
    outline: none;
}

/* Popup styling - Compact Modern Design */
.airport-popup {
    max-width: 280px;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Title */
.airport-popup .popup-title {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* Type icon (airport/landscape) */
.airport-popup .popup-type-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    margin-top: 2px;
}

.airport-popup .popup-title .package-name-link {
    color: #1e40af;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.airport-popup .popup-title .package-name-link::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url('external-link.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.airport-popup .popup-title .package-name-link:hover {
    color: #2563eb;
}

.airport-popup .popup-title .package-name-link:hover::after {
    opacity: 1;
}

/* Airport codes (own row below title) */
.airport-popup .popup-codes {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.airport-popup .popup-codes .code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Subtitle (developer + price, or package + developer + price) */
.airport-popup .popup-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.airport-popup .popup-subtitle .package-name-link {
    color: #1e40af;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.airport-popup .popup-subtitle .package-name-link::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url('external-link.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.airport-popup .popup-subtitle .package-name-link:hover {
    color: #2563eb;
}

.airport-popup .popup-subtitle .package-name-link:hover::after {
    opacity: 1;
}

.airport-popup .popup-subtitle .price {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 2px;
}

.airport-popup .popup-subtitle .price.free {
    background: #dcfce7;
    color: #15803d;
}

.airport-popup .popup-subtitle .price.paid {
    background: #dbeafe;
    color: #1d4ed8;
}

.airport-popup .popup-subtitle .price.installed,
.airport-popup .popup-subtitle .price.enabled {
    background: #dcfce7;
    color: #15803d;
}

.airport-popup .popup-subtitle .price.error {
    background: #fef2f2;
    color: #dc2626;
}

/* Description */
.airport-popup .popup-description {
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 6px;
}

/* Footer with simulator badges only */
.airport-popup .popup-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.airport-popup .popup-footer .simulator-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.airport-popup .popup-footer .simulator-badge.msfs-2020 {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.airport-popup .popup-footer .simulator-badge.msfs-2024 {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* Error message */
.airport-popup .error-message {
    margin-top: 8px;
    padding: 6px 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    font-size: 11px;
    font-weight: 500;
}


/* Legend control styling improvements */
.simatlas-legend {
    min-width: 120px;
}

.simatlas-legend input[type="checkbox"] {
    cursor: pointer;
}

/* Package management controls styling */
.package-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.package-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 12px;
}

.package-toggle input[type="checkbox"] {
    cursor: pointer;
}

.package-toggle input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.package-toggle:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

.package-toggle:has(input:disabled) span {
    color: #9ca3af;
}

/* Primary toggle styling for the main activate checkbox */
.package-toggle.primary-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.package-toggle.primary-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.package-toggle.primary-toggle .toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.package-toggle.primary-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #22c55e;
    cursor: pointer;
}

.package-toggle.primary-toggle:has(input:checked) {
    background: #dcfce7;
    border-color: #22c55e;
}

.package-toggle.primary-toggle:has(input:checked) .toggle-label {
    color: #15803d;
}

/* Subscribe button styling - matches primary-toggle appearance */
.subscribe-button.primary-action-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 7px;
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.subscribe-button.primary-action-button:hover {
    background: #bfdbfe;
    border-color: #2563eb;
}

/* Status message styling - separate box below activate */
.status-message {
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 0;
    margin-bottom: 8px;
}

.status-message.status-success {
    background: #dcfce7;
    color: #15803d;
}

.status-message.status-error {
    background: #fef2f2;
    color: #dc2626;
}

.status-message.status-warning {
    background: #fef3c7;
    color: #d97706;
}

.status-message.status-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-message.status-neutral {
    background: #f1f5f9;
    color: #64748b;
}

.download-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background: #2563eb;
}

.download-progress {
    margin-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 11px;
    color: #64748b;
}

.download-complete {
    text-align: center;
    margin-top: 8px;
}

.download-status {
    color: #15803d;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.status-inactive {
    background: #fef2f2;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}