/* Bootstrap 5 Layout Structure - Simple approach */
body {
    margin: 0;
    padding: 0;
}

/* Calculate exact navbar height - Bootstrap navbar with modern design */
:root {
    --navbar-height: 48px; /* Thinner navbar height */
}

/* Simple margin-based layout to avoid gaps */
.main-content {
    margin-top: var(--navbar-height); /* Exactly the height of the fixed navbar */
    margin-bottom: 0; /* Will be adjusted by JavaScript for bottom navbar */
}

/* Map container with proper height calculation */
#mapcontainer {
    height: calc(100vh - var(--navbar-height)); /* Full viewport minus navbar height */
    width: 100%;
    position: relative;
    border: 1px solid #dee2e6; /* Bootstrap border color */
    margin: 0;
}

#map { 
    height: 100%;
    width: 100%;
    border: none; /* Remove double border */
    position: relative; /* Ensure map controls can position properly */
}

/* Feature Loading Status Bar (non-blocking) */
.loading-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(248, 249, 250, 0.95);
    border-top: 1px solid #dee2e6;
    z-index: 1000;
    padding: 10px 20px;
    backdrop-filter: blur(5px);
}

.loading-status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loading-spinner {
    display: flex;
    align-items: center;
}

.loading-text {
    display: flex;
    align-items: center;
    font-size: 14px;
}

#loadingMessage {
    color: #495057;
    font-weight: 500;
}

#featureCountDisplay {
    font-size: 13px;
    color: #6c757d;
}

/* Bootstrap 5 Submenu Support */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 0;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-submenu:hover .dropdown-menu,
.dropdown-submenu .dropdown-menu.show {
    display: block;
}

.dropdown-submenu .dropdown-toggle::after {
    display: none;
}

.dropdown-submenu .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Prevent submenu from closing when clicking inside */
.dropdown-submenu .dropdown-menu {
    display: none;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu .dropdown-menu.show {
    display: block !important;
}

/* Mobile responsive submenu */
@media (max-width: 991.98px) {
    .dropdown-submenu .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: rgba(0,0,0,.05);
        border: 0;
        box-shadow: none;
        border-radius: 0;
        display: none;
    }
    
    .dropdown-submenu:hover > .dropdown-menu,
    .dropdown-submenu .dropdown-menu.show {
        display: block !important;
    }
    
    .dropdown-submenu .dropdown-item {
        padding-left: 2rem;
    }
}

.latlong {
    margin-left: 20px;
    margin-right: 50px;
}
.selectedutil {
    margin-right:10px;
}

.alert-down {
    margin-top: 10px;
    width: 500px;
    padding-left: 20px;
    padding-right: 20px;
}

.alert {
    margin-top: 50px;
    position: fixed;
    z-index: 1000;
    top: 50px;
    left: 50%;
    transform: translate(-50%, -50%);
}

.side-bar {
 border-style: none;
 width: 300px;
 height:500px;
 position: relative;
 left: 1025px;
 bottom: 755px;
 z-index: 1;
 display: none;
}

.side-bar-bottom {
 border-style: none;
 width: 300px;
 height:250px;
 position: relative;
 left: 1025px;
 bottom: 735px;
 z-index: 1;
 display: none;
}

/* Bottom bar removed - footer navbar handles this functionality */
.bottom-legend {
 position: relative;
 left: 20px;
 bottom: -140px;
}

.print-window {
 width: 100vw;
 height: 100vh;
 border-style: solid;
 border-width: 1px;
}

@media print {
    @page {
        size: A5 tabloid;
    }
    .side-bar {
        display: inherit; }
    /* Bottom bar removed - footer navbar handles this functionality */
    .side-bar-bottom {
        display: inherit; }
}

.small-font {
    font-size: .5rem;
}

.smallish-font {
    font-size: .6rem;
}

.sortasmall-font {
    font-size: .7rem;
}

.notsmall-font {
    font-size: .8rem;
}

.legend-font {
    font-size: 1.2rem;
}
/* Bootstrap containers - no need for extra margin with body padding */
.container {
    margin-top: 0;
}

/* When bottom navbar is present */
.main-content.has-bottom-navbar {
    margin-bottom: var(--bottom-navbar-height);
}

.main-content.has-bottom-navbar #mapcontainer {
    height: calc(100vh - var(--navbar-height) - var(--bottom-navbar-height)); /* Subtract both top and bottom navbar heights */
}

