body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* GPS Status indicator */
.gps-status {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 12px;
    z-index: 1000;
}

.gps-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: red;
    margin-right: 8px;
}

.gps-status.gps-active .gps-indicator {
    background-color: #4CAF50;
}

/* Precision mode indicator */
.precision-mode-indicator {
    position: fixed;
    top: 10px;
    left: 155px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 12px;
    z-index: 1000;
}

.precision-mode-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #FFB300;
}

/* Toast notification - improved professional styling */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(35, 35, 35, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1500;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    max-width: 80%;
    width: auto;
    white-space: normal;
    backdrop-filter: blur(4px);
    border-left: 3px solid #2196F3;
    animation: toastFadeIn 0.3s ease-out, toastFadeOut 0.3s ease-in 2.7s forwards;
    pointer-events: none;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -20px); }
}

/* Different toast types */
.toast.success {
    border-left-color: #4CAF50;
}

.toast.warning {
    border-left-color: #FF9800;
}

.toast.error {
    border-left-color: #F44336;
}

/* Coords display for GPS positions */
.coords-container {
    flex: 1;
    padding: 5px 0;
}

.coords-box {
    margin-bottom: 8px;
}

.coords-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 2px;
}

#coords-stereo70-ancpi {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background-color: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 3px;
    padding: 5px 8px;
    color: #e65100;
}

/* Control bar with buttons */
.control-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Buttons container */
.buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
    position: relative;
    z-index: 1001;
}

/* Buttons styling */
.buttons-container button {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* New button styles with modern design */
#storePointsButton, 
#polygonStatsButton, 
#sharePointsButton, 
#stakeoutButton, 
#objectivesButton,
#arViewButton {
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 42px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Button color scheme */
#storePointsButton {
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
}

#polygonStatsButton {
    background: linear-gradient(to bottom, #2196F3, #1976D2);
}

#sharePointsButton {
    background: linear-gradient(to bottom, #9C27B0, #7B1FA2);
}

#objectivesButton {
    background: linear-gradient(to bottom, #FF9800, #F57C00);
}

#stakeoutButton {
    background: linear-gradient(to bottom, #F44336, #D32F2F);
}

/* Add AR button to the color scheme */
#arViewButton {
    background: linear-gradient(to bottom, #673AB7, #512DA8);
}

/* Hover and active states with subtle effects */
#storePointsButton:hover, #storePointsButton:focus,
#polygonStatsButton:hover, #polygonStatsButton:focus,
#sharePointsButton:hover, #sharePointsButton:focus,
#objectivesButton:hover, #objectivesButton:focus,
#stakeoutButton:hover, #stakeoutButton:focus,
#arViewButton:hover, #arViewButton:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#storePointsButton:active,
#polygonStatsButton:active,
#sharePointsButton:active,
#objectivesButton:active,
#stakeoutButton:active,
#arViewButton:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Replace AR button specific styling with improved version */
#arViewButton.active {
    background: linear-gradient(to bottom, #FF9800, #F57C00);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

/* Active state animation for AR button */
#arViewButton.active .button-icon {
    animation: pulse 1.5s infinite;
}

/* Share modal styling */
.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.share-option {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
}

.share-option-icon {
    font-size: 24px;
    margin-right: 15px;
}

.share-close-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-top: 10px;
    width: 100%;
}

/* Always visible coords box */
.coords-box.always-visible {
    display: block !important;
    visibility: visible !important;
}

/* Position marker with direction arrow */
.position-marker {
    width: 24px !important;
    height: 24px !important;
    background-color: transparent;
    border-radius: 50%;
    position: relative;
    transform-origin: center center;
}

/* Direction arrow styling - truly integrated with dot */
.direction-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -10px; /* Wider arrow base for better visibility */
    margin-top: -26px; /* Position it at top of the dot */
    border-left: 10px solid transparent; /* Wider arrow */
    border-right: 10px solid transparent; /* Wider arrow */
    border-bottom: 24px solid #2196F3; /* Longer arrow (24px instead of 20px) */
    transform-origin: center 24px; /* Set rotation origin to bottom center of arrow */
    z-index: 1;
}

