/* =======================
   NEON TEAL THEME VARIABLES
   ======================= */

/* =======================
   LOADING ANIMATION STYLES
   ======================= */

.layers-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.95) 0%, rgba(26, 26, 26, 0.98) 100%);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.layers-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.layers-loading-content {
    text-align: center;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.layers-loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top: 3px solid #00ffe7;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-delay: -0.5s;
    border-top-color: rgba(0, 255, 231, 0.7);
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    animation-delay: -1s;
    border-top-color: rgba(0, 255, 231, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.layers-loading-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #00ffe7;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 10px rgba(0, 255, 231, 0.3);
}

.layers-loading-text p {
    font-size: 1rem;
    color: #a0a0a0;
    margin: 0;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .layers-loading-spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner-ring:nth-child(1) {
        width: 60px;
        height: 60px;
    }
    
    .spinner-ring:nth-child(2) {
        width: 45px;
        height: 45px;
        top: 7.5px;
        left: 7.5px;
    }
    
    .spinner-ring:nth-child(3) {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .layers-loading-text h3 {
        font-size: 1.25rem;
    }
    
    .layers-loading-text p {
        font-size: 0.875rem;
    }
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* WMS Layer Item Styles */
.wms-layer-item {
    transition: all 0.2s ease;
}

.wms-layer-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 255, 231, 0.1);
}

.wms-layer-checkbox {
    accent-color: var(--neon-teal);
}

/* Selected WMS Layer Styling */
.wms-layer-item.selected {
    background: linear-gradient(135deg, rgba(0, 255, 231, 0.08) 0%, rgba(0, 255, 231, 0.04) 100%);
    border-color: var(--neon-teal);
    box-shadow: var(--neon-glow-sm);
    transform: translateY(-1px);
}

.wms-layer-item.selected:hover {
    background: linear-gradient(135deg, rgba(0, 255, 231, 0.12) 0%, rgba(0, 255, 231, 0.06) 100%);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
}

.wms-layer-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--neon-teal) 0%, rgba(0, 255, 231, 0.6) 100%);
    border-radius: 0 2px 2px 0;
}

.wms-layer-item {
    position: relative;
    transition: all 0.2s ease;
}
:root {
    --neon-teal: #00ffe7;
    --pure-black: #121212;
    --dark-gray: #1a1a1a;
    --light-gray: #e0e0e0;
    --neon-glow: 0 0 8px rgba(0, 255, 231, 0.6);
    --neon-glow-sm: 0 0 4px rgba(0, 255, 231, 0.4);
    --neon-glow-lg: 0 0 16px rgba(0, 255, 231, 0.8);
    
    /* Font Size Hierarchy */
    --font-size-title: 18px;      /* Large titles and page headers */
    --font-size-header: 14px;     /* Section headers */
    --font-size-body: 12px;       /* Standard body text and labels */
    --font-size-small: 10px;      /* Small text and captions */
    --font-size-tiny: 8px;       /* Tiny text for metadata */
}

/* =======================
   FONT SIZE STANDARDIZATION
   ======================= */

/* Override all existing font sizes with hierarchy */
h1, .text-2xl, .text-3xl, .login-title, .section-title, .page-title,
.dashboard h1, .database h1, .composer-title {
    font-size: var(--font-size-title) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

h2, .text-lg, .text-xl, .section-header, .modal-header h2, 
.symbology-editor-header h3, .panel-header h1 {
    font-size: var(--font-size-header) !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

/* Standard body text - most common elements */
body, p, .text-base, .text-sm, .form-input, .form-label, 
.nav-item-text, .nav-user-name, .property-value, .modal-body,
.toolbar-panel label, .toolbar-panel select, .toolbar-panel input,
.glass-section label, .control-input, .control-label, .checkbox-label {
    font-size: var(--font-size-body) !important;
    line-height: 1.4 !important;
}

/* Small text and captions */
.text-xs, .nav-user-email, .property-key, .help-text, .caption,
.floating-statistics-label, .statistics-result-field, .text-gray-400,
.control-unit, .control-info, .forgot-password a, .error-message {
    font-size: var(--font-size-small) !important;
    line-height: 1.3 !important;
}

/* Tiny text for metadata and very small elements */
.text-tiny, .metadata, .version-info, .copyright {
    font-size: var(--font-size-tiny) !important;
    line-height: 1.2 !important;
}

/* Special cases that should maintain their relative sizes */
.selection-counter-number, .floating-statistics-number {
    font-size: calc(var(--font-size-title) + 8px) !important; /* Slightly larger than title */
}

.statistics-result-value {
    font-size: calc(var(--font-size-header) + 4px) !important; /* Slightly larger than header */
}

/* Icon sizes should be consistent */
.nav-item-icon, .tool-btn i, .panel-header i, .context-menu-item i {
    font-size: var(--font-size-body) !important;
}

/* Button text consistency */
button, .btn, .modal-btn, .confirm-modal-btn, .login-button,
.composer-btn, .glass-button {
    font-size: var(--font-size-body) !important;
    font-weight: 500 !important;
}

/* =======================
   LAYOUT & STRUCTURE
   ======================= */

/* Ensure the root container stretches to 100vh */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Avenir', sans-serif;
    background-color: var(--pure-black);
    color: var(--light-gray);
    overflow: hidden;
}

.header-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    height: 40px !important;
}

.main-content-container {
    position: absolute !important;
    top: 40px !important; /* Below header */
    left: 0 !important; /* Full viewport width - sidebar floats above */
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important; /* Full viewport width */
    height: calc(100vh - 40px) !important; /* Viewport height minus header */
    overflow: hidden;
    z-index: 1 !important; /* Lower than sidebar and header */
}

