/* Custom styles for the Polygon Map Extractor */

/* Sticky Navigation Bar */
nav.navbar.navbar-expand-lg.navbar-light {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1050 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    background-color: #6366f1 !important;
}

/* Additional fallback for any navbar */
.navbar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1050 !important;
}

/* Ensure body doesn't have overflow issues that could affect sticky */
body {
    overflow-x: hidden;
}

/* Simple address marker styles */
.address-marker {
    text-align: center;
    cursor: pointer;
}

.address-marker:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Focused address marker with pulsing animation */
.focused-address-marker {
    z-index: 1000;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Address popup styles */
.address-popup {
    min-width: 200px;
}

.address-popup h6 {
    color: var(--bs-primary);
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Map container with scroll controls */
.map-wrapper {
    position: relative;
    overflow: hidden;
}

.map-container-padded {
    padding: 0 40px; /* Add 40px padding on left and right */
}

#map {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    height: 80vh;
    min-height: 600px;
    max-height: 800px;
    width: 100%;
}

/* Scroll indicators */
.scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 1000;
    border-radius: 0.375rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: pointer;
    pointer-events: none; /* Allow scroll events to pass through */
}

.scroll-indicator:hover {
    opacity: 0.9;
}

.scroll-left {
    left: 5px;
}

.scroll-right {
    right: 5px;
}

.scroll-left i {
    transform: rotate(-90deg);
}

.scroll-right i {
    transform: rotate(90deg);
}

/* Map zoom controls */
.map-zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.map-zoom-controls .btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-zoom-controls .btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Scroll hint overlay */
.scroll-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    z-index: 9999;
    opacity: 1;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: block;
    white-space: nowrap;
    pointer-events: none;
}

.scroll-hint kbd {
    font-size: 11px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-weight: bold;
    margin: 0 2px;
}

/* Hide scroll hint after 10 seconds */
.scroll-hint.fade-out {
    opacity: 0;
    transition: opacity 2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-container-padded {
        padding: 0 20px; /* Reduce padding on mobile */
    }
    
    .scroll-indicator {
        width: 25px;
        height: 50px;
        font-size: 12px;
    }
    
    .scroll-hint {
        font-size: 11px;
        padding: 6px 10px;
    }
}

#addressMap {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Editable table cells */
.editable {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out;
}

.editable:hover {
    background-color: var(--bs-light);
}

/* Optimized card hover effects */
.card {
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    will-change: transform;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Statistics cards */
.card.bg-primary h3,
.card.bg-success h3,
.card.bg-info h3,
.card.bg-warning h3 {
    font-weight: 700;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

/* Table responsive improvements */
.table-responsive {
    border-radius: 0.375rem;
}

/* Modal improvements */
.modal-content {
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Button loading state */
.btn:disabled {
    opacity: 0.65;
}

/* Success animation */
.text-success {
    animation: successPulse 0.5s ease-in-out;
}

@keyframes successPulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; background-color: var(--bs-success); }
    100% { opacity: 1; }
}

/* Navbar brand */
.navbar-brand {
    font-weight: 600;
}

/* Force navbar background color */
.navbar {
    background-color: #6366f1 !important;
}

/* Small impersonation dropdown button */
.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

/* Admin bar styling */
.admin-bar {
    border-bottom: 1px solid #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-bar .btn-xs {
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.1;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    #map {
        height: 60vh !important;
        min-height: 500px !important;
    }
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .editable:hover {
    background-color: var(--bs-dark);
}

[data-bs-theme="dark"] .address-popup h6 {
    color: var(--bs-info);
}

/* Loading states */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: inherit;
}

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: opacity 0.3s ease-in-out;
}

.map-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Statistics loading spinners */
.stat-loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Leaflet popup custom styles */
.leaflet-popup-content-wrapper {
    border-radius: 0.375rem;
}

.leaflet-popup-content {
    margin: 0.5rem;
}

/* Custom draw control positioning */
.leaflet-draw-toolbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Marker Cluster Styles for Dark Theme */
.marker-cluster-small {
    background-color: rgba(13, 110, 253, 0.6);
    border: 2px solid rgba(13, 110, 253, 0.8);
}