/* Modern footer styling */
.navbar.fixed-bottom {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar.fixed-bottom .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.navbar.fixed-bottom #curSelectedUtil {
    min-width: 120px;
    text-align: center;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
    .navbar.fixed-bottom .container-fluid {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .navbar.fixed-bottom .d-flex {
        justify-content: center;
        text-align: center;
    }
}

.display-project {
    margin-left: 20px;
    }

.custom-row {
    margin-bottom: 0px;
    height: 0px;
}

.custom-col {
    padding: 0px;
    margin: 0px;
}

.success-toast {
    position: fixed;
    z-index: 1400;
    top: 70px; /* Adjusted for new navbar height */
    right: 10px;
}

.error-toast {
    position: fixed;
    z-index: 1400;
    top: 70px; /* Adjusted for new navbar height */
    right: 10px;
}

.button-container {
display: flex;
}

.row-button {
margin-right: 10px;
}

.mobile-select-feat {
    position: fixed;
    top: 8%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* Modern navbar dropdown styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.5rem 1rem 0.25rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 1rem;
    text-align: center;
}

/* Dropend submenu styling */
.nav-item.dropend .dropdown-menu {
    margin-left: 0.125rem;
}

/* Mobile navbar improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    .dropdown-menu {
        border: 1px solid #dee2e6;
        box-shadow: none;
        margin-top: 0.5rem;
    }
}

.dropdown-narrow {
    width: 50px;
}

.cust-p-21 {
    margin: 12px;
    padding: 0px;
    font-size: 16px;
}

.cust-p-25 {
    margin-top: 14px;
    margin-bottom: 0px;
    padding: 0px;
    font-size: 16px;
}

.cust-p-31 {
    margin-top: 9px;
    margin-bottom: 0px;
    padding: 0px;
    font-size: 16px;
}

.cust-p-37 {
    margin-top: 5px;
    margin-bottom: 0px;
    padding: 0px;
    font-size: 16px;
}

#project_notes {
    height: auto; /* Let the browser automatically determine the height based on rows */
    min-height: 120px; /* Minimum height to display 6 rows */
    resize: none; /* Disable resizing */
}

#progress-container {
  width: 50%;
  background-color: #FFFFFF;
}
#progress-bar {
  width: 2%;
  height: 20px;
  background-color: #EF2D56;
}

.project-container {
margin-top: 120px;
}

.basic-link {
    color: gray; /* Disabled-like color */
    text-decoration: none; /* No underline */
    pointer-events: auto; /* Keeps the link clickable */
    cursor: default; /* Default cursor (not pointer) */
    background-color: transparent; /* No background change */
}

.basic-link:hover {
    color: gray; /* Keep the same text color on hover */
    text-decoration: none; /* No underline on hover */
    cursor: default; /* No pointer cursor on hover */
    background-color: transparent !important; /* Prevent background change */
}

/* MapLibre Popup Styles */
.maplibregl-popup {
    z-index: 1000;
}

.maplibregl-popup-content {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
}

.maplibregl-popup-close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 16px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1;
}

.maplibregl-popup-close-button:hover {
    color: #000;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.popup-title {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.data-source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.data-source-badge.rtk-pro {
    background-color: #4CAF50;
    color: white;
}

.data-source-badge.gnss-nmea {
    background-color: #2196F3;
    color: white;
}

.data-source-badge.locator {
    background-color: #FF9800;
    color: white;
}

.data-source-badge.manual-input {
    background-color: #9E9E9E;
    color: white;
}

.popup-section {
    margin-bottom: 15px;
}