/* Inner dot to create integrated appearance */
.position-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background-color: #2196F3;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* Arrow color variations for stakeout mode */
.direction-arrow.correct-direction {
    border-bottom-color: #4CAF50;
    filter: drop-shadow(0 0 5px rgba(76, 175, 80, 0.5));
}

.direction-arrow.wrong-direction {
    border-bottom-color: #F44336;
}

.direction-arrow.neutral-direction {
    border-bottom-color: #FF9800;
}

/* When in correct direction, also change the dot color */
.position-marker.correct-direction .position-dot {
    background-color: #4CAF50;
}

.position-marker.wrong-direction .position-dot {
    background-color: #F44336;
}

.position-marker.neutral-direction .position-dot {
    background-color: #FF9800;
}

/* Stakeout-specific styles */
.stakeout-info-container {
    position: fixed !important;
    top: 50% !important;
    right: 10px !important;
    left: auto !important; /* Explicitly override any left positioning */
    bottom: auto !important; /* Explicitly override any bottom positioning */
    transform: translateY(-50%) !important;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    width: 180px !important; /* Slightly wider for better readability */
    max-width: 180px !important; /* Enforce maximum width */
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 !important; /* Remove any margin that might affect positioning */
}

.stakeout-header {
    background-color: #9c27b0;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stakeout-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.stakeout-distance {
    padding: 12px 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.stakeout-distance.far {
    color: #666;
}

.stakeout-distance.close {
    color: #FF9800;
}

.stakeout-distance.very-close {
    color: #4CAF50;
}

.stakeout-distance.arrived {
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.stakeout-navigation-info {
    padding: 0 15px 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.stakeout-actions {
    display: flex;
    border-top: 1px solid #eee;
    overflow: hidden;
}

.stakeout-btn {
    flex: 1;
    border: none;
    background-color: #f5f5f5;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
}

.stakeout-btn:hover {
    background-color: #e0e0e0;
}

.stakeout-btn.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-icon {
    margin-right: 5px;
}

.arrived-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    z-index: 1500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Target and guideline styling */
.target-icon {
    font-size: 24px;
    text-align: center;
}

.distance-label {
    background-color: white;
    border-radius: 15px;
    padding: 3px 10px;
    font-size: 12px;
    color: #9c27b0;
    border: 1px solid #9c27b0;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    text-align: center;
    pointer-events: none;
}

.distance-changed div {
    animation: pulse-once 0.8s ease-out;
}

.pulse-once {
    animation: pulse-once 0.8s ease-out;
}

@keyframes pulse-once {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.value-changed {
    animation: highlight 1s ease-out;
}

@keyframes highlight {
    0% { background-color: rgba(156, 39, 176, 0.2); }
    100% { background-color: transparent; }
}

.line-animated {
    animation: dashdraw 15s linear infinite;
}

@keyframes dashdraw {
    to { stroke-dashoffset: -100; }
}

/* Fix for accuracy circle to ensure it's visible */
.accuracy-circle {
    stroke: #2196F3 !important;
    fill: rgba(33, 150, 243, 0.15) !important;
    stroke-width: 2px !important;
}

/* Accuracy circle style */
.accuracy-circle {
    stroke: #2196F3;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    fill: rgba(33, 150, 243, 0.1);
}

/* Position marker style */
.position-marker {
    background-color: #2196F3;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

/* Control bar with coordinates and buttons */
.control-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 94%;
    max-width: 500px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 130px;
    overflow: visible;
}

/* Coordinates container */
.coords-container {
    width: 100%;
    min-height: 40px;
    display: block !important;
    visibility: visible !important;
    margin-bottom: 10px;
}

.coords-box {
    padding: 2px 0;
    display: block !important;
}

.coords-label {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    display: block !important;
}

#coords-stereo70-ancpi {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    font-weight: bold;
    display: block !important;
    color: #e65100 !important;
}

/* Buttons container */
.buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 5px; /* Reduced gap between buttons */
    width: 100%;
    min-height: 40px; /* Reduced from 45px */
    position: relative;
    z-index: 1001;
    visibility: visible !important;
    display: flex !important;
}

/* Button styles */
#storePointsButton, 
#polygonStatsButton, 
#sharePointsButton, 
#stakeoutButton, 
#objectivesButton {
    padding: 8px 5px; /* Reduced padding */
    border: none;
    border-radius: 4px;
    font-size: 13px; /* Reduced font size */
    font-weight: bold;
    color: white;
    cursor: pointer;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    min-width: 0;
    display: block !important;
    min-height: 40px; /* Reduced from 45px */
    max-height: 40px; /* Added to ensure consistent height */
    visibility: visible !important;
    margin: 0; /* Reset any margin */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .buttons-container {
        flex-direction: row;
        flex-wrap: wrap; /* Allow wrapping on very small screens */
    }
    
    #storePointsButton, 
    #polygonStatsButton, 
    #sharePointsButton, 
    #stakeoutButton, 
    #objectivesButton {
        padding: 5px 4px;
        font-size: 12px;
        min-height: 36px; /* Even smaller on mobile */
        max-height: 36px;
    }
    
    #storePointsButton, 
    #polygonStatsButton, 
    #sharePointsButton, 
    #stakeoutButton, 
    #objectivesButton,
    #arViewButton {
        padding: 6px 3px;
        min-height: 38px;
    }
}