/* MODERN COLLAPSIBLE NAVIGATION SIDEBAR */
.modern-nav-sidebar {
    position: fixed !important;
    top: 50px !important;
    left: 10px !important;
    width: 80px !important;
    height: calc(100vh - 70px) !important;
    background: rgba(18, 18, 18, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    z-index: 1100 !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px !important;
}

.modern-nav-sidebar {
    width: 250px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}



/* Navigation Logo Container */
.nav-logo-container {
    padding: 8px 16px !important; /* Reduced from p-4 (16px) to 8px top/bottom */
    border-bottom: 1px solid rgba(0, 255, 231, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Navigation Content Container */
.nav-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 8px 8px 8px 8px !important; /* Reduced top padding from 72px to 8px */
}

/* Search Bar */
.nav-search-container {
    margin-bottom: 28px !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.1s !important;
}

.nav-search-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.nav-search-icon {
    position: absolute !important;
    left: 16px !important;
    color: rgba(0, 255, 231, 0.7) !important;
    font-size: 15px !important;
    z-index: 1 !important;
    transition: all 0.3s ease !important;
}

.nav-search-input {
    width: 100% !important;
    height: 44px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 255, 231, 0.2) !important;
    border-radius: 14px !important;
    padding: 0 18px 0 44px !important;
    color: var(--light-gray) !important;
    font-size: 14px !important;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) !important;
    outline: none !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.nav-search-input::placeholder {
    color: rgba(224, 224, 224, 0.4) !important;
}

.nav-search-input:focus {
    border-color: rgba(0, 255, 231, 0.6) !important;
    box-shadow: 
        0 0 0 3px rgba(0, 255, 231, 0.15),
        0 0 20px rgba(0, 255, 231, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    background: rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-1px) !important;
}

/* Navigation Links */
.nav-links {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 16px 0 !important;
}

.nav-item {
    position: relative !important;
    cursor: pointer !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    border: none !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 6px auto !important;
    background: rgba(255, 255, 255, 0.09) !important;
}

.nav-item-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    height: 100% !important;
}

.nav-item-icon {
    font-size: 16px !important;
    color: var(--light-gray) !important;
    transition: all 0.3s ease !important;
    min-width: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.nav-item-text {
    margin-left: 18px !important;
    color: var(--light-gray) !important;
    font-weight: 500 !important;
    opacity: 0 !important;
    transform: translateX(-10px) !important;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) !important;
    white-space: nowrap !important;
    letter-spacing: 0.3px !important;
}

.nav-item {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
}

.nav-item-content {
    padding: 14px 16px !important;
    justify-content: flex-start !important;
}

.nav-item-icon {
    font-size: 16px !important;
    min-width: 16px !important;
}