.marker-cluster-small div {
    background-color: rgba(13, 110, 253, 0.8);
    color: white;
    font-weight: bold;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 15px;
    font-size: 12px;
}

.marker-cluster-medium {
    background-color: rgba(40, 167, 69, 0.6);
    border: 2px solid rgba(40, 167, 69, 0.8);
}

.marker-cluster-medium div {
    background-color: rgba(40, 167, 69, 0.8);
    color: white;
    font-weight: bold;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 17px;
    font-size: 13px;
}

.marker-cluster-large {
    background-color: rgba(255, 193, 7, 0.6);
    border: 2px solid rgba(255, 193, 7, 0.8);
}

.marker-cluster-large div {
    background-color: rgba(255, 193, 7, 0.8);
    color: #212529;
    font-weight: bold;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 20px;
    font-size: 14px;
}

/* Marker cluster hover effects */
.marker-cluster:hover {
    cursor: pointer;
    transform: scale(1.1);
    transition: transform 0.2s ease-in-out;
}

/* Custom address marker styles */
.address-marker {
    background: transparent;
    border: none;
    text-align: center;
    font-size: 18px;
    color: #0d6efd;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.address-marker:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease-in-out;
}

/* Spiderfied marker styles */
.leaflet-marker-icon.marker-cluster-spiderfy {
    z-index: 1000;
}

/* Polygon line styles */
.leaflet-interactive {
    stroke-width: 3;
    stroke-dasharray: 5, 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Enhanced zoom control */
.leaflet-control-zoom {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.leaflet-control-zoom a {
    font-size: 18px;
    font-weight: bold;
    color: #0d6efd;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom a:hover {
    background-color: #0d6efd;
    color: white;
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

/* Focused address marker styles */
.focused-address-marker {
    background: transparent;
    border: none;
    text-align: center;
    filter: drop-shadow(0 4px 8px rgba(220, 53, 69, 0.5));
}

/* Pulse animation for focused markers */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Focused address popup styles */
.focused-address-popup {
    min-width: 220px;
}

.focused-address-popup h6 {
    color: #dc3545;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Focused area polygon highlighting */
.leaflet-interactive.focused-area {
    stroke: #dc3545 !important;
    stroke-width: 4 !important;
    stroke-dasharray: 10, 5 !important;
    animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 30;
    }
}

/* Smooth Loading Overlay System */
#smooth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#smooth-loading-overlay.smooth-show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.smooth-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: smoothFadeInUp 0.4s ease-out;
}

.smooth-spinner {
    margin-bottom: 1rem;
}

.smooth-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    animation: smoothSpin 1s linear infinite;
}

.smooth-loading-text {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
    animation: smoothPulse 2s ease-in-out infinite alternate;
}

@keyframes smoothFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes smoothSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes smoothPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Prevent layout shift during loading */
body.smooth-loading {
    overflow: hidden;
}

/* Enhanced page transitions */
.page-transition {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
}

.page-transition.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth button interactions */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    pointer-events: none;
}

.btn:active:before {
    width: 300px;
    height: 300px;
}

/* Form loading states */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.3);
    backdrop-filter: blur(2px);
    z-index: 10;
}

/* Card hover improvements */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Link transitions */
a {
    transition: all 0.2s ease-out;
}

/* Territory Card Styles */
.territory-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.territory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Territory Card Color Classes */
.territory-card-green {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.05));
    border-color: rgba(40, 167, 69, 0.2);
}

.territory-card-gray {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.15), rgba(108, 117, 125, 0.05));
    border-color: rgba(108, 117, 125, 0.2);
}

.territory-card-blue {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(13, 110, 253, 0.05));
    border-color: rgba(13, 110, 253, 0.2);
}

.territory-card-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    border-color: rgba(139, 92, 246, 0.2);
}

.territory-card-orange {
    background: linear-gradient(135deg, rgba(253, 126, 20, 0.15), rgba(253, 126, 20, 0.05));
    border-color: rgba(253, 126, 20, 0.2);
}