/* Extra small screens */
@media (max-width: 370px) {
    .buttons-container {
        gap: 4px;
    }
    
    #storePointsButton, 
    #polygonStatsButton, 
    #sharePointsButton, 
    #stakeoutButton, 
    #objectivesButton {
        font-size: 11px;
        padding: 4px 3px;
        min-height: 34px;
        max-height: 34px;
    }
    
    .button-icon {
        display: none; /* Hide icons on very small screens */
    }
    
    #stakeoutButton, 
    #objectivesButton,
    #arViewButton {
        flex-basis: 48%;
        margin-top: 4px;
    }
}

/* Polygon stats overlay */
.polygon-stats-overlay {
    position: fixed;
    bottom: 150px; /* Adjusted position to be well above the mobile control bar */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1500; /* Ensure it's above other elements */
    max-width: 90%;
    width: 320px;
    text-align: center;
}

.polygon-stats-overlay h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2e7d32;
    font-size: 18px;
}

.polygon-stats-value {
    font-weight: bold;
    font-size: 18px;
    color: #1b5e20;
    margin-bottom: 8px; /* Reduced margin */
    display: block; /* Ensure each stat is on a new line */
}

.stats-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px; /* Larger for easier clicking */
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px; /* Add some padding */
    line-height: 1;
}

.stats-close-btn:hover {
    color: #333; /* Darker color on hover */
}

/* Share options modal */
.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    width: 300px;
    max-width: 90%;
    display: none;
}

.share-modal h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.share-option {
    padding: 10px;
    border-radius: 4px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

.share-option:hover {
    background-color: #e0e0e0;
}

.share-option-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.share-close-btn {
    width: 100%;
    padding: 8px;
    border: none;
    background-color: #f44336;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.share-close-btn:hover {
    background-color: #d32f2f;
}

/* Stakeout information container - moved to right side */
.stakeout-info-container {
    position: fixed !important;
    top: 50% !important;
    right: 10px !important;
    left: auto !important; /* Explicitly override any left positioning */
    bottom: auto !important; /* Explicitly override any bottom positioning */
    transform: translateY(-50%) !important;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    width: 180px !important; /* Slightly wider for better readability */
    max-width: 180px !important; /* Enforce maximum width */
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 !important; /* Remove any margin that might affect positioning */
}

/* Direction arrow */
.stakeout-arrow {
    font-size: 48px;
    transform-origin: center;
    transition: transform 0.3s ease-out;
    color: #2196F3;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.stakeout-arrow.arrived {
    color: #4CAF50;
    animation: pulse 1s infinite alternate;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .control-bar {
        width: 96%;
        padding: 6px 8px;
        max-width: none;
    }
    
    .buttons-container {
        flex-direction: row;
    }
    
    #storePointsButton, #polygonStatsButton, #sharePointsButton {
        padding: 5px 6px;
        font-size: 12px;
    }
}