.nav-item-text {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Navigation Item States */
.nav-item:hover {
    background: rgba(0, 255, 231, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(0, 255, 231, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.005) !important;
}

.nav-item:hover .nav-item-icon {
    color: white !important;
}

.nav-item:hover .nav-item-text {
    color: white !important;
}

.nav-item.active {
    background: rgba(0, 255, 231, 0.15) !important;
    color: var(--neon-teal) !important;
}

.nav-item.active .nav-item-icon {
    color: var(--neon-teal) !important;
}

.nav-item.active .nav-item-text {
    color: var(--neon-teal) !important;
    font-weight: 600 !important;
}


/* User Profile Section */
.nav-user-profile {
    margin-top: auto !important;
    padding: 16px 0 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.nav-user-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    border-radius: 16px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(0, 255, 231, 0.15) !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 auto !important;
}

.nav-user-content:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}


.nav-user-avatar {
    width: 32px !important;
    height: 32px !important;
    background: var(--neon-teal) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
}

.nav-user-initial {
    color: var(--pure-black) !important;
    font-weight: 700 !important;
    font-size: 14px;
}

.nav-user-info {
    margin-left: 12px !important;
    flex: 1 !important;
    opacity: 0 !important;
    transform: translateX(-10px) !important;
    transition: all 0.3s ease 0.1s !important;
    overflow: hidden !important;
}

.nav-user-content {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px !important;
    justify-content: flex-start !important;
}

.nav-user-info {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.nav-user-name {
    display: block !important;
    color: var(--light-gray) !important;
    font-weight: 600 !important;
    font-size: 14px;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.nav-user-email {
    display: block !important;
    color: rgba(224, 224, 224, 0.6) !important;
    font-size: 12px;
    line-height: 1.2 !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* FLOATING TOOLBOX (RIGHT EDGE) */
.floating-toolbox {
    position: fixed !important;
    top: 50px !important;
    right: 20px !important;
    transform: none !important;
    z-index: 1250 !important;
    background: rgba(18, 18, 18, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

.toolbox-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.tool-btn {
    width: 44px !important;
    height: 44px !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    color: var(--light-gray) !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.tool-btn:hover {
    background: rgba(0, 255, 231, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(0, 255, 231, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
}

.tool-btn.active {
    background: rgba(0, 255, 231, 0.2) !important;
    border-color: rgba(0, 255, 231, 0.4) !important;
    color: var(--neon-teal) !important;
    box-shadow: 0 4px 16px rgba(0, 255, 231, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* FLOATING TOOLBAR PANELS */
.toolbar-panels-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 1200 !important;
}

.toolbar-panel {
    position: absolute !important;
    top: 50px !important;
    right: 90px !important; /* Space from toolbox */
    transform: translateX(30px) !important;
    width: 320px !important;
    max-height: calc(100vh - 120px) !important;
    background: rgba(18, 18, 18, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    display: none !important;
    flex-direction: column !important;
    pointer-events: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    overflow: hidden !important;
}

.toolbar-panel.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
}

.toolbar-panel .p-4 {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: calc(100vh - 200px) !important;
}

/* Panel Close Button */
.panel-close-btn {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    color: var(--light-gray) !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10 !important;
}

.panel-close-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Panel Header */
.panel-header {
    padding: 20px 50px 16px 20px !important; /* Extra right padding for close button */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Glass Section Styles */
.glass-section {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: all 0.3s ease !important;
}

.glass-section:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.section-divider {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Update buttons within glass sections */
.glass-section button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    transition: all 0.3s ease !important;
}

.glass-section button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Update inputs and selects within glass sections */
.glass-section input,
.glass-section select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    transition: all 0.3s ease !important;
}

.glass-section input:focus,
.glass-section select:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(0, 255, 231, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 231, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    outline: none !important;
}

/* Fix dropdown options styling to match dark theme */
.glass-section select option,
select option,
#filterLayerSelect option,
#filterFieldSelect option,
#filterOperatorSelect option,
#filterSingleValueSelect option {
    background-color: var(--pure-black) !important;
    color: var(--light-gray) !important;
    border: none !important;
    padding: 8px 12px !important;
}

.glass-section select option:hover,
select option:hover,
#filterLayerSelect option:hover,
#filterFieldSelect option:hover,
#filterOperatorSelect option:hover,
#filterSingleValueSelect option:hover {
    background-color: rgba(0, 255, 231, 0.2) !important;
    color: var(--neon-teal) !important;
}

.glass-section select option:checked,
select option:checked,
#filterLayerSelect option:checked,
#filterFieldSelect option:checked,
#filterOperatorSelect option:checked,
#filterSingleValueSelect option:checked {
    background-color: rgba(0, 255, 231, 0.3) !important;
    color: var(--neon-teal) !important;
}

/* Ensure filter dropdowns have proper dark theme styling */
#filterLayerSelect,
#filterFieldSelect,
#filterOperatorSelect,
#filterSingleValueSelect {
    background-color: var(--pure-black) !important;
    color: var(--light-gray) !important;
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
}

#filterLayerSelect:focus,
#filterFieldSelect:focus,
#filterOperatorSelect:focus,
#filterSingleValueSelect:focus {
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
}

/* APP SECTIONS */
.app-section {
    display: none !important;
    width: 100% !important;
    height: 100% !important;
}

.app-section.active {
    display: block !important;
}

.section-content {
    padding: 2rem !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
}

#map {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    z-index: 10 !important; /* Above main container but below UI elements */
    background: transparent !important; /* Ensure no black background */
}

/* Ensure Leaflet container renders properly */
.leaflet-container {
    background: transparent !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Avenir', sans-serif !important;
}

/* Ensure map tiles render properly */
.leaflet-tile-container {
    z-index: 1 !important;
}

/* Ensure map panes are properly layered */
.leaflet-map-pane {
    z-index: 1 !important;
}

.leaflet-tile-pane {
    z-index: 1 !important;
}

.leaflet-overlay-pane {
    z-index: 2 !important;
}

.leaflet-shadow-pane {
    z-index: 3 !important;
}

.leaflet-marker-pane {
    z-index: 4 !important;
}

.leaflet-tooltip-pane {
    z-index: 5 !important;
}

.leaflet-popup-pane {
    z-index: 6 !important;
}

/* Collaborative Mode Toggle */
.toggle-bg:checked {
    background-color: var(--neon-teal);
}

.toggle-bg:checked + .toggle-thumb {
    transform: translateX(16px);
    background-color: var(--pure-black);
}

/* =======================
   GLASS EFFECTS
   ======================= */

.glass-effect {
    background: rgba(17, 25, 40, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.125);
}

.glass-panel {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.btn-glass {
    background: rgba(20, 184, 166, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(20, 184, 166, 0.3);
    transition: all 0.3s ease;
}

.btn-glass:hover {
    background: rgba(20, 184, 166, 0.4);
    border-color: rgba(20, 184, 166, 0.5);
}

/* HIDE OLD SIDEBAR SYSTEM - REPLACED BY FLOATING TOOLBOX */
.leaflet-sidebar,
#sidebar {
    display: none !important;
    visibility: hidden !important;
}

/* =======================
   MAP CONTROLS - NEON TEAL THEME
   ======================= */

.leaflet-control-container .leaflet-top.leaflet-right {
    top: 50px !important;
}

.leaflet-control-container .leaflet-top.leaflet-left {
    top: 50px !important;
    left: 90px !important; /* Position next to nav sidebar */
}

/* Modern circular map controls */
.leaflet-control-zoom {
    left: 90px !important; /* Next to nav sidebar */
    top: 10px !important; /* Adjusted for new layout */
    bottom: auto !important;
    right: auto !important;
    z-index: 1100 !important;
    background: var(--pure-black) !important;
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background-color: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    color: var(--light-gray) !important;
    font-size: 18px !important;
    margin: 2px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(0, 255, 231, 0.2) !important;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(0, 255, 231, 0.1) !important;
    color: var(--neon-teal) !important;
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
    transform: translateX(2px) !important;
}

.leaflet-control-zoom a:first-child {
    border-bottom: 1px solid rgba(0, 255, 231, 0.2) !important;
}

/* Custom map tool controls */
.map-tools-container {
    position: absolute;
    left: 90px;
    top: 90px; /* Adjusted for new layout */
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--pure-black);
    border: 1px solid rgba(0, 255, 231, 0.3);
    border-radius: 8px;
    padding: 4px;
}

.map-tool-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(0, 255, 231, 0.2);
    border-radius: 50%;
    color: var(--light-gray);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-tool-btn:hover {
    background: rgba(0, 255, 231, 0.1);
    color: var(--neon-teal);
    border-color: var(--neon-teal);
    box-shadow: var(--neon-glow-sm);
    transform: translateX(2px);
}

.map-tool-btn.active {
    background: rgba(0, 255, 231, 0.2);
    color: var(--neon-teal);
    border-color: var(--neon-teal);
    box-shadow: var(--neon-glow);
}

/* =======================
   LAYER STYLES
   ======================= */

.layer-item {
    border: 1px solid rgba(75, 85, 99, 0.3);
    background: rgba(31, 41, 55, 0.6);
}

/* Drag-and-drop styles only for layer items */
.layer-item[draggable="true"] {
    cursor: move;
}

.layer-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.layer-item.drag-over {
    border: 2px dashed #14b8a6;
    background: rgba(20, 184, 166, 0.15);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.layer-drag-handle {
    color: #9ca3af;
    cursor: grab;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

/* =======================
   LEGEND STYLES
   ======================= */

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =======================
   MODAL STYLES
   ======================= */

.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* =======================
   MODALS - NEON TEAL THEME
   ======================= */

/* Global Modal Overlay */
.modal-overlay,
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Hidden state for modals */
.modal-overlay.hidden,
#filterModal.hidden,
#symbologyModal.hidden {
    display: none;
}

/* Show state for modals */
.modal-overlay:not(.hidden),
#filterModal:not(.hidden),
#symbologyModal:not(.hidden) {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-overlay.show,
.confirm-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    display: flex;
}

/* Global Modal Base Styles */
.modal-dialog,
.confirm-modal {
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 90%;
    padding: 20px 24px;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: white;
}

/* Large modals */
.modal-dialog.modal-lg {
    max-width: 480px;
}

/* Filter and Symbology modals specific styling */
#filterModal .modal-dialog,
#symbologyModal .modal-dialog {
    background: rgba(18, 18, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 90%;
    padding: 20px 24px;
    color: white;
}


.modal-overlay.show .modal-dialog,
.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-modal-icon {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    line-height: 1;
}

.confirm-modal-icon.success {
    color: var(--neon-teal);
}

.confirm-modal-icon.warning {
    color: #f59e0b;
}

.confirm-modal-icon.error {
    color: #ef4444;
}

.confirm-modal-icon.info {
    color: var(--neon-teal);
}

.confirm-modal-icon.question {
    color: var(--neon-teal);
}

/* Modal Headers */
.modal-header,
.confirm-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 255, 231, 0.2);
}

.modal-header h2 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-header .text-neon-teal {
    color: var(--neon-teal);
}

/* Modal Body Text */
.modal-body,
.confirm-modal-message {
    color: var(--light-gray);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 2rem;
    white-space: pre-line;
}

.modal-body {
    text-align: left;
    margin-bottom: 1.5rem;
}

.modal-body .space-y-4 > * + * {
    margin-top: 1rem;
}

.confirm-modal-input-container {
    margin-bottom: 2rem;
}

/* Modal Form Elements */
.modal-body input,
.modal-body select,
.modal-body textarea,
.confirm-modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus,
.confirm-modal-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body input::placeholder,
.modal-body select::placeholder,
.modal-body textarea::placeholder,
.confirm-modal-input::placeholder {
    color: #6b7280;
}

/* Modal Footer Buttons */
.modal-footer,
.confirm-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.modal-footer {
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 255, 231, 0.2);
}

/* Modal Buttons */
.modal-btn,
.confirm-modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 231, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Primary Modal Buttons */
.modal-btn-primary,
.confirm-modal-btn-ok {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-btn-primary:hover,
.confirm-modal-btn-ok:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Secondary Modal Buttons */
.modal-btn-secondary,
.confirm-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-gray);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-btn-secondary:hover,
.confirm-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Modal Close Buttons */
.modal-close {
    background: transparent;
    border: none;
    color: var(--light-gray);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--neon-teal);
    background: rgba(0, 255, 231, 0.1);
}

