/* Main Layout */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

#map {
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* Data Panel */
.data-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    max-width: 300px;
    font-size: 14px;
}

.data-row {
    margin-bottom: 8px;
}

.data-label {
    font-weight: bold;
    display: inline-block;
    width: 120px;
}

/* Control Buttons */
.button-group {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location-btn {
    background-color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.location-btn i {
    color: #2196F3;
    font-size: 24px;
}

.location-btn.active {
    background-color: #2196F3;
}

.location-btn.active i {
    color: white;
}

/* Mode Switch */
.mode-switch {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
}

.mode-switch label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* POI Form */
.poi-form {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    max-width: 300px;
    display: none;
}

.poi-form.active {
    display: block;
}

.poi-form input, .poi-form button {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.poi-form button {
    background-color: #2196F3;
    color: white;
    border: none;
    cursor: pointer;
}

/* Status Indicator */
.status-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1500;
}

.status-indicator.show {
    opacity: 1;
}

/* Trail Markers */
.trail {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(33, 150, 243, 0.6);
    z-index: 990;
    transition: opacity 2s;
}

/* Diagnostic Panel */
.diagnostic-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    display: none;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.diagnostic-container.active {
    display: block;
}

.diagnostic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.diagnostic-overlay.active {
    display: block;
}

.diagnostic-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
}

.diagnostic-toggle-btn i {
    color: #2196F3;
    font-size: 20px;
}

.source-geo {
    background-color: #E3F2FD;
    color: #1976D2;
}

.source-wifi {
    background-color: #E8F5E9;
    color: #388E3C;
}

.source-dr {
    background-color: #FFF3E0;
    color: #E64A19;
}

/* iOS Sensor Request Button */
.ios-sensor-notice {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 1500;
    text-align: center;
    max-width: 300px;
    display: none;
}

.ios-sensor-notice.show {
    display: block;
}

.ios-sensor-notice button {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
}

/* Testing Controls */
.testing-controls {
    position: fixed;
    bottom: 250px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.testing-controls button {
    padding: 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.testing-controls #sim-step {
    margin-bottom: 5px;
    width: 100%;
}

.direction-buttons {
    display: flex;
    gap: 5px;
}

.direction-buttons button {
    flex: 1;
}

/* Diagnostic Panel Styles */
.diagnostic-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    font-size: 13px;
    max-width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.diagnostic-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.diagnostic-panel h4 {
    margin: 10px 0 5px 0;
    font-size: 14px;
}

.diagnostic-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.highlight-section {
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #2196F3;
}

.diagnostic-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.diagnostic-label {
    font-weight: bold;
    color: #555;
}

.diagnostic-value {
    text-align: right;
}

.status-active {
    color: #4CAF50;
    font-weight: bold;
}

.status-inactive {
    color: #9E9E9E;
}

.status-failed {
    color: #F44336;
}

.status-unknown {
    color: #FF9800;
}

.active-source {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    padding: 8px;
    background-color: #E3F2FD;
    border-radius: 4px;
    margin-top: 5px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.diagnostic-button {
    flex: 1;
    padding: 8px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.diagnostic-button:hover {
    background-color: #1E88E5;
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
    }
}

/* iOS-specific tweaks */
@supports (-webkit-touch-callout: none) {
    .diagnostic-panel {
        font-size: 12px;
    }
    
    .diagnostic-panel h3 {
        font-size: 15px;
    }
    
    .diagnostic-panel h4 {
        font-size: 13px;
    }
}