/* Extra small screens */
@media (max-width: 370px) {
    .control-bar {
        width: 98%;
        padding: 4px 6px;
    }
    
    .coords-label {
        font-size: 11px;
    }
    
    #coords-stereo70-ancpi {
        font-size: 12px;
    }
    
    #storePointsButton, #polygonStatsButton, #sharePointsButton {
        max-width: 50%;
        padding: 4px 5px;
        font-size: 11px;
    }
}

/* Force visibility for all screen sizes */
@media (min-width: 601px) {
    .coords-container, .coords-box, .coords-label, #coords-stereo70-ancpi {
        display: block !important;
        visibility: visible !important;
    }
    
    .control-bar, .coords-container, .buttons-container, .coords-box, .coords-label, #coords-stereo70-ancpi, 
    #storePointsButton, #polygonStatsButton, #sharePointsButton, #stakeoutButton {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .buttons-container {
        display: flex !important;
        min-height: 45px;
    }
}

/* Extra large screens */
@media (min-width: 1200px) {
    .control-bar {
        max-width: 600px;
        min-height: 140px;
        padding: 18px;
    }
    
    #storePointsButton, #polygonStatsButton, #sharePointsButton, #stakeoutButton {
        font-size: 16px;
        min-height: 50px;
    }
}

/* Compass permission dialog styling */
.compass-permission {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    width: 85%;
    max-width: 350px;
    z-index: 2000;
    text-align: center;
}

.compass-permission h3 {
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 16px;
}

.compass-permission p {
    font-size: 16px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 20px;
}

.compass-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.compass-buttons button {
    flex: 1;
    font-size: 16px;
    padding: 12px 10px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.compass-buttons button.primary {
    background-color: #2196F3;
    color: white;
}

.compass-buttons button.primary:hover {
    background-color: #1976D2;
}

.compass-buttons button.secondary {
    background-color: #f0f0f0;
    color: #555;
}

.compass-buttons button.secondary:hover {
    background-color: #e0e0e0;
}

/* Position marker with integrated direction arrow - redesigned */
.position-marker {
    width: 24px !important;
    height: 24px !important;
    background-color: transparent;
    border-radius: 50%;
    position: relative;
    transform-origin: center center;
}

/* Direction arrow styling - truly integrated with dot */
.direction-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -10px; /* Wider arrow base for better visibility */
    margin-top: -26px; /* Position it at top of the dot */
    border-left: 10px solid transparent; /* Wider arrow */
    border-right: 10px solid transparent; /* Wider arrow */
    border-bottom: 24px solid #2196F3; /* Longer arrow (24px instead of 20px) */
    transform-origin: center 24px; /* Set rotation origin to bottom center of arrow */
    z-index: 1;
}

/* Inner dot to create integrated appearance */
.position-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background-color: #2196F3;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* Arrow color variations for stakeout mode */
.direction-arrow.correct-direction {
    border-bottom-color: #4CAF50;
    filter: drop-shadow(0 0 5px rgba(76, 175, 80, 0.5));
}

.direction-arrow.wrong-direction {
    border-bottom-color: #F44336;
}

.direction-arrow.neutral-direction {
    border-bottom-color: #FF9800;
}

/* When in correct direction, also change the dot color */
.position-marker.correct-direction .position-dot {
    background-color: #4CAF50;
}

.position-marker.wrong-direction .position-dot {
    background-color: #F44336;
}

.position-marker.neutral-direction .position-dot {
    background-color: #FF9800;
}

/* Direction arrow styling - improved transformation */
.direction-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -10px;
    margin-top: -26px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 24px solid #2196F3;
    transform-origin: center 24px !important; /* Critical for proper rotation */
    z-index: 1;
    transition: transform 0.1s ease; /* Smooth rotation but not too slow */
}