.modal-close i {
    font-size: 1rem;
}

/* Modal Labels */
.modal-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neon-teal);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modal Accessibility Features */
.modal-dialog {
    outline: none;
}

.modal-dialog:focus {
    outline: 2px solid var(--neon-teal);
    outline-offset: 2px;
}

/* Focus trap for modals */
.modal-overlay:not(.hidden) .modal-dialog *:focus {
    outline: 2px solid var(--neon-teal);
    outline-offset: 1px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Modal animation for reduced motion users */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .confirm-modal-overlay {
        transition: none;
    }
    
    .modal-dialog,
    .confirm-modal {
        transition: none;
        transform: none;
    }
    
    .modal-overlay.show .modal-dialog,
    .confirm-modal-overlay.show .confirm-modal {
        transform: none;
    }
}

/* =======================
   RESPONSIVE DESIGN - NEON TEAL THEME
   ======================= */

/* Mobile devices (phones) */
@media (max-width: 768px) {
    /* Adjust font sizes for mobile */
    :root {
        --font-size-title: 24px;      /* Smaller title on mobile */
        --font-size-header: 16px;     /* Smaller header on mobile */
        --font-size-body: 13px;       /* Slightly smaller body text */
        --font-size-small: 11px;      /* Smaller small text */
        --font-size-tiny: 9px;        /* Smaller tiny text */
    }
    
    .header-container header {
        height: 50px !important;
        padding: 0 1rem !important;
    }
    
    .header-container header img {
        height: 25px !important;
    }
    
    .modern-nav-sidebar {
        width: 60px !important;
        top: 50px !important;
        height: calc(100vh - 50px) !important;
        border-radius: 0 12px 12px 0 !important;
    }
    
    .modern-nav-sidebar {
        width: 240px !important;
    }
    
    
    .nav-content {
        padding: 50px 12px 12px 12px !important;
    }
    
    .nav-item-content {
        padding: 14px 10px !important;
    }
    
    .nav-item-icon {
        font-size: 18px !important;
    }
    
    .nav-item-text {
        font-size: 14px !important;
    }
    
    .nav-search-input {
        height: 36px !important;
        font-size: 13px !important;
    }
    
    .nav-user-avatar {
        width: 32px !important;
        height: 32px !important;
    }
    
    .nav-user-initial {
        font-size: 14px !important;
    }
    
    .nav-user-name {
        font-size: 13px !important;
    }
    
    .nav-user-email {
        font-size: 11px !important;
    }
    
    /* Adjust tooltip position for mobile */
    .nav-item::after {
        left: 60px;
    }
    
    .nav-item:hover::after {
        left: 65px;
    }
    
    .main-content-container {
        position: absolute !important;
        top: 50px !important;
        left: 0 !important; /* Full viewport width - sidebar floats above */
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important; /* Full viewport width */
        height: calc(100vh - 50px) !important;
        z-index: 1 !important;
    }
    
    .floating-toolbox {
        right: 10px !important;
    }
    
    .toolbar-panel {
        right: 70px !important;
        width: 280px !important;
    }
    
    .leaflet-control-zoom,
    .map-tools-container {
        left: 70px !important;
        top: 10px !important;
    }
    
    .leaflet-control-container .leaflet-top.leaflet-left {
        left: 70px !important;
        top: 10px !important;
    }
    
    .confirm-modal {
        max-width: 300px;
        padding: 1.5rem;
    }
    
    .confirm-modal-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 70px;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Adjust font sizes for tablets */
    :root {
        --font-size-title: 26px;      /* Medium title on tablets */
        --font-size-header: 17px;     /* Medium header on tablets */
        --font-size-body: 14px;       /* Standard body text */
        --font-size-small: 12px;      /* Standard small text */
        --font-size-tiny: 10px;       /* Standard tiny text */
    }
    
    .leaflet-control-zoom,
    .map-tools-container {
        left: 90px !important;
    }
    
    .leaflet-control-container .leaflet-top.leaflet-left {
        left: 90px !important;
    }
    
    .floating-toolbox {
        right: 15px !important;
    }
    
    .toolbar-panel {
        right: 75px !important;
        width: 300px !important;
    }
}