.popup-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.popup-section p {
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

.popup-section p strong {
    color: #666;
    font-weight: 500;
}

.popup-actions {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: right;
}

.action-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-button {
    background-color: #f44336;
    color: white;
}

.delete-button:hover {
    background-color: #d32f2f;
}

/* Compact popup styles */
.compact-popup .maplibregl-popup-content {
    width: 300px;
    max-height: 400px;
    padding: 12px;
}

.compact-popup .popup-section {
    margin-bottom: 12px;
}

.compact-popup .popup-section p {
    margin: 3px 0;
    font-size: 12px;
}

.compact-popup .popup-title h3 {
    font-size: 14px;
}

.compact-popup .data-source-badge {
    font-size: 11px;
    padding: 1px 6px;
}

.compact-popup .popup-section h4 {
    font-size: 13px;
    margin-bottom: 6px;
}

.compact-popup .action-button {
    padding: 4px 10px;
    font-size: 12px;
}

/* New Point Details Popup Styles */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.popup-actions-header {
    display: flex;
    gap: 5px;
}

.popup-actions-header .action-button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-actions-header .delete-button {
    background-color: #f44336;
    color: white;
}

.popup-actions-header .delete-button:hover {
    background-color: #d32f2f;
}

.popup-actions-header .close-button {
    background-color: #9e9e9e;
    color: white;
}

.popup-actions-header .close-button:hover {
    background-color: #757575;
}

.popup-field {
    margin-bottom: 12px;
}

.popup-label {
    display: block;
    font-weight: 500;
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
}

.popup-value {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.popup-textarea {
    width: 100%;
    min-height: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.popup-textarea:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Bottom delete button section */
.popup-actions-bottom {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.popup-actions-bottom .delete-button {
    background-color: #f44336;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popup-actions-bottom .delete-button:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
}

/* MapLibre control styles */
.maplibregl-ctrl-group {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0,0,0,.1);
}

.basemap-selector {
    background: white;
    border: none;
    padding: 5px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.basemap-selector:hover {
    background: #f4f4f4;
}

/* MapLibre Geoman styles */
.maplibre-pm-icon-transparency {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCA5TDEzLjA5IDE1Ljc0TDEyIDIyTDEwLjkxIDE1Ljc0TDQgOUwxMC45MSA4LjI2TDEyIDJaIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=');
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    display: block;
    cursor: pointer;
}

/* Map Settings Sidebar Styling */
#mapSettingsSidebar {
    width: 400px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

#mapSettingsSidebar .offcanvas-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#mapSettingsSidebar .offcanvas-title {
    font-weight: 600;
}

#mapSettingsSidebar .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#mapSettingsSidebar .btn-close:hover {
    opacity: 1;
}

#mapSettingsSidebar .offcanvas-body {
    padding: 1.5rem;
    background-color: #f8f9fa;
}

/* Settings Section Styling */
.settings-section {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.settings-section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Form Controls Enhancement */
#mapSettingsSidebar .form-range {
    margin: 0.5rem 0;
}

#mapSettingsSidebar .form-range::-webkit-slider-thumb {
    background-color: #007bff;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#mapSettingsSidebar .form-range::-moz-range-thumb {
    background-color: #007bff;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#mapSettingsSidebar .form-control-color {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    cursor: pointer;
}

#mapSettingsSidebar .form-control-color:hover {
    border-color: #007bff;
}

/* Button Styling */
#mapSettingsSidebar .btn-outline-primary {
    border-width: 1.5px;
    font-weight: 500;
}

#mapSettingsSidebar .btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    font-weight: 600;
    padding: 0.75rem;
}

#mapSettingsSidebar .btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Divider Styling */
#mapSettingsSidebar hr {
    margin: 1.5rem 0;
    border-color: #dee2e6;
    opacity: 0.5;
}

/* Value Display Enhancement */
#mapSettingsSidebar .fw-bold.text-primary {
    background: rgba(0, 123, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    #mapSettingsSidebar {
        width: 90vw;
    }
    
    .settings-section {
        padding: 1rem;
    }
    
    #mapSettingsSidebar .offcanvas-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    #mapSettingsSidebar {
        width: 100vw;
    }
}

/* Animation Enhancement */
#mapSettingsSidebar .btn {
    transition: all 0.2s ease;
}

#mapSettingsSidebar .form-range {
    transition: all 0.2s ease;
}

#mapSettingsSidebar .form-control-color {
    transition: all 0.2s ease;
}

.maplibre-pm-icon-reload {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEgNFY5SDE2IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yMyAyMFYxNUg4IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yMC40OSA5QTE5IDkgMCAwIDAgNS42NCA1LjY0TDEgOSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMy41MSAxNUExOSA5IDAgMCAwIDE4LjM2IDE4LjM2TDIzIDE1IiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=');
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    display: block;
    cursor: pointer;
}

/* MapLibre marker styles */
.maplibre-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #333;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.maplibre-marker-icon svg {
    width: 18px;
    height: 18px;
}

.maplibre-marker-icon.gpr-anomaly {
    border-color: #FF67FF;
}

.maplibre-marker-icon.soil-bore {
    border-color: #8B4513;
}

.maplibre-marker-icon.unknown-manhole {
    border-color: #FF17D9;
}

.maplibre-marker-icon.end-of-info {
    border-color: #8B4513;
}