.territory-card-teal {
    background: linear-gradient(135deg, rgba(32, 201, 151, 0.15), rgba(32, 201, 151, 0.05));
    border-color: rgba(32, 201, 151, 0.2);
}

.territory-card-pink {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.05));
    border-color: rgba(236, 72, 153, 0.2);
}

.territory-card-yellow {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.2);
}

/* Selected Territory Card */
.territory-card.selected {
    border: 3px solid #007bff !important;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.2), rgba(0, 123, 255, 0.08));
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    transform: translateY(-4px);
}

/* Territory Card Map Icon - positioned at bottom when selected */
.territory-card .selection-indicator {
    color: #007bff;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show map icon only when selected */
.territory-card.selected .selection-indicator {
    opacity: 1;
    color: #007bff;
    font-weight: bold;
}

/* Territory card text styling */
.territory-card .territory-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
}

.territory-card .address-count {
    color: #6c757d;
    font-weight: 500;
}

.territory-card.selected .territory-name {
    color: #003d82;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.territory-card.selected .address-count {
    color: #004085;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Horizontal scrolling styles for territory cards */
#territoryCardsContainer {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#territoryCardsContainer::-webkit-scrollbar {
    height: 8px;
}

#territoryCardsContainer::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

#territoryCardsContainer::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

#territoryCardsContainer::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Dark theme adjustments for territory cards */
[data-bs-theme="dark"] .territory-card {
    background: rgba(33, 37, 41, 0.8);
}

[data-bs-theme="dark"] .territory-card.selected {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.2), rgba(0, 123, 255, 0.08));
}