/* Large screens */
@media (min-width: 1440px) {
    /* Adjust font sizes for large screens */
    :root {
        --font-size-title: 32px;      /* Larger title on large screens */
        --font-size-header: 20px;     /* Larger header on large screens */
        --font-size-body: 16px;       /* Larger body text */
        --font-size-small: 14px;      /* Larger small text */
        --font-size-tiny: 12px;       /* Larger tiny text */
    }
    
    .fixed-nav-sidebar {
        width: 90px !important; /* Slightly wider on large screens */
    }
    
    .nav-section {
        width: 70px !important;
        height: 70px !important;
    }
    
    /* Adjust tooltip position for large screens */
    .nav-section::after {
        left: 80px;
    }
    
    .nav-section:hover::after {
        left: 85px;
    }
    
    .main-content-container {
        position: absolute !important;
        top: 40px !important;
        left: 0 !important; /* Full viewport width - sidebar floats above */
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important; /* Full viewport width */
        height: calc(100vh - 40px) !important;
        z-index: 1 !important;
    }
    
    .floating-toolbox {
        right: 25px !important;
    }
    
    .toolbar-panel {
        right: 95px !important;
        width: 340px !important;
    }
    
    .leaflet-control-zoom,
    .map-tools-container {
        left: 100px !important;
    }
    
    .leaflet-control-container .leaflet-top.leaflet-left {
        left: 100px !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .map-tool-btn,
    .tool-btn,
    .leaflet-control-zoom a {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode preference detection */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--pure-black);
        color: var(--light-gray);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --neon-glow: 0 0 12px rgba(0, 255, 231, 0.9);
        --neon-glow-sm: 0 0 6px rgba(0, 255, 231, 0.7);
        --neon-glow-lg: 0 0 20px rgba(0, 255, 231, 1);
    }
    
    .tool-btn,
    .map-tool-btn,
    .leaflet-control-zoom a {
        border-width: 2px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =======================
   PROGRESS BAR & TOOLTIP
   ======================= */

.progress-bar {
    background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 100%);
}

.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* =======================
   POPUP STYLES
   ======================= */

/* Custom popup styling for better UX */
.custom-popup .leaflet-popup-content-wrapper {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

.custom-popup .leaflet-popup-content {
    max-width: 400px;
    word-wrap: break-word;
    margin: 4px 8px;
    font-size: 10px;
}

/* Reduce font sizes for all text elements in custom popup */
.custom-popup h1, .custom-popup h2, .custom-popup h3, .custom-popup h4, .custom-popup h5, .custom-popup h6 {
    font-size: 11px !important;
    margin: 2px 0 !important;
    line-height: 1.2 !important;
}

.custom-popup p, .custom-popup div, .custom-popup span, .custom-popup td, .custom-popup th {
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin: 1px 0 !important;
}

.custom-popup table {
    margin: 2px 0 !important;
}

.custom-popup td, .custom-popup th {
    padding: 1px 4px !important;
}

/* Make custom popup draggable and resizable */
.custom-popup {
    resize: both;
    overflow: auto;
    min-width: 200px;
    min-height: 100px;
}

.custom-popup .leaflet-popup-content-wrapper {
    cursor: move;
}

/* Custom feature popup styling */
.custom-feature-popup {
    resize: both !important;
    overflow: auto !important;
    min-width: 200px !important;
    min-height: 100px !important;
    cursor: move !important;
}

.custom-feature-popup * {
    font-size: 9px !important;
    line-height: 1.2 !important;
}

.custom-feature-popup h1, .custom-feature-popup h2, .custom-feature-popup h3, 
.custom-feature-popup h4, .custom-feature-popup h5, .custom-feature-popup h6 {
    font-size: 10px !important;
    margin: 2px 0 !important;
}

/* Ensure popup stays within viewport */

/* =======================
   MAP COMPOSER STYLES
   ======================= */

.map-composer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.map-composer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.map-composer-container {
    background: var(--pure-black);
    border: 1px solid var(--neon-teal);
    border-radius: 12px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: var(--neon-glow-lg);
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 255, 231, 0.1);
    border-bottom: 1px solid rgba(0, 255, 231, 0.3);
}

.composer-title {
    color: var(--light-gray);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.composer-close-btn {
    background: none;
    border: none;
    color: var(--light-gray);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.composer-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--neon-teal);
}

.composer-content {
    display: flex;
    gap: 20px;
    padding: 20px;
}

.composer-canvas-container {
    flex: 1;
}

.composer-canvas-wrapper {
    position: relative;
    background: var(--dark-gray);
    border: 2px solid rgba(0, 255, 231, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
}

.composer-map {
    width: 100%;
    height: 100%;
    position: relative;
}

.composer-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 500;
}

.composer-frame-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed rgba(0, 255, 231, 0.6);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.composer-drag-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--neon-teal);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
}

.composer-controls {
    min-width: 300px;
    max-width: 350px;
    background: rgba(26, 26, 26, 0.8);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 231, 0.2);
}

.control-group {
    margin-bottom: 24px;
}

.control-label {
    display: block;
    color: var(--neon-teal);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-input {
    background: var(--pure-black);
    border: 1px solid rgba(0, 255, 231, 0.3);
    border-radius: 6px;
    color: var(--light-gray);
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    transition: all 0.2s ease;
}

.control-input:focus {
    outline: none;
    border-color: var(--neon-teal);
    box-shadow: 0 0 0 2px rgba(0, 255, 231, 0.2);
}

.control-separator {
    color: var(--light-gray);
    font-weight: bold;
}

.control-unit {
    color: rgba(224, 224, 224, 0.7);
    font-size: 12px;
    min-width: 40px;
}

.control-info {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(224, 224, 224, 0.8);
}

.preview-container {
    background: var(--pure-black);
    border: 1px solid rgba(0, 255, 231, 0.3);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

#composerPreview {
    border-radius: 4px;
    background: var(--dark-gray);
}

.composer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.composer-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.composer-btn-primary {
    background: linear-gradient(135deg, var(--neon-teal), rgba(0, 255, 231, 0.8));
    color: var(--pure-black);
    border: 1px solid var(--neon-teal);
}

.composer-btn-primary:hover:not(:disabled) {
    background: var(--neon-teal);
    box-shadow: var(--neon-glow);
    transform: translateY(-1px);
}

.composer-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.composer-btn-secondary {
    background: rgba(224, 224, 224, 0.1);
    color: var(--light-gray);
    border: 1px solid rgba(224, 224, 224, 0.3);
}

.composer-btn-secondary:hover {
    background: rgba(224, 224, 224, 0.2);
    border-color: rgba(224, 224, 224, 0.5);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .composer-content {
        flex-direction: column;
        align-items: center;
    }
    
    .composer-canvas-wrapper {
        width: 80vw !important;
        height: 45vw !important;
        max-width: 960px;
        max-height: 540px;
    }
    
    .composer-controls {
        max-width: none;
        width: 100%;
    }
}
.leaflet-popup {
    max-width: 90vw !important;
}

/* =======================
   CONTEXT MENU STYLES
   ======================= */

/* Custom Context Menu Styles */
.custom-context-menu {
    position: fixed;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    min-width: 160px;
    padding: 4px 0;
    font-size: 14px;
    display: none;
    pointer-events: auto;
}

/* Context menu active state with smooth animation */
.custom-context-menu.context-menu-active {
    opacity: 1;
    transform: scale(1);
}

.context-menu-item {
    padding: 8px 16px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.15s ease;
}

.context-menu-item:hover {
    background-color: rgba(20, 184, 166, 0.2);
}

.context-menu-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #14b8a6;
}

.context-menu-item.disabled {
    color: #6b7280;
    cursor: not-allowed;
}