.maplibre-marker-icon.light-pole {
    border-color: #E94444;
}

.maplibre-marker-icon.com-cabinet {
    border-color: #FA9042;
}

.maplibre-marker-icon.photo {
    border-color: #9400D3;
}

/* Enhanced MapBox GL Draw CSS for better visibility */
.mapbox-gl-draw_ctrl-draw-btn {
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    background-color: #fff !important;
    border: 2px solid rgba(0,0,0,.1) !important;
    border-radius: 4px !important;
    margin: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Inactive/disabled state for drawing buttons when no utility is selected */
.mapbox-gl-draw_ctrl-draw-btn:not(.mapbox-gl-draw_ctrl-draw-btn_active):not(.enabled) {
    background-color: #f5f5f5 !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Enabled state when utility is selected */
.mapbox-gl-draw_ctrl-draw-btn.enabled {
    background-color: #fff !important;
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.mapbox-gl-draw_ctrl-draw-btn:hover {
    background-color: #f8f8f8 !important;
    border-color: rgba(0,0,0,.2) !important;
}

.mapbox-gl-draw_ctrl-draw-btn.mapbox-gl-draw_ctrl-draw-btn_active,
.mapbox-gl-draw_ctrl-draw-btn.active {
    background-color: #3bb2d0 !important;
    color: #fff !important;
}

/* Ensure the control group has proper spacing and positioning */
.maplibregl-ctrl-top-left .mapbox-gl-draw_ctrl-draw-btn {
    margin-bottom: 2px !important;
}

.maplibregl-ctrl-top-left .maplibregl-ctrl-group:not(:empty) {
    margin-bottom: 10px !important;
}

/* MapLibre controls positioning - positioned properly within map area */
.maplibregl-ctrl-top-left {
    position: absolute !important;
    top: 80px !important; /* Moved down more for better positioning */
    left: 10px !important;
    z-index: 1000 !important;
    margin: 0 !important;
}

/* Rotation Control Styles */
.rotation-control {
    min-width: 120px !important;
    max-width: 150px !important;
    margin-bottom: 10px !important;
}

/* Rotation Control Button Styles */
.rotation-control button {
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.rotation-control button:active {
    transform: scale(0.95);
}

.rotation-control button:focus {
    outline: 2px solid #3bb2d0;
    outline-offset: 1px;
}

/* Prevent text selection on rotation buttons */
.rotation-control button,
.rotation-control div {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide the old slider styles since we're not using them anymore */
.rotation-control input[type="range"] {
    display: none !important;
}

.rotation-control input[type="range"]::-webkit-slider-track,
.rotation-control input[type="range"]::-webkit-slider-thumb,
.rotation-control input[type="range"]::-moz-range-track,
.rotation-control input[type="range"]::-moz-range-thumb {
    display: none !important;
}

/* Bottom-left controls spacing */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl {
    margin-bottom: 10px;
}

.maplibregl-ctrl-bottom-left .maplibregl-ctrl:last-child {
    margin-bottom: 0;
}

/* Ensure Terra Draw controls are visible and positioned correctly */
.maplibregl-ctrl-group {
    position: relative !important;
    display: block !important;
    visibility: visible !important;
}

/* Terra Draw specific control styling */
[class*="terradraw"] {
    position: relative !important;
    display: block !important;
    visibility: visible !important;
    z-index: 1000 !important;
}

/* Terra Draw button styling improvements */
.maplibregl-ctrl-group button {
    position: relative !important;
    transition: all 0.2s ease !important;
}

/* Disabled Terra Draw buttons */
.maplibregl-ctrl-group button[disabled],
.maplibregl-ctrl-group button:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
}

/* Enabled Terra Draw buttons */
.maplibregl-ctrl-group button:not([disabled]):not(:disabled) {
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background-color: #fff !important;
}

/* Active/hover states for enabled buttons */
.maplibregl-ctrl-group button:not([disabled]):not(:disabled):hover {
    background-color: #f0f0f0 !important;
}

.maplibregl-ctrl-group button:not([disabled]):not(:disabled):active,
.maplibregl-ctrl-group button:not([disabled]):not(:disabled).active {
    background-color: #3bb2d0 !important;
    color: #fff !important;
}

/* Remove any conflicting disabled styling */
.maplibregl-ctrl-group button[style*="not-allowed"] {
    cursor: not-allowed !important;
}

/* Ensure map canvas can receive drawing events */
.maplibregl-canvas-container,
.maplibregl-canvas {
    pointer-events: auto !important;
}

/* When drawing mode is active, show crosshair cursor */
.maplibregl-canvas-container.mapbox-gl-draw_canvas {
    cursor: crosshair !important;
}

/* Terra Draw drawing mode cursor override */
.maplibregl-canvas-container.terradraw-drawing-mode {
    cursor: crosshair !important;
}

/* Override pointer cursor on features when in drawing mode */
.maplibregl-canvas-container.terradraw-drawing-mode * {
    cursor: crosshair !important;
}

/* MapBox GL Draw visual feedback styles - broad targeting */
.maplibregl-canvas-container[class*="draw_line_string"],
.maplibregl-canvas-container[class*="draw_polygon"], 
.maplibregl-canvas-container[class*="draw_point"],
.maplibregl-canvas-container.mapbox-gl-draw_mode_draw_line_string,
.maplibregl-canvas-container.mapbox-gl-draw_mode_draw_polygon,
.maplibregl-canvas-container.mapbox-gl-draw_mode_draw_point {
    cursor: crosshair !important;
}

/* Remove forced crosshair - let drawing mode control it */
/* .maplibregl-canvas {
    cursor: crosshair !important;
} */

/* Force MapBox GL Draw elements to be visible - comprehensive approach */
.mapbox-gl-draw_polygon-fill-inactive,
.mapbox-gl-draw_polygon-fill-active,
.mapbox-gl-draw_polygon-stroke-inactive,
.mapbox-gl-draw_polygon-stroke-active,
.mapbox-gl-draw_line-inactive,
.mapbox-gl-draw_line-active,
.mapbox-gl-draw_point-inactive,
.mapbox-gl-draw_point-active {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Force all draw-related SVG elements to be visible */
svg[class*="gl-draw"],
g[class*="gl-draw"],
path[class*="gl-draw"],
circle[class*="gl-draw"],
line[class*="gl-draw"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* MapLibre specific draw layer targeting */
.maplibregl-canvas-container svg,
.maplibregl-canvas-container g,
.maplibregl-canvas-container path,
.maplibregl-canvas-container circle,
.maplibregl-canvas-container line {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure map draw overlay is on top */
.maplibregl-canvas-container {
    position: relative !important;
    z-index: 1 !important;
}

/* Drawing preview/guide styles */
.mapbox-gl-draw_polygon-midpoint,
.mapbox-gl-draw_vertex,
.mapbox-gl-draw_vertex-active,
.mapbox-gl-draw_vertex-inactive {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Make sure the drawing canvas and layers are interactive */
.maplibregl-canvas {
    pointer-events: auto !important;
}

/* Drawing feedback - active line being drawn */
.mapbox-gl-draw_line-active {
    stroke: #3bb2d0 !important;
    stroke-width: 3 !important;
    stroke-dasharray: 4,4 !important;
}

/* Completed line segments */
.mapbox-gl-draw_line-inactive {
    stroke: #3388ff !important;
    stroke-width: 2 !important;
    stroke-dasharray: none !important;
}

/* Drawing vertices/points */
.mapbox-gl-draw_vertex {
    fill: #fff !important;
    stroke: #3bb2d0 !important;
    stroke-width: 2 !important;
    r: 4 !important;
}

.mapbox-gl-draw_vertex-active {
    fill: #3bb2d0 !important;
    stroke: #fff !important;
    stroke-width: 2 !important;
    r: 5 !important;
}

/* Make sure other top-left controls don't get affected if there are any */
.maplibregl-ctrl-top-left .maplibregl-ctrl-group:not([class*="mapbox-gl-draw"]) {
    margin-top: -60px !important;  /* Reset for non-draw controls */
}

/* Ensure draw control groups are interactive */
.maplibregl-ctrl-group.mapbox-gl-draw_ctrl-draw-btn,
.mapbox-gl-draw_ctrl-draw-btn,
.maplibregl-ctrl-group:has(.mapbox-gl-draw_ctrl-draw-btn),
.maplibregl-ctrl-top-left .maplibregl-ctrl-group {
    pointer-events: auto !important;
    z-index: 1000 !important;
}

/* Make sure draw controls are visible and properly styled */
.mapbox-gl-draw_button, 
.mapbox-gl-draw_ctrl-draw-btn {
    background-size: 20px 20px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

/* Individual button styling */
.mapbox-gl-draw_point {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle fill='%23404040' cx='10' cy='10' r='3'/%3e%3c/svg%3e") !important;
}

.mapbox-gl-draw_line {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='%23404040' stroke-width='2' fill='none' d='M2,5 L18,15'/%3e%3c/svg%3e") !important;
}

.mapbox-gl-draw_polygon {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='%23404040' stroke-width='2' fill='none' d='M3,3 L17,3 L17,17 L3,17 Z'/%3e%3c/svg%3e") !important;
}

.mapbox-gl-draw_trash {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='%23404040' d='M6,3 L6,2 C6,1.4 6.4,1 7,1 L13,1 C13.6,1 14,1.4 14,2 L14,3 L18,3 L18,5 L2,5 L2,3 L6,3 Z M4,6 L16,6 L15,18 L5,18 L4,6 Z'/%3e%3c/svg%3e") !important;
}

/* Terra Draw feature styling */
.maplibregl-canvas-container svg path[class*="terra-draw"],
.maplibregl-canvas-container svg circle[class*="terra-draw"],
.maplibregl-canvas-container svg line[class*="terra-draw"] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure Terra Draw features are visible during drawing */
.maplibregl-canvas-container svg {
    pointer-events: none !important; /* Allow map interactions while drawing */
}

/* Terra Draw active drawing styles */
.terra-draw-active-line {
    stroke-dasharray: 4,4 !important;
    stroke-width: 3 !important;
    opacity: 0.8 !important;
}

.terra-draw-active-point {
    r: 6 !important;
    opacity: 0.8 !important;
}

.terra-draw-active-polygon {
    stroke-width: 3 !important;
    stroke-dasharray: 4,4 !important;
    fill-opacity: 0.1 !important;
}

/* Snapping Visual Feedback Styles */
.snap-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #00D4AA;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.3);
    pointer-events: none;
    z-index: 1000;
    display: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.6);
    animation: snap-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes snap-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Snapping sensitivity setting styles */
.settings-section .form-range:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 212, 170, 0.25);
}

.settings-section .form-range::-webkit-slider-thumb:hover {
    background-color: #00D4AA;
}

.settings-section .form-range::-moz-range-thumb:hover {
    background-color: #00D4AA;
}

/* Feature Highlighting Styles */
/* These styles are applied programmatically by the feature highlighter */
.feature-highlight-line {
    stroke: #00D4AA !important;
    stroke-width: 5 !important;
    stroke-opacity: 0.8 !important;
}

.feature-highlight-point {
    fill: #00D4AA !important;
    fill-opacity: 0.8 !important;
    stroke: #ffffff !important;
    stroke-width: 2 !important;
}

.feature-highlight-icon-point {
    fill: #00D4AA !important;
    fill-opacity: 0.6 !important;
    stroke: #ffffff !important;
    stroke-width: 3 !important;
}

.feature-highlight-polygon {
    stroke: #00D4AA !important;
    stroke-width: 5 !important;
    stroke-opacity: 0.8 !important;
}

/* Highlight pulse animation for better visibility */
@keyframes highlight-pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* Print Preview Button Styles */
.print-preview-button-container {
    position: absolute !important;
    top: 220px !important; /* Position just below Terra Draw controls */
    left: 20px !important;
    z-index: 1000 !important;
}

#printPreviewBtn {
    background: #fff !important;
    color: #333 !important;
    border: 2px solid rgba(0,0,0,.1) !important;
    border-radius: 4px !important;
    padding: 0 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin-bottom: 2px !important;
}

#printPreviewBtn:hover {
    background: #f8f8f8 !important;
    border-color: rgba(0,0,0,.2) !important;
}

#printPreviewBtn:active {
    background: #3bb2d0 !important;
    color: #fff !important;
}

/* Jobsite Photo Popup Styles */
.jobsite-photo-popup {
    min-width: 350px;
    max-width: 450px;
}

.jobsite-photo-popup .popup-header h3 {
    color: #9400D3;
    font-size: 18px;
    font-weight: 600;
}

.photo-preview {
    margin: 15px 0;
}

.photo-container {
    text-align: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    border: 2px solid #e9ecef;
}

.jobsite-photo-preview {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.jobsite-photo-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.photo-actions {
    margin-top: 10px;
}

.view-full-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.view-full-button:hover {
    background-color: #5a6268;
}

.delete-photo-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.delete-photo-button:hover {
    background-color: #c82333;
}

.photo-error {
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.photo-placeholder {
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

/* Bottom-left controls spacing */