[data-bs-theme="dark"] .territory-card .territory-name {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .territory-card.selected .territory-name {
    color: #66b3ff;
}

/* Modal improvements */
.modal {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.fade .modal-dialog {
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

body {
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduce layout thrashing */
.container, .container-fluid {
    contain: layout;
}

/* GPU acceleration for smooth animations */
.btn, .card, .address-marker, .marker-cluster {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimized transitions */
.btn {
    transition: all 0.1s ease-out;
    will-change: transform, box-shadow;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Navigation button hover effects */
.btn-outline-info:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 0.15rem 0.3rem rgba(13, 202, 240, 0.2);
}

/* Smooth page transitions */
.fade-in {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Optimize table rendering */
.table {
    table-layout: fixed;
    white-space: nowrap;
}

/* Admin users table specific styling */
.admin-users-table {
    table-layout: fixed;
    width: 100%;
}

.admin-users-table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

.admin-users-table .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}

/* Settings page styling */
.settings-nav-item {
    transition: all 0.3s ease;
    border: none !important;
}

.settings-nav-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    transform: translateX(5px);
}

.settings-nav-item.active {
    background-color: var(--bs-primary);
    color: white !important;
    font-weight: 500;
}

.settings-nav-item.active i {
    color: white;
}

.settings-section {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Role management styling */
.role-status-toggle {
    transform: scale(1.2);
}

.role-status-toggle:checked {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

/* System info cards */
.card.bg-primary, .card.bg-success, .card.bg-info {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card.bg-primary:hover, .card.bg-success:hover, .card.bg-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Modal enhancements */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: none !important;
    opacity: 0 !important;
    background-color: transparent !important;
}

.modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
    z-index: 1055 !important;
    pointer-events: auto !important;
}

.modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background-color: var(--bs-dark);
    color: white;
    pointer-events: auto !important;
    position: relative;
    z-index: 1060 !important;
}

.modal-header {
    background-color: var(--bs-primary);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-body {
    background-color: var(--bs-dark);
    color: white;
}

.modal-footer {
    background-color: var(--bs-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure all form elements in modal are interactive */
.modal .form-control,
.modal .form-check-input,
.modal .btn {
    pointer-events: auto !important;
    z-index: 1061 !important;
    position: relative;
}

/* Form enhancements */
.form-check-input:checked {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.form-switch .form-check-input:checked {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px !important;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-arrows {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.sort-up, .sort-down {
    font-size: 8px;
    color: #ccc;
    margin: 1px 0;
}

.sort-up.active, .sort-down.active {
    color: #0d6efd;
}

.sortable .sort-arrows {
    opacity: 0.6;
}

.sortable:hover .sort-arrows {
    opacity: 1;
}

/* Reduce repaints during scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
}

/* Single Address Control Styles */
.single-address-control {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    border-radius: 6px !important;
    margin-top: 10px !important;
}

.single-address-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.single-address-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.single-address-btn.active {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    animation: pulse 2s infinite;
}

.single-address-btn.active:hover {
    background: linear-gradient(135deg, #c82333 0%, #d32f2f 100%);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.single-address-btn .btn-text {
    font-size: 12px;
}

.single-address-btn i {
    font-size: 14px;
}

/* Map Instruction Overlay */
.map-instruction {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 110, 253, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Bulk Address Control Styles */
.bulk-address-control {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    border-radius: 6px !important;
    margin-top: 10px !important;
}

.bulk-address-btn {
    background: linear-gradient(135deg, #fd7e14 0%, #f39c12 100%);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.bulk-address-btn:hover {
    background: linear-gradient(135deg, #e66b02 0%, #e67e22 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

.bulk-address-btn.active {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    animation: bulkPulse 2s infinite;
}

.bulk-address-btn.active:hover {
    background: linear-gradient(135deg, #c82333 0%, #d32f2f 100%);
}

@keyframes bulkPulse {
    0% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(253, 126, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(253, 126, 20, 0); }
}

.bulk-address-btn .btn-text {
    font-size: 12px;
}

.bulk-address-btn i {
    font-size: 14px;
}

/* Bulk Process Control Styles */
.bulk-process-control {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    border-radius: 6px !important;
    margin-top: 10px !important;
}

.bulk-process-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    min-width: 120px;
    justify-content: center;
}

.bulk-process-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.bulk-process-btn .btn-text {
    font-size: 12px;
}

.bulk-process-btn i {
    font-size: 14px;
}

/* Bulk Pin Marker Styles */
.bulk-pin-marker {
    text-align: center;
    font-size: 20px;
    transform: translateZ(0);
    will-change: transform;
    animation: bounceIn 0.3s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bulk Pin Popup Styles */
.bulk-pin-popup {
    min-width: 200px;
}

.bulk-pin-popup h6 {
    color: #fd7e14;
    border-bottom: 1px solid rgba(253, 126, 20, 0.2);
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Cursor styles for address modes */
.crosshair-cursor {
    cursor: crosshair !important;
}

.crosshair-cursor * {
    cursor: crosshair !important;
}

/* Loading Indicator for Address Processing */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    z-index: 10001;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Marker animation for newly added addresses */
.single-added-marker, .bulk-added-marker {
    animation: markerPop 0.5s ease-out;
}

@keyframes markerPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #6c757d;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Message Notifications */
.map-message {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s ease;
    min-width: 250px;
}

.map-message-success {
    background: rgba(40, 167, 69, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-message-error {
    background: rgba(220, 53, 69, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Single Added Marker Styling */
.single-added-marker {
    filter: drop-shadow(0 2px 4px rgba(40, 167, 69, 0.5));
}

.single-added-marker i {
    font-size: 18px !important;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Crosshair cursor for add mode */
.leaflet-container.crosshair-cursor,
.leaflet-container.crosshair-cursor * {
    cursor: crosshair !important;
}

.leaflet-container.crosshair-cursor .leaflet-interactive {
    cursor: crosshair !important;
}

/* Custom text colors */
.text-purple {
    color: #6f42c1 !important;
}

/* Force navbar and dropdown to high z-index but below toasts */
.navbar {
    z-index: 2147483640 !important;
    position: relative !important;
}

.navbar-nav {
    z-index: 2147483640 !important;
}

/* Map area filter dropdown fix - ensure it appears above map */
.dropdown-menu {
    z-index: 2147483647 !important;
    position: absolute !important;
}

/* Specific targeting for the map user filter dropdown */
#mapUserFilterDropdown + .dropdown-menu,
.dropdown-menu[aria-labelledby="mapUserFilterDropdown"] {
    z-index: 2147483647 !important;
    position: absolute !important;
    background-color: rgba(33, 37, 41, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    transform: none !important;
    will-change: auto !important;
}

/* Override Bootstrap dropdown positioning when shown */
.dropdown-menu.show {
    z-index: 2147483647 !important;
    position: absolute !important;
}

/* Ensure the specific map user filter dropdown container has proper stacking context */
#mapUserFilterDropdown {
    position: relative !important;
    z-index: 2147483646 !important;
}

/* Force the parent dropdown container to establish proper stacking context */
.dropdown:has(#mapUserFilterDropdown) {
    position: relative !important;
    z-index: 2147483646 !important;
}

/* Force map container to lower z-index */
#map,
#map * {
    z-index: 1 !important;
}

/* Ensure Leaflet controls stay below dropdown */
.leaflet-control-container,
.leaflet-control-container * {
    z-index: 999 !important;
}

/* Override any Leaflet popup z-index */
.leaflet-popup-pane {
    z-index: 1100 !important;
}

/* Additional positioning override for the specific dropdown */
button#mapUserFilterDropdown + .dropdown-menu {
    position: fixed !important;
    z-index: 2147483647 !important;
    will-change: auto !important;
    transform: translate3d(0, 0, 0) !important;
}

/* Notification dropdown specific styles */
#notificationDropdownMenu {
    width: 350px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

#notificationDropdownMenu .dropdown-header {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
}

#notificationDropdownMenu #markAllReadBtn {
    font-size: 10px !important;
    padding: 4px 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

#notificationDropdownMenu #markAllReadBtn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Complete dropdown overlay system for guaranteed visibility */
.dropdown-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    z-index: 2147483645 !important;
    display: none !important;
    pointer-events: all !important;
}

.dropdown-overlay.show {
    display: block !important;
}

/* Notification item styling */
.notification-item {
    transition: all 0.2s ease !important;
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(2px) !important;
}

.notification-item:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Custom dropdown menu that sits on top of everything */
.custom-dropdown-menu {
    position: fixed !important;
    z-index: 2147483647 !important;
    background-color: rgba(33, 37, 41, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    min-width: 200px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    list-style: none !important;
    display: none !important;
    pointer-events: all !important;
}

.custom-dropdown-menu.show {
    display: block !important;
}

.custom-dropdown-menu .dropdown-header {
    display: block !important;
    padding: 0.5rem 1rem !important;
    margin-bottom: 0 !important;
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    white-space: nowrap !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-weight: 600 !important;
}

.custom-dropdown-menu .dropdown-item {
    display: block !important;
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    clear: both !important;
    font-weight: 400 !important;
    color: white !important;
    text-align: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    background-color: transparent !important;
    border: 0 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease-in-out !important;
    font-size: 13px !important;
    pointer-events: all !important;
}

.custom-dropdown-menu .dropdown-item:hover,
.custom-dropdown-menu .dropdown-item:focus,
.custom-dropdown-menu .dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    text-decoration: none !important;
}

.custom-dropdown-menu .dropdown-divider {
    height: 0 !important;
    margin: 0.5rem 0 !important;
    overflow: hidden !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Hide specific Bootstrap dropdowns that use custom implementations */
.navbar .dropdown-menu.custom-hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Legacy dropdown styles for fallback */
#impersonationDropdownOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    z-index: 2147483645 !important;
    display: none !important;
}

#impersonationDropdownOverlay.show {
    display: block !important;
}

#customImpersonationMenu {
    position: fixed !important;
    z-index: 2147483647 !important;
    background-color: rgba(33, 37, 41, 0.98) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    min-width: 200px !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
    list-style: none !important;
    font-size: 11px !important;
    display: none !important;
}

#customImpersonationMenu.show {
    display: block !important;
}

#customImpersonationMenu .dropdown-header {
    display: block !important;
    padding: 0.5rem 1rem !important;
    margin-bottom: 0 !important;
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    white-space: nowrap !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-weight: 600 !important;
}

#customImpersonationMenu .dropdown-item {
    display: block !important;
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    clear: both !important;
    font-weight: 400 !important;
    color: white !important;
    text-align: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    background-color: transparent !important;
    border: 0 !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

#customImpersonationMenu .dropdown-item:hover,
#customImpersonationMenu .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Toast notifications - highest priority */
.toast-container {
    z-index: 2147483648 !important;
}

.toast {
    z-index: 2147483648 !important;
    position: relative !important;
}

/* Force all other elements to lower z-index */
.leaflet-container, .leaflet-control-container, main, body > *, 
.container, .container-fluid, .card, .btn, .modal {
    z-index: 1 !important;
}

/* Ensure cards stay below dropdown */
.card {
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure leaflet controls don't interfere with dropdowns */
.leaflet-control-container {
    z-index: 1000 !important;
}

.leaflet-popup-pane {
    z-index: 1100 !important;
}

.leaflet-tooltip-pane {
    z-index: 1050 !important;
}

/* Map container should not interfere with dropdowns */
#map {
    z-index: 1 !important;
    position: relative !important;
}

/* Export Logs Table Horizontal Scrolling */
.table-responsive-horizontal {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.export-logs-table {
    min-width: 1200px;
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

/* Fixed column widths for proper layout */
.export-logs-table .date-column {
    width: 140px;
    min-width: 140px;
}

.export-logs-table .area-column {
    width: 200px;
    min-width: 200px;
}

.export-logs-table .user-column {
    width: 220px;
    min-width: 220px;
}

.export-logs-table .records-column {
    width: 100px;
    min-width: 100px;
}

.export-logs-table .type-column {
    width: 180px;
    min-width: 180px;
}

.export-logs-table .filename-column {
    width: 250px;
    min-width: 250px;
}

.export-logs-table .actions-column {
    width: 120px;
    min-width: 120px;
}

/* Prevent text wrapping in cells */
.export-logs-table td,
.export-logs-table th {
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 8px;
    vertical-align: middle;
}

/* Area info styling */
.area-info .area-name {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User info styling */
.user-info {
    max-width: 100%;
}

.user-details {
    min-width: 0;
    flex: 1;
}

.user-details .fw-bold,
.user-details .text-muted {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Export type badge styling */
.export-type-badge {
    display: inline-block;
    max-width: 160px;
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
    padding: 6px 8px;
    white-space: normal;
}

/* Filename container */
.filename-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filename-code {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.copy-filename-btn {
    padding: 2px 6px;
    font-size: 10px;
    flex-shrink: 0;
}

/* Scroll indicator styling */
.scroll-indicator {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.3);
    border-radius: 0.375rem;
    padding: 8px 12px;
}

.scroll-indicator .badge {
    font-size: 10px;
    padding: 4px 8px;
}

/* Custom scrollbar for horizontal scroll */
.table-responsive-horizontal::-webkit-scrollbar {
    height: 12px;
}

.table-responsive-horizontal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.table-responsive-horizontal::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.table-responsive-horizontal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #5b5bf6, #7c3aed);
}

/* Scroll progress indicator */
.scroll-progress-container {
    position: relative;
    margin-top: 8px;
}

.scroll-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.scroll-progress-thumb {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    width: 30%;
    transition: transform 0.1s ease;
    transform: translateX(0%);
}

/* Sticky header */
.export-logs-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #212529 !important;
    border-bottom: 2px solid #6366f1;
}

/* Hover effects */
.export-logs-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Address Detail Table Horizontal Scrolling */
.address-detail-table {
    min-width: 1600px;
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

/* Fixed column widths for address detail table */
.address-detail-table .street-address-column {
    width: 250px;
    min-width: 250px;
}

.address-detail-table .city-column {
    width: 150px;
    min-width: 150px;
}

.address-detail-table .state-column {
    width: 100px;
    min-width: 100px;
}

.address-detail-table .zip-column {
    width: 100px;
    min-width: 100px;
}

.address-detail-table .coordinates-column {
    width: 180px;
    min-width: 180px;
}

.address-detail-table .enrichment-column {
    width: 180px;
    min-width: 180px;
}

.address-detail-table .phone-column {
    width: 140px;
    min-width: 140px;
}

.address-detail-table .validation-status-column {
    width: 130px;
    min-width: 130px;
}

.address-detail-table .first-name-column {
    width: 120px;
    min-width: 120px;
}

.address-detail-table .last-name-column {
    width: 120px;
    min-width: 120px;
}

.address-detail-table .email-column {
    width: 200px;
    min-width: 200px;
}

.address-detail-table .actions-column {
    width: 180px;
    min-width: 180px;
}

/* Prevent text wrapping in address table cells */
.address-detail-table td,
.address-detail-table th {
    white-space: nowrap;
    overflow: hidden;
    padding: 12px 8px;
    vertical-align: middle;
}

/* Address detail table hover effects */
.address-detail-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

/* Mobile responsiveness for export logs */
@media (max-width: 768px) {
    .export-logs-table {
        min-width: 800px;
    }
    
    .address-detail-table {
        min-width: 900px;
    }
    
    .scroll-indicator .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .scroll-indicator .ms-auto {
        margin-left: 0 !important;
        margin-top: 8px;
    }
    
    .export-logs-table .user-column {
        width: 180px;
        min-width: 180px;
    }
    
    .export-logs-table .area-column {
        width: 160px;
        min-width: 160px;
    }
    
    .user-details .fw-bold,
    .user-details .text-muted {
        max-width: 120px;
    }
}

/* Animation for smooth scrolling */
.table-responsive-horizontal {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.table-responsive-horizontal:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .single-address-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .single-address-btn .btn-text {
        font-size: 11px;
    }
    
    .single-address-btn i {
        font-size: 12px;
    }
    
    .map-instruction {
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 13px;
    }
    
    .map-message {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}



/* Scroll Progress Indicator */
.scroll-progress-container {
    padding: 8px 16px;
    background: rgba(33, 37, 41, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scroll-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.scroll-progress-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transition: left 0.1s ease-out;
}

/* Header Address Search Bar Styling */
.address-search-header {
    position: relative;
}

.address-search-header .input-group {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.address-search-header .form-control {
    border: 1px solid #ced4da;
    background: white;
    color: #333 !important;
    font-size: 14px;
    padding: 8px 12px;
    height: 38px;
}

.address-search-header .form-control::placeholder {
    color: #6c757d !important;
}

.address-search-header .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.address-search-header .btn {
    border: 1px solid #007bff;
    padding: 8px 12px;
    background: #007bff;
    color: white;
    transition: all 0.2s ease;
    height: 38px;
}

.address-search-header .btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.address-search-header .btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
}

/* Legacy floating search bar styling (if needed) */
.address-search-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.address-search-container .input-group {
    border-radius: 0.5rem;
    overflow: hidden;
}

.address-search-container .form-control {
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 12px 16px;
}

.address-search-container .form-control:focus {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
}

.address-search-container .btn {
    border: none;
    padding: 12px 16px;
    background: #007bff;
    color: white;
    transition: all 0.2s ease;
}

.address-search-container .btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.address-search-container .btn:disabled {
    background: #6c757d;
    transform: none;
}

/* Search Results Dropdown */
#searchResultsDropdown {
    background: rgba(33, 37, 41, 0.98) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
    margin-top: 2px;
    color: white !important;
    z-index: 9999 !important;
    position: absolute !important;
}

#searchResultsDropdown .dropdown-item {
    border: none;
    padding: 12px 16px;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
    background: transparent !important;
}

#searchResultsDropdown .dropdown-item:hover {
    background: rgba(13, 110, 253, 0.2) !important;
    color: #87ceeb !important;
}

#searchResultsDropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* Search Result Marker */
.search-result-marker {
    filter: drop-shadow(0 2px 4px rgba(231, 76, 60, 0.4));
    z-index: 1000;
}

/* Search result popup */
.search-result-popup {
    min-width: 200px;
}

.search-result-popup h6 {
    color: #e74c3c;
    border-bottom: 1px solid rgba(231, 76, 60, 0.2);
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .address-search-header .input-group {
        width: 250px !important;
    }
    
    .address-search-header .form-control {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .address-search-header .btn {
        padding: 6px 10px;
    }
    
    .address-search-container {
        width: 280px !important;
        position: relative !important;
        top: 10px !important;
        left: 10px !important;
    }
    
    .address-search-container .form-control {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .address-search-container .btn {
        padding: 10px 12px;
    }
}

}