.context-menu-item.disabled:hover {
    background-color: transparent;
}

.context-menu-item.disabled i {
    color: #6b7280;
}

.context-menu-separator {
    height: 1px;
    background-color: rgba(75, 85, 99, 0.5);
    margin: 4px 0;
}

/* Context Menu Submenu Styles */
.context-menu-parent {
    position: relative;
}

.context-menu-arrow {
    margin-left: auto;
    margin-right: 0;
    font-size: 12px;
    opacity: 0.7;
}

.context-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    max-width: 250px;
    padding: 4px 0;
    display: none;
    z-index: 10001;
    max-height: 400px;
    overflow-y: auto;
}

.context-menu-parent:hover .context-submenu {
    display: block;
}

/* Group Header Styles */
.context-menu-group-header {
    padding: 8px 16px 4px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    margin-bottom: 4px;
    background: rgba(17, 24, 39, 0.5);
}

/* Satellite Options with Label Toggle */
.satellite-option {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 16px;
}

.satellite-option > span {
    display: flex;
    align-items: center;
    width: 100%;
}

.label-toggle {
    display: flex;
    align-items: center;
    margin-top: 6px;
    margin-left: 26px;
    font-size: 12px;
    cursor: pointer;
}

.label-checkbox {
    margin-right: 6px;
    cursor: pointer;
}

.label-text {
    color: #10b981;
    font-size: 11px;
}

.satellite-option:hover .label-text {
    color: #34d399;
}

.basemap-option {
    white-space: nowrap;
    font-size: 13px;
}

.basemap-option:hover {
    background-color: rgba(20, 184, 166, 0.3);
}

/* Scrollbar styling for submenu */
.context-submenu::-webkit-scrollbar {
    width: 6px;
}

.context-submenu::-webkit-scrollbar-track {
    background: rgba(75, 85, 99, 0.3);
    border-radius: 3px;
}

.context-submenu::-webkit-scrollbar-thumb {
    background: rgba(20, 184, 166, 0.5);
    border-radius: 3px;
}

.context-submenu::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 184, 166, 0.7);
}


/* =======================
   LOGIN PAGE STYLES
   ======================= */
#loginContainer {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url('../assets/Home.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        #loginContainer::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.75);
            z-index: -1;
        }

        .login-card {
            background: rgba(31, 41, 55, 0.15);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 16px;
            padding: 3rem;
            min-width: 400px;
            max-width: 450px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
            animation: fadeInUp 0.6s ease-out;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .login-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }

        .login-title {
            font-size: 2.5rem;
            font-weight: 700;
            color: #14b8a6;
            margin-bottom: 0.5rem;
            font-family: 'Inter', sans-serif;
        }

        .login-subtitle {
            font-size: 1rem;
            color: #9ca3af;
            font-weight: 400;
        }

        .login-form {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form-label {
            font-size: 0.875rem;
            font-weight: 500;
            color: #e5e7eb;
        }

        .form-input {
            padding: 1rem;
            background: rgba(55, 65, 81, 0.8);
            border: 1px solid rgba(75, 85, 99, 0.6);
            border-radius: 8px;
            color: white;
            font-size: 1rem;
            transition: all 0.3s ease;
            width: 100%;
        }

        .form-input:focus {
            outline: none;
            border-color: #14b8a6;
            box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
            background: rgba(55, 65, 81, 1);
        }

        .form-input::placeholder {
            color: #9ca3af;
        }

        .password-input-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-toggle-btn {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            padding: 0;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.3s ease;
            z-index: 10;
        }

        .password-toggle-btn:hover {
            color: #14b8a6;
        }

        .password-toggle-btn i {
            font-size: 16px;
        }

        .form-input.has-toggle {
            padding-right: 3rem;
        }

        .login-button {
            padding: 1rem 2rem;
            background: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 1rem;
        }

        .login-button:hover:not(:disabled) {
            background: linear-gradient(135deg, #0891b2 0%, #14b8a6 100%);
            transform: translateY(-1px);
            box-shadow: 0 8px 25px rgba(20, 184, 166, 0.3);
        }

        .login-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .error-message {
            background: rgba(239, 68, 68, 0.2);
            border: 1px solid rgba(239, 68, 68, 0.5);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            color: #fecaca;
            font-size: 0.875rem;
            margin-bottom: 1rem;
            animation: shake 0.5s ease-in-out;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        .forgot-password {
            text-align: center;
            margin-top: 1.5rem;
        }

        .forgot-password a {
            color: #14b8a6;
            font-size: 0.875rem;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .forgot-password a:hover {
            color: #0891b2;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* WebGIS Container - initially hidden */
        #webgisContainer {
            display: none;
        }

        /* User info and logout button styles */
        .user-info {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-left: 1rem;
        }

        .user-email {
            color: #e5e7eb;
            font-size: 0.875rem;
        }

        .logout-button {
            background: rgba(239, 68, 68, 0.2);
            border: 1px solid rgba(239, 68, 68, 0.5);
            color: #fecaca;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .logout-button:hover {
            background: rgba(239, 68, 68, 0.3);
        }

        /* Glass effect for header */
        .glass-effect {
            background: rgba(17, 25, 40, 0.75);
            backdrop-filter: blur(16px) saturate(180%);
            -webkit-backdrop-filter: blur(16px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.125);
        }

/* =======================
   ANIMATIONS & KEYFRAMES
   ======================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse-glow {
    0% {
        text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 30px rgba(20, 184, 166, 0.8);
        transform: scale(1.05);
    }
    100% {
        text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
        transform: scale(1);
    }
}

@keyframes count-up {
    0% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fade-slide-in {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes result-glow {
    0% {
        text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
        transform: scale(1.02);
    }
    100% {
        text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
        transform: scale(1);
    }
}

@keyframes fadeInAtPosition {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutAtPosition {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.98);
    }
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =======================
   SELECTION & STATISTICS
   ======================= */

/* Selection Counter Animations and Styling */
.selection-counter-card {
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.selection-counter-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.selection-counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #14b8a6;
    margin-bottom: 0.25rem;
    font-family: 'Inter', monospace;
    text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
    transition: all 0.2s ease;
}

.selection-counter-number.counting {
    animation: pulse-glow 0.15s ease-in-out;
}

.selection-counter-label {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Statistics Result Cards */
.statistics-result-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(55, 65, 81, 0.9));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    animation: fade-slide-in 0.4s ease-out;
}

.statistics-result-card:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.4);
}

.statistics-result-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.statistics-result-operation {
    font-size: 0.875rem;
    font-weight: 600;
    color: #60a5fa;
    text-transform: capitalize;
}

.statistics-result-field {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
}

.statistics-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    font-family: 'Inter', monospace;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    animation: result-glow 0.6s ease-out;
}

