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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Login screen */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    width: 360px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.login-card .subtitle {
    color: #888;
    font-size: 13px;
    margin-bottom: 24px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#email-input {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
}

#email-input:focus {
    border-color: #4a90d9;
}

#login-btn {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #4a90d9;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

#login-btn:hover { background: #3a7bc8; }
#login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.message {
    margin-top: 16px;
    font-size: 13px;
    min-height: 20px;
}

.message.error { color: #e74c3c; }
.message.success { color: #2ecc71; }

/* Map */
#app { display: flex; height: 100vh; }
#map { flex: 1; height: 100%; }

/* Controls panel */
#controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
    width: 240px;
    z-index: 1;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    font-size: 13px;
}

.control-group {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.control-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.control-group > label:first-child {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

select, input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
}

select:focus, input[type="text"]:focus {
    border-color: #4a90d9;
}

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

.checkbox input { margin: 0; }

.fd-input-row {
    display: flex;
    gap: 4px;
}

.fd-input-row input { flex: 1; }

.fd-input-row button,
#logout-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    cursor: pointer;
    font-size: 12px;
}

.fd-input-row button:hover,
#logout-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#fd-overlays-list {
    margin-top: 6px;
}

.fd-overlay-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 11px;
    font-family: monospace;
}

.fd-overlay-item button {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#user-email {
    font-size: 11px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

/* Popup */
.mapboxgl-popup-content {
    background: rgba(26, 26, 46, 0.95) !important;
    color: #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 10px 14px !important;
    font-size: 12px;
    max-width: 300px;
    max-height: 300px;
    overflow-y: auto;
}

.mapboxgl-popup-close-button {
    color: #888 !important;
    font-size: 16px;
}

.mapboxgl-popup-tip {
    border-top-color: rgba(26, 26, 46, 0.95) !important;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
}

.popup-table td {
    padding: 2px 0;
    vertical-align: top;
}

.popup-table td:first-child {
    color: #888;
    padding-right: 8px;
    white-space: nowrap;
}