/* Improved orientation for the arrow to always point "forward" */
.position-marker {
    /* No rotation transformation should be applied here */
    width: 24px !important;
    height: 24px !important;
    background-color: transparent;
    border-radius: 50%;
    position: relative;
}

/* Add compass calibration button */
.compass-calibrate-btn {
    position: fixed;
    left: 10px;
    bottom: 170px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.compass-calibrate-btn:before {
    content: '🧭';
    margin-right: 5px;
}

/* Completely redesigned bottom control bar buttons */
.buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
    position: relative;
    z-index: 1001;
}

/* New button styles with modern design */
#storePointsButton, 
#polygonStatsButton, 
#sharePointsButton, 
#stakeoutButton, 
#objectivesButton {
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 42px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Button icons */
.button-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.button-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 3px;
}

.button-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Button color scheme */
#storePointsButton {
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
}

#polygonStatsButton {
    background: linear-gradient(to bottom, #2196F3, #1976D2);
}

#sharePointsButton {
    background: linear-gradient(to bottom, #9C27B0, #7B1FA2);
}

#objectivesButton {
    background: linear-gradient(to bottom, #FF9800, #F57C00);
}

#stakeoutButton {
    background: linear-gradient(to bottom, #F44336, #D32F2F);
}

/* Hover and active states with subtle effects */
#storePointsButton:hover, #storePointsButton:focus,
#polygonStatsButton:hover, #polygonStatsButton:focus,
#sharePointsButton:hover, #sharePointsButton:focus,
#objectivesButton:hover, #objectivesButton:focus,
#stakeoutButton:hover, #stakeoutButton:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#storePointsButton:active,
#polygonStatsButton:active,
#sharePointsButton:active,
#objectivesButton:active,
#stakeoutButton:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Ripple effect for buttons */
.button-ripple {
    position: absolute;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Media queries for responsive design */
@media (max-width: 400px) {
    #storePointsButton, 
    #polygonStatsButton, 
    #sharePointsButton, 
    #stakeoutButton, 
    #objectivesButton {
        padding: 6px 3px;
        min-height: 38px;
    }
    
    .button-icon {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .button-text {
        font-size: 9px;
    }
}

@media (max-width: 330px) {
    .buttons-container {
        flex-wrap: wrap;
    }
    
    #storePointsButton, 
    #polygonStatsButton, 
    #sharePointsButton {
        flex-basis: 30%;
    }
    
    #stakeoutButton, 
    #objectivesButton {
        flex-basis: 48%;
        margin-top: 4px;
    }
}

/* Ensure control bar has good padding */
.control-bar {
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Direction arrow styling - fixed rotation */
.direction-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -10px;
    margin-top: -26px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 24px solid #2196F3;
    transform-origin: center 24px !important; /* Critical for proper rotation */
    z-index: 1;
    transition: transform 0.2s ease; /* Smoother transition */
}