/* Statistics Operation Checkboxes */
.statistics-operation-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #6b7280;
    background-color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.statistics-operation-checkbox:checked {
    background-color: #14b8a6;
    border-color: #14b8a6;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7-7a.5.5 0 0 0-.708 0l-3.5 3.5a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708 0l3.5-3.5a.5.5 0 0 0 0-.708z'/%3e%3c/svg%3e");
}

.statistics-operation-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

/* Floating Statistics Cards */
.floating-statistics-card {
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 240px;
    max-width: 320px;
    opacity: 0;
    animation: fadeInAtPosition 0.5s ease-out forwards;
}

.floating-statistics-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
}

.floating-statistics-header {
    margin-bottom: 0.75rem;
}

.floating-statistics-operation {
    font-size: 0.875rem;
    font-weight: 600;
    color: #60a5fa;
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.floating-statistics-field {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
}

.floating-statistics-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: #14b8a6;
    margin-bottom: 0.25rem;
    font-family: 'Inter', monospace;
    text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
    transition: all 0.2s ease;
    word-break: break-all;
}

.floating-statistics-number.counting {
    animation: pulse-glow 0.15s ease-in-out;
}

.floating-statistics-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-statistics-no-features {
    color: #f59e0b;
    font-size: 1.2rem;
    font-weight: 600;
}

.floating-statistics-help-text {
    font-size: 0.625rem;
    color: #6b7280;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Custom scrollbar for floating container */
#floatingStatisticsContainer::-webkit-scrollbar {
    width: 4px;
}

#floatingStatisticsContainer::-webkit-scrollbar-track {
    background: rgba(75, 85, 99, 0.2);
    border-radius: 2px;
}

#floatingStatisticsContainer::-webkit-scrollbar-thumb {
    background: rgba(20, 184, 166, 0.5);
    border-radius: 2px;
}

#floatingStatisticsContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 184, 166, 0.7);
}

/* =======================
   MODERN FEATURE POPUP
   ======================= */

/* Modern Feature Popup Styles */
.modern-feature-popup .leaflet-popup-content-wrapper {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 2px solid #14b8a6;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(20, 184, 166, 0.1);
    backdrop-filter: blur(10px);
    padding: 0;
    overflow: hidden;
}

.modern-feature-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

.modern-popup-container {
    width: 100%;
    min-width: 280px;
    max-width: 350px;
}

.modern-popup-header {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-popup-header i {
    color: #ffffff;
    font-size: 14px;
}

.modern-popup-body {
    padding: 16px;
    background: rgba(30, 58, 138, 0.95);
    max-height: 300px;
    overflow-y: auto;
}

.property-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #14b8a6;
    transition: all 0.2s ease;
}

.property-row:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.property-row:last-child {
    margin-bottom: 0;
}

.property-key {
    font-weight: 700;
    color: #5eead4;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.property-value {
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.4;
}

.property-value .popup-link {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.property-value .popup-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.no-data-text {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
    margin: 0;
    font-size: 14px;
}

/* Custom scrollbar for popup body */
.modern-popup-body::-webkit-scrollbar {
    width: 6px;
}

.modern-popup-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.modern-popup-body::-webkit-scrollbar-thumb {
    background: #14b8a6;
    border-radius: 3px;
}

.modern-popup-body::-webkit-scrollbar-thumb:hover {
    background: #0d9488;
}

/* Modern popup tip styling */
.modern-feature-popup .leaflet-popup-tip {
    background: #14b8a6;
    border: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Animation for popup appearance */
.modern-feature-popup {
    animation: popupSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =======================
   PRINT LAYOUT EDITOR
   ======================= */


/* Fix for tile grid lines/seams in all Leaflet maps */
.leaflet-container .leaflet-tile-container img {
    width: 256.5px !important;
    height: 256.5px !important;
    margin: 0 -0.25px -0.25px 0 !important;
}


/* =======================
   RESPONSIVE DESIGN
   ======================= */

/* Responsive adjustments for smaller screens */
@media (max-width: 640px) {
    .floating-statistics-card {
        padding: 1rem;
    }
    
    .floating-statistics-number {
        font-size: 1.75rem;
    }
    
    .floating-statistics-operation {
        font-size: 0.8rem;
    }
}

/* =======================
   INLINE STYLE CLASSES
   ======================= */

/* Classes for inline styles found in HTML */
.inline-display-none {
    display: none;
}

.inline-webgis-container {
    display: none;
}

.inline-floating-stats-container {
    display: none;
}

.inline-progress-bar-width {
    width: 0%;
}


/* =======================
   COLLABORATIVE MODE TOGGLE
   ======================= */

#collaborativeModeToggle:checked + label .toggle-thumb {
    transform: translateX(20px);
    background-color: #10b981;
}

#collaborativeModeToggle:checked + label > div:first-child {
    background-color: #065f46;
}

#personalModeLabel, #collaborativeModeLabel {
    transition: all 0.2s ease;
}

#collaborativeModeToggle:not(:checked) ~ #personalModeLabel {
    color: #10b981 !important;
    font-weight: 600;
}

#collaborativeModeToggle:checked ~ #collaborativeModeLabel {
    color: #10b981 !important;
    font-weight: 600;
}

