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

body, html {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow: hidden;
}

#map {
    height: 100vh;
    width: 100%;
}

.layer-selector {
    margin-bottom: 15px;
}

.layer-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.layer-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.controls-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 15px;
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}

.mode-selector {
    margin-bottom: 15px;
}

.mode-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.mode-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.altitude-control {
    margin-bottom: 15px;
}

.altitude-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.altitude-control input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

#altitude-value {
    font-weight: normal;
    color: #667eea;
}

.ascent-rate-control {
    margin-bottom: 15px;
}

.ascent-rate-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.ascent-rate-control input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

#ascent-rate-value {
    font-weight: normal;
    color: #667eea;
}

.time-control {
    margin-bottom: 15px;
}

.time-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.time-control input[type="range"] {
    width: 100%;
    margin: 5px 0;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.time-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.time-control input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-control input[type="range"]:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

.time-control input[type="range"]:disabled::-moz-range-thumb {
    cursor: not-allowed;
}

.prediction-file-selector {
    margin-bottom: 15px;
}

.prediction-file-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.prediction-file-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.controls-panel h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.controls-panel textarea {
    width: 100%;
    height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
}

.controls-panel button {
    margin: 5px 5px 5px 0;
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.controls-panel button:hover {
    background: #5a6fd8;
}

.controls-panel button.secondary {
    background: #6c757d;
}

.controls-panel button.secondary:hover {
    background: #5a6268;
}

.status {
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Target detail panel */
#target-detail {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 15px;
    width: 280px;
}

.target-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: bold;
    color: #333;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.field-row label {
    width: 40px;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
}

.field-row input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* Icon button */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
}

.icon-btn:hover {
    background: #f0f0f0;
}

/* Danger button */
button.danger {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    width: 100%;
    margin-top: 8px;
}

button.danger:hover {
    background: #c82333;
}

/* Modal */
#json-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#json-modal.open {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.modal-header {
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
}

.modal-box textarea {
    flex: 1;
    min-height: 300px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
}

.modal-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.modal-footer {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.modal-footer button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-footer button:first-child {
    background: #667eea;
    color: white;
}

.modal-footer button.secondary {
    background: #6c757d;
    color: white;
}

/* predictions-actions */
.predictions-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Checkbox row */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

/* Map interaction hint */
.map-hint {
    margin-top: 6px;
    font-size: 11px;
    color: #999;
}

/* Field unit label (e.g. "m" after radius input) */
.field-unit {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

/* Add-type popup menu */
#add-type-menu {
    display: none;
    position: fixed;
    z-index: 1500;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    overflow: hidden;
    min-width: 160px;
}

#add-type-menu.open {
    display: block;
}

#add-type-menu button {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

#add-type-menu button:last-child {
    border-bottom: none;
}

#add-type-menu button:hover {
    background: #f5f5f5;
}

/* Logo in bottom left corner */
.logo {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    pointer-events: none;
}

.logo a {
    display: block;
    pointer-events: auto;
}

.logo img {
    height: 80px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.logo img:hover {
    opacity: 1.0;
}