/* Compass calibration button - more visible and accessible */
.compass-calibrate-btn {
    position: fixed;
    bottom: 170px;
    left: 10px;
    background-color: rgba(33, 150, 243, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    z-index: 1000;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.compass-calibrate-btn:before {
    content: '🧭';
    margin-right: 8px;
    font-size: 16px;
}

.compass-calibrate-btn:hover {
    background-color: rgba(33, 150, 243, 1);
}

.compass-calibrate-btn:active {
    transform: translateY(1px);
}

/* Debug compass heading display */
.compass-heading-debug {
    position: fixed;
    top: 50px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
}

/* Enhanced compass debug indicator for testing orientation */
.compass-heading-debug {
    position: fixed;
    top: 100px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
}

/* Add north indicator for debugging */
.north-indicator {
    position: fixed;
    top: 140px;
    left: 10px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
}

/* Enhanced direction arrow styling with guaranteed rotation */
.direction-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -10px;
    margin-top: -26px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 24px solid #2196F3;
    z-index: 10;
    transform-origin: center bottom !important;
    /* Add hardware acceleration and smoother transitions */
    transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform: rotate(0deg);
    will-change: transform;
}

/* Improved compass calibration button - fixed positioning */
.compass-calibrate-btn {
    position: fixed;
    bottom: 100px;
    right: 10px;
    background-color: rgba(33, 150, 243, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.compass-status-indicator {
    font-size: 10px;
    margin-top: 3px;
    padding: 2px 5px;
    border-radius: 3px;
    background-color: #666;
}

.compass-status-indicator.active {
    background-color: #4CAF50;
}

/* Debug compass visualization */
#debugCompassIndicator {
    position: fixed;
    top: 70px;
    left: 10px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    padding: 5px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.compass-circle {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    border: 2px solid #333;
    box-sizing: border-box;
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 50%;
    background: linear-gradient(to bottom, #f00 50%, #00f 50%);
    transform-origin: center bottom;
    transform: translateX(-50%);
}

.compass-reading {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    font-family: monospace;
}

/* AR View Styles */
.ar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000;
    display: none;
}

.ar-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 2001;
}

.ar-header h3 {
    margin: 0;
    font-size: 18px;
}

.ar-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 15px;
    z-index: 2002;
    position: relative;
}

.ar-close-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.ar-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#arVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

.ar-status-text {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    font-size: 14px;
    z-index: 2002;
}

/* AR button highlight state */
#arViewButton.active {
    background-color: #FF9800;
    color: white;
}

/* Give AR button a slight glow when active */
#arViewButton.active .button-icon {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* AR View Styles */
.ar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000;
    display: none;
}

.ar-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 2001;
}

.ar-header h3 {
    margin: 0;
    font-size: 18px;
}

.ar-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 15px;
    z-index: 2002;
    position: relative;
}

.ar-close-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.ar-view {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#arVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

.ar-status-text {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    font-size: 14px;
    z-index: 2002;
}

.ar-location-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    padding: 2px;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap;
    will-change: transform, opacity;
    max-width: 100px;
}

.ar-location-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #FF9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.7);
    margin-bottom: 2px;
}

.ar-location-label {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.ar-location-distance {
    margin-top: 1px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ddd;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 9px;
}

/* Different marker types to create visual distinction */
.ar-mountain .ar-location-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.7);
}

.ar-city .ar-location-dot {
    background-color: #2196F3;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.7);
}

.ar-mountain .ar-location-label {
    border-left: 2px solid #4CAF50;
}

.ar-city .ar-location-label {
    border-left: 2px solid #2196F3;
}

/* Add hover effect to make markers more interactive */
.ar-location-marker:hover {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 10;
}

.ar-location-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

.ar-location-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #FF9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.7);
}

.ar-location-label {
    margin-top: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ar-mountain .ar-location-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.ar-city .ar-location-dot {
    background-color: #2196F3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.7);
}

.ar-location-distance {
    margin-top: 2px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ddd;
    padding: 2px 5px;
    border-radius: 8px;
    font-size: 10px;
}

.ar-location-elevation {
    background-color: rgba(0, 0, 0, 0.7); /* Match .ar-location-label */
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 6px;
    margin: 2px 0 0 0;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Match .ar-location-label shadow for readability */
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.ar-location-elevation {
    background-color: rgba(0,0,0,0.6);
    color: #fffde7;
    font-size: 11px;
    font-weight: 500;
    border-radius: 8px;
    padding: 1px 6px 1px 6px;
    margin: 2px 0 0 0;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ar-permission-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 2500;
}

.ar-permission-dialog h4 {
    margin-top: 0;
}

.ar-permission-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.ar-permission-buttons button {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ar-permission-buttons .primary {
    background-color: #2196F3;
    color: white;
}

.ar-permission-buttons .primary:hover {
    background-color: #1976D2;
    transform: scale(1.05);
}

.ar-permission-buttons .secondary {
    background-color: #f1f1f1;
    color: #333;
}

.ar-permission-buttons .secondary:hover {
    background-color: #e0e0e0;
}

/* Enlarge compass permission buttons */
#compassFullscreenPermission .permission-btn {
    font-size: 2em !important;
    padding: 2em 3em !important;
    min-width: 50% !important; /* opțional, forțează lățimea minimă */
}