.toggle-thumb {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =======================
   ENHANCED LAYER DRAG & DROP
   ======================= */

.layer-item.dragging {
    opacity: 0.5 !important;
    transform: rotate(2deg) !important;
    transition: all 0.2s ease;
    z-index: 1000;
}

.layer-item.drag-target-available {
    transition: all 0.3s ease;
    border: 1px dashed rgba(59, 130, 246, 0.5);
}

.layer-item.drag-over {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border: 2px solid rgba(59, 130, 246, 0.6) !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.layer-item.drag-over-top {
    border-top: 4px solid #3b82f6 !important;
    border-radius: 8px 8px 4px 4px !important;
}

.layer-item.drag-over-bottom {
    border-bottom: 4px solid #3b82f6 !important;
    border-radius: 4px 4px 8px 8px !important;
}

.layer-item.drag-over-top::before {
    content: "Drop above";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1001;
    white-space: nowrap;
}

.layer-item.drag-over-bottom::after {
    content: "Drop below";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1001;
    white-space: nowrap;
}

.layer-drag-handle {
    cursor: grab;
    transition: color 0.2s ease;
}

.layer-drag-handle:hover {
    color: #10b981 !important;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

/* =======================
   SYMBOLOGY EDITOR THEME
   ======================= */

.symbology-editor-draggable {
    position: fixed;
    width: 400px;
    max-height: 80vh;
    background: rgba(18, 18, 18, 0.95) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 10000 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Avenir', sans-serif !important;
    overflow: hidden;
}

.symbology-editor-header {
    background: rgba(0, 255, 231, 0.1) !important;
    border-bottom: 1px solid rgba(0, 255, 231, 0.2) !important;
    padding: 16px 20px !important;
    cursor: move !important;
    user-select: none !important;
}

.symbology-editor-header h3 {
    color: var(--light-gray) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.symbology-editor-header .text-teal-400 {
    color: var(--neon-teal) !important;
}

.symbology-editor-header button {
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

.symbology-editor-header button:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

.symbology-editor-content {
    padding: 20px !important;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
    background: transparent !important;
}

.symbology-editor-content label {
    color: var(--light-gray) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.symbology-editor-content select,
.symbology-editor-content input[type="number"] {
    background: rgba(26, 26, 26, 0.8) !important;
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
    border-radius: 8px !important;
    color: var(--light-gray) !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    transition: all 0.2s ease !important;
}

.symbology-editor-content select:focus,
.symbology-editor-content input[type="number"]:focus {
    outline: none !important;
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
}

.symbology-editor-content input[type="color"] {
    background: transparent !important;
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.symbology-editor-content input[type="color"]:hover {
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
}

.opacity-slider {
    width: 100% !important;
    height: 6px !important;
    border-radius: 3px !important;
    background: rgba(26, 26, 26, 0.8) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
    cursor: pointer !important;
}

.opacity-slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
    cursor: pointer !important;
    border: none !important;
}

.opacity-value {
    color: var(--neon-teal) !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin-top: 8px !important;
    font-size: 14px !important;
}

.symbology-editor-content button {
    background: rgba(0, 255, 231, 0.1) !important;
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
    color: var(--light-gray) !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.symbology-editor-content button:hover {
    background: rgba(0, 255, 231, 0.2) !important;
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
    color: var(--neon-teal) !important;
}

.symbology-editor-content .bg-teal-600 {
    background: rgba(0, 255, 231, 0.2) !important;
    border-color: var(--neon-teal) !important;
}

.symbology-editor-content .bg-teal-600:hover {
    background: rgba(0, 255, 231, 0.3) !important;
    box-shadow: var(--neon-glow) !important;
}

.symbology-editor-content .bg-gray-600 {
    background: rgba(107, 114, 128, 0.2) !important;
    border-color: rgba(107, 114, 128, 0.3) !important;
}

.symbology-editor-content .bg-gray-600:hover {
    background: rgba(107, 114, 128, 0.3) !important;
    border-color: rgba(107, 114, 128, 0.5) !important;
}

.symbology-editor-content .bg-blue-600 {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

.symbology-editor-content .bg-blue-600:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4) !important;
}

#legendItems {
    background: rgba(26, 26, 26, 0.5) !important;
    border: 1px solid rgba(0, 255, 231, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px !important;
}

#legendItems .color-picker {
    border: 1px solid rgba(0, 255, 231, 0.3) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

#legendItems .color-picker:hover {
    border-color: var(--neon-teal) !important;
    box-shadow: var(--neon-glow-sm) !important;
}

.symbology-editor-content .text-amber-300 {
    color: #fbbf24 !important;
}

.symbology-editor-content .text-gray-300 {
    color: var(--light-gray) !important;
}

.symbology-editor-content .text-gray-400 {
    color: #9ca3af !important;
}

.symbology-editor-content .border-gray-600 {
    border-color: rgba(0, 255, 231, 0.2) !important;
}

/* =======================
   LAYER VISIBILITY ICONS
   ======================= */

.visibility-btn {
    transition: all 0.2s ease !important;
    border-radius: 4px !important;
}

.visibility-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.1) !important;
}

.visibility-btn i.fa-eye {
    color: var(--neon-teal) !important;
    filter: drop-shadow(0 0 4px rgba(0, 255, 231, 0.4));
}

.visibility-btn:hover i.fa-eye {
    color: var(--neon-teal) !important;
    filter: drop-shadow(0 0 8px rgba(0, 255, 231, 0.6));
}

.visibility-btn i.fa-eye-slash {
    color: #6b7280 !important;
    opacity: 0.7;
}

.visibility-btn:hover i.fa-eye-slash {
    color: #9ca3af !important;
    opacity: 1;
}

/* =======================
   LEGEND TOGGLE STYLES
   ======================= */

.legend-item-hidden {
    opacity: 0.5 !important;
    filter: grayscale(50%);
}

.legend-item-hidden .legend-color-toggle {
    opacity: 0.3 !important;
}

.legend-color-toggle:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 0 8px rgba(0, 255, 231, 0.3) !important;
}

.toggle-eye {
    transition: all 0.2s ease !important;
}

.toggle-eye:hover {
    transform: scale(1.2) !important;
    text-shadow: 0 0 4px currentColor !important;
}

.legend-categories {
    max-height: 300px;
    overflow-y: auto;
}

.legend-categories::-webkit-scrollbar {
    width: 4px;
}

.legend-categories::-webkit-scrollbar-track {
    background: rgba(75, 85, 99, 0.2);
    border-radius: 2px;
}

.legend-categories::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 231, 0.5);
    border-radius: 2px;
}

.legend-categories::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 231, 0.7);
}


/* =======================
   QGIS-STYLE PRINT COMPOSER EXTENSIONS
   ======================= */

/* Layout Options */
.layout-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.control-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--neon-teal);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.control-checkbox:checked {
    background: var(--neon-teal);
    box-shadow: var(--neon-glow-sm);
}

.control-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: var(--pure-black);
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    color: var(--light-gray);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.checkbox-label:hover {
    color: var(--neon-teal);
}

/* Export Format Selector */
#exportFormat {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid var(--neon-teal);
    color: var(--light-gray);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#exportFormat:focus {
    outline: none;
    box-shadow: var(--neon-glow-sm);
    border-color: var(--neon-teal);
}

#exportFormat option {
    background: var(--dark-gray);
    color: var(--light-gray);
    padding: 8px;
}

/* Title Input */
#layoutTitle {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid var(--neon-teal);
    color: var(--light-gray);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

#layoutTitle:focus {
    outline: none;
    box-shadow: var(--neon-glow-sm);
    border-color: var(--neon-teal);
}

#layoutTitle::placeholder {
    color: rgba(224, 224, 224, 0.5);
}
