/* === FONT LOADING OPTIMIZATION === */
/* Minimize font loading flash by using font-display and fallback matching */
@font-face {
    font-family: 'Barlow Semi Condensed Fallback';
    src: local('Arial'), local('Helvetica'), local('system-ui');
    font-display: block;
    ascent-override: 105%;
    descent-override: 25%;
    line-gap-override: 0%;
    size-adjust: 95%;
}

/* Font loading states to minimize flash */
.fonts-loading {
    visibility: hidden;
}

.fonts-loaded {
    visibility: visible;
}

/* Fallback for when fonts fail to load */
.fonts-failed {
    font-family: 'Barlow Semi Condensed Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:root {
    /* === BRAND COLORS (consistent across themes) === */
    --primary-dark: #03456d;
    --primary-bright: #00a6cc;
    --accent-orange: #f4611e;
    
    /* === LIGHT THEME (default) === */
    /* Background Colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: rgba(240, 240, 240, 0.95);
    --bg-panel: rgba(248, 248, 248, 0.9);
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --bg-elevated-hover: rgba(245, 245, 245, 0.9);
    --bg-modal: rgba(255, 255, 255, 0.98);
    --bg-input: rgba(255, 255, 255, 0.9);
    --bg-section: rgba(250, 250, 250, 0.92);
    --bg-header: rgba(235, 235, 235, 0.98);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(0, 0, 0, 0.1);
    --bg-overlay: rgba(255, 255, 255, 0.8);
    
    /* Toggle switch off state - lighter for better visibility in light theme */
    --toggle-off-bg: rgba(200, 200, 200, 0.98);
    
    /* Text Colors */
    --text-primary: #2c2c2c;
    --text-secondary: #444;
    --text-muted: #666;
    --text-inverse: #f3f3f3;
    --text-placeholder: rgba(0, 0, 0, 0.4);
    --text-accent: var(--primary-dark);
    
    /* Border Colors */
    --border-subtle: rgba(0, 0, 0, 0.15);
    --border-strong: rgba(0, 0, 0, 0.3);
    --border-input: #ddd;
    --border-focus: var(--primary-dark);
    
    /* Status Colors */
    --status-error: #ff4d4d;
    --status-error-bg: rgba(255, 0, 0, 0.3);
    --status-error-bg-hover: rgba(255, 0, 0, 0.5);
    --status-delete: #ff6b6b;
    --status-delete-bg: rgba(220, 53, 69, 0.2);
    --status-delete-bg-hover: rgba(220, 53, 69, 0.4);
    
    /* Scrollbar Colors */
    --scrollbar-track: #e0e0e0;
    --scrollbar-thumb: #bbb;
    
    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.18);
    --shadow-strong: rgba(0, 0, 0, 0.25);
    --shadow-focus: 0 0 8px #fff;
    
    /* Counter Colors */
    --text-on-counter: rgba(255, 255, 255, 0.9);
    --bg-counter: rgba(30, 30, 30, 0.85);
    --shadow-counter-inset: rgba(0, 0, 0, 0.45);
    --border-counter-inner: rgba(255, 255, 255, 0.04);
    
    /* Legacy support */
    --light-bg: #eceffi;
    --panel-bg: var(--bg-panel);
}

/* ================================================================ */
/* THEME TOGGLE BUTTON STYLES */
/* ================================================================ */

.theme-toggle-btn {
    background: var(--bg-elevated, rgba(45, 45, 45, 0.6));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 12px;
  cursor: pointer;
    transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
    width: 100%;
    font-size: 1.2em;
    color: var(--text-muted, #aaa);
    position: relative;
    overflow: hidden;
    outline: none;
}

.theme-toggle-btn:hover {
    background: var(--bg-elevated-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

.theme-toggle-btn.light-theme {
    background: var(--primary-bright);
    color: var(--primary-dark);
    border-color: var(--primary-bright);
}

.theme-toggle-btn.light-theme:hover {
    background: var(--primary-dark);
    color: var(--text-primary);
}

.theme-icon-light,
.theme-icon-dark {
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.theme-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ================================================================ */
/* BASIC BUTTON STYLES */
/* ================================================================ */

.basicbutton {
    padding: 10px 20px;
    background: var(--primary-dark) !important; /* Primary dark - consistent across themes */
    color: #fff; /* White text - consistent across themes */
    border: none;
    border-radius: 6px;
    font-weight: normal;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.basicbutton i {
    color: #fff; /* White icons - consistent across themes */
    transition: color 0.2s ease;
}

.basicbutton:hover,
.basicbutton:active {
    background: var(--primary-bright) !important; /* Primary bright - consistent across themes */
    color: #111111; /* Dark text on bright background */
}

.basicbutton:hover i,
.basicbutton:active i {
    color: #111111; /* Dark icons on bright background */
}

/* ================================================================ */
/* CANCEL BUTTON STYLES */
/* ================================================================ */

.cancelbutton {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cancelbutton:hover {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.cancelbutton:active {
    background: var(--bg-elevated-hover);
    transform: translateY(1px);
}

/* Pagination-specific styling - no background for non-selected buttons */
.pagination-button {
    background: none !important;
    color: var(--text-primary) !important;
}

.pagination-button:hover,
.pagination-button:active {
    background: none !important;
    color: var(--primary-bright) !important;
}

.pagination-button:hover i,
.pagination-button:active i {
    color: var(--primary-bright) !important;
}

.pagination-button.selected {
    background: var(--primary-dark) !important;
    color: var(--text-on-primary) !important;
}

.pagination-button.selected:hover,
.pagination-button.selected:active {
    background: var(--primary-bright) !important;
    color: var(--text-on-primary) !important;
}

.pagination-button.selected i {
    color: var(--text-on-primary) !important;
}

.pagination-button.selected:hover i,
.pagination-button.selected:active i {
    color: #111111 !important;
}

.basicbutton.bold {
    font-weight: bold;
}

.theme-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.theme-section .sidebar-content {
    padding: 16px 18px;
}

/* === DARK THEME === */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: rgba(24, 25, 28, 0.95);
    --bg-panel: rgba(28, 28, 28, 0.8);
    --bg-elevated: rgba(45, 45, 45, 0.6);
    --bg-elevated-hover: rgba(55, 55, 55, 0.8);
    --bg-modal: rgba(30, 32, 36, 0.98);
    --bg-input: rgba(25, 25, 25, 0.9);
    --bg-section: rgba(20, 20, 20, 0.92);
    --bg-header: rgba(40, 40, 40, 0.98);
    --bg-hover: rgba(255, 255, 255, 0.1);
    --bg-active: rgba(255, 255, 255, 0.15);
    --bg-overlay: rgba(0, 0, 0, 0.7);
    
    /* Toggle switch off state - darker for better visibility in dark theme */
    --toggle-off-bg: rgba(60, 60, 60, 0.98);
    
    /* Text Colors */
    --text-primary: #fff;
    --text-secondary: #f3f3f3;
    --text-muted: #aaa;
    --text-inverse: #111;
    --text-placeholder: rgba(255, 255, 255, 0.5);
    --text-accent: var(--primary-bright);
    
    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.3);
    --border-input: #444;
    --border-focus: #759dc0;
    
    /* Status Colors */
    --status-error: #ff4d4d;
    --status-error-bg: rgba(255, 0, 0, 0.3);
    --status-error-bg-hover: rgba(255, 0, 0, 0.5);
    --status-delete: #ff6b6b;
    --status-delete-bg: rgba(220, 53, 69, 0.2);
    --status-delete-bg-hover: rgba(220, 53, 69, 0.4);
    
    /* Scrollbar Colors */
    --scrollbar-track: #232323;
    --scrollbar-thumb: #444;
    
    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 8px var(--primary-dark);
    
    /* Counter Colors */
    --text-on-counter: var(--primary-dark);
    --bg-counter: rgba(245, 245, 245, 0.9);
    --shadow-counter-inset: rgba(0, 0, 0, 0.08);
    --border-counter-inner: rgba(0, 0, 0, 0.1);
    
    /* Light theme body background */
    background-color: var(--bg-primary);
}

/* Dark Theme Text Color Overrides - Force primary-bright for specific elements */
[data-theme="dark"] .project-name,
[data-theme="dark"] .view-text,
[data-theme="dark"] .model-name,
[data-theme="dark"] .model-text,
[data-theme="dark"] .tag-text,
[data-theme="dark"] .markup-text,
[data-theme="dark"] .gis-data-item span,
[data-theme="dark"] .preset-name[data-preset-id="default"],
[data-theme="dark"] #customInfoBoxHeader,
[data-theme="dark"] .base-layer-section-header,
[data-theme="dark"] .base-layer-title,
[data-theme="dark"] .ai-guidance-label {
    color: var(--primary-bright) !important;
}

[data-theme="dark"] .ai-gallery-reminder-text {
    color: var(--primary-bright) !important;
}

[data-theme="dark"] .map-loading-message {
    color: var(--primary-bright) !important;
}

[data-theme="dark"] .high-res-progress-text {
    color: var(--primary-bright) !important;
}

/* ================================================================ */
/* UNIFIED TEXT CLASSES FOR CONSISTENT THEMING */
/* ================================================================ */

/* Base text classes - use these for consistent theming */
.text-accent {
    color: var(--text-accent);
}

.text-accent-bold {
    color: var(--text-accent);
    font-weight: 600;
}

.text-header-main {
    color: var(--text-accent);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.text-header-section {
    color: var(--text-accent);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
}

.text-header-collapsible {
    color: var(--text-accent);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    display: block;
    cursor: pointer;
}

.text-header-collapsible-large {
    color: var(--text-accent);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: left;
    display: block;
    cursor: pointer;
}

/* Settings specific classes built on base text classes */
.settings-section-label {
    font-size: 15px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 6px;
    color: var(--text-accent);
    text-transform: uppercase;
}

.settings-account-label {
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-accent);
    font-weight: 600;
}

.settings-architectural-header {
    margin: 16px 0 8px 0;
    font-size: 16px;
    color: var(--text-accent);
    font-weight: 600;
    text-transform: uppercase;
}

.settings-thank-you-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-accent);
}

.settings-discount-text {
    color: var(--text-accent);
    margin: 8px 0 4px 0;
}

/* ================================================================ */
/* LIGHT THEME OVERRIDES - All accent text becomes primary-dark */
/* ================================================================ */

[data-theme="dark"] .text-accent,
[data-theme="dark"] .text-accent-bold,
[data-theme="dark"] .text-header-main,
[data-theme="dark"] .text-header-section,
[data-theme="dark"] .text-header-collapsible,
[data-theme="dark"] .text-header-collapsible-large,
[data-theme="dark"] .settings-section-label,
[data-theme="dark"] .settings-account-label,
[data-theme="dark"] .settings-architectural-header,
[data-theme="dark"] .settings-thank-you-text,
[data-theme="dark"] .settings-discount-text {
    color: var(--primary-bright) !important;
}

/* ================================================================ */
/* LIGHT THEME SIDEBAR HEADER OVERRIDES */
/* ================================================================ */

/* All sidebar headers in dark theme */
[data-theme="dark"] .sidebar-header > span,
[data-theme="dark"] #settingsSidebar .sidebar-header > span,
[data-theme="dark"] .sidebar-title {
    color: var(--primary-bright) !important;
}

/* Dark Theme Hover States - Keep primary-bright for all text on hover */
[data-theme="dark"] .sidebar-header:hover > span,
[data-theme="dark"] #settingsSidebar .sidebar-header:hover > span,
[data-theme="dark"] .project-item:hover .project-name,
[data-theme="dark"] .view-item:hover .view-text,
[data-theme="dark"] .model-item:hover .model-text,
[data-theme="dark"] .tag-item:hover .tag-text,
[data-theme="dark"] .markup-item:hover .markup-text,
[data-theme="dark"] .gis-data-item:hover span {
    color: var(--primary-bright) !important;
}

/* Dark Theme Button/Icon Hover States - Allow primary-bright for interactive elements */
[data-theme="dark"] #settingsSidebarCogBtn:hover .fa-cog,
[data-theme="dark"] #aiLibraryModalBtn:hover,
[data-theme="dark"] #sidebarToggle.sidebar-collapse-btn:hover,
[data-theme="dark"] #sidebarToggle.sidebar-collapse-btn:hover *,
[data-theme="dark"] #settingsSidebarToggle.sidebar-collapse-btn.right:hover,
[data-theme="dark"] .cesium-infoBox-fa-close:hover,
[data-theme="dark"] .pagination-button:hover,
[data-theme="dark"] .pagination-button:active,
[data-theme="dark"] .pagination-button:hover i,
[data-theme="dark"] .pagination-button:active i {
    color: var(--primary-bright) !important;
}

/* Dark Theme AI Library Modal Button - specific colors */
[data-theme="dark"] #aiLibraryModalBtn {
    color: var(--primary-bright) !important;
}

[data-theme="dark"] #aiLibraryModalBtn:hover {
    color: var(--primary-dark) !important;
}

/* Global visibility toggle button style for GIS data items - see unified styles later in file */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* cursor: url('/images/cursor.svg'), auto !important; */
}

body {
    position: relative;
    background: black;
    font-family: 'Barlow Semi Condensed', 'Barlow Semi Condensed Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

#cesiumContainer {
    position: absolute;
    top: 0;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    z-index: 1;
}

.cesium-viewer,
.cesium-viewer canvas,
.cesium-widget,
.cesium-widget canvas {
    width: 100% !important;
    height: 100vh !important;
}

.menu-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

.button-container {
    background: var(--panel-bg) !important;
    padding: 0px 24px;
    border-radius: 10px;
    gap: 10px;
    display: flex;
    flex-direction: row;
    width: 600px;
}

/* When panel is active, remove top border radius */
.menu-panel.panel-open .button-container {
    border-radius: 0 0 10px 10px !important;
}

.menu-btn {
    background: var(--primary-dark);
    color: var(--text-primary);
    border: none;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
}

.menu-btn:hover {
    background: var(--primary-bright);
    color: var(--primary-dark);
}

.menu-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.panel-container {
    position: absolute;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    overflow: hidden;
    z-index: 998;
    pointer-events: none;
}

.content-panel {
    position: relative;
    width: 100%;
    background: var(--bg-overlay);
    border-radius: 10px 10px 0 0;
    opacity: 0;
    transform: translate(0, 0);
    pointer-events: none;
    height: 0;
    padding: 0 15px;
    overflow: hidden;
    transition: transform 0.3s linear, opacity 0.3s linear, height 0.3s linear, padding 0.3s linear;
}

.content-panel.active {
    opacity: 1;
    transform: translate(0, 0);
    pointer-events: auto;
    height: auto;
    padding: 15px;
}

.content-panel.closing {
    transform: translate(0, 100%);
    opacity: 0;
}

/* Ensure panel is always displayed but invisible when not active */
.content-panel {
    display: block !important;
}

.panel-content {
    display: none;
}

.panel-content.active {
    display: block;
}

.views-container,
.models-container,
.projects-container,
.tileset-container {
    margin-bottom: 15px;
}

.views-header,
.models-header,
.projects-header,
.tileset-header,
.menu-content-header,
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.add-view-btn,
.add-model-btn,
.add-project-btn,
.add-tileset-btn {
    background: var(--primary-dark);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}

.add-view-btn:hover,
.add-model-btn:hover,
.add-project-btn:hover,
.add-tileset-btn:hover {
    background: var(--primary-bright);
    color: var(--primary-dark);
}

.views-list,
.models-list,
.projects-list,
.tileset-list,
.tags-list,
.gisData-list {
    /* Remove max-height and overflow-y so sections expand naturally */
    min-height: 32px;
}

/* --- UNIFIED LINE ITEM STYLES --- */
.project-item,
.view-item,
.model-item,
.tag-item,
.markup-item,
.gis-data-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px var(--shadow-medium);
    border: 1px solid transparent;
    min-height: 36px;
    box-sizing: border-box;
    height: auto !important;
    max-height: none !important;
}
.project-item:hover,
.view-item:hover,
.model-item:hover,
.tag-item:hover,
.markup-item:hover,
.gis-data-item:hover {
    background: var(--bg-elevated-hover);
    border-color: var(--border-subtle);
    box-shadow: 0 8px 16px var(--shadow-strong);
    transform: translateY(-2px);
}
.project-name,
.view-text,
.model-text,
.tag-text,
.markup-text,
.gis-data-item span {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95em;
    color: var(--text-accent);
    opacity: 0.7;
    margin-right: 12px;
    transition: color 0.15s, opacity 0.15s;
}

/* Tighter icons to match reduced item height */
.project-item .item-menu i,
.view-item .item-menu i,
.model-item .item-menu i,
.tag-item .item-menu i,
.markup-item .item-menu i,
.gis-data-item .item-menu i {
    font-size: 16px !important;
}
.project-input,
.view-input,
.model-input,
.tag-input,
.markup-input,
.gis-data-item input {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    width: 100%;
    font-size: 0.95em;
}

.view-item .view-buttons {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.view-item button,
.model-item button,
.tileset-item button {
    background: var(--primary-dark);
    color: var(--text-primary);
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.view-item button:hover,
.model-item button:hover,
.tileset-item button:hover {
    background: var(--primary-bright);
    color: var(--primary-dark);
}

.remove-btn {
    background: var(--status-error-bg);
    border: none;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
}

.remove-btn:hover {
    background: var(--status-error-bg-hover);
}

.menu-container,
.settings-container {
    margin-bottom: 15px;
}

.menu-content,
.settings-content {
    margin-top: 10px;
}

/* Logout button styles - now using basicbutton class */
/* Removed specific overrides to allow basicbutton styling */

.project-buttons {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-item:hover .project-buttons {
    opacity: 1;
}

.project-buttons button {
    background: var(--primary-dark);
    color: var(--text-primary);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.project-buttons button:hover {
    background: var(--primary-bright);
    color: var(--primary-dark);
}

.project-buttons .delete-project {
    background: var(--status-delete-bg);
    color: var(--status-delete);
}

.project-buttons .delete-project:hover {
    background: var(--status-delete-bg-hover);
    color: var(--text-primary);
}

.no-projects-message {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    font-size: 0.9em;
}

#settingsCogBtn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 20px;
    display: inline-block;
    margin-left: 8px;
    outline: none;
}
#settingsCogBtn:hover, #settingsCogBtn:focus {
    background: rgba(255,255,255,0.12);
}

#settingsPanel {
    background: var(--panel-bg) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    font-family: 'Barlow Semi Condensed', Arial, sans-serif !important;
    padding: 18px 24px !important;
    margin-right: 5px !important;
    margin-top: 10px !important;
    transform: scaleY(0.9);
    transform-origin: top right;
    border: none !important;
    max-width: 340px;
}

#settingsPanel.active {
    display: block;
}

#settingsPanel .content {
    margin-top: 20px;
}

/* Settings Button and Panel Styles */
#settingsButton.active {
    background-color: rgba(48, 51, 54, 0.8);
    border-color: var(--border-focus);
    box-shadow: 0 0 8px #fff;
}

.cesium-panel {
    position: absolute;
    right: 5px;
    background: rgba(38, 38, 38, 0.95);
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px;
    font-family: 'Barlow Semi Condensed', sans-serif;
    max-width: 300px;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.cesium-panel-content {
    padding: 10px;
}

.cesium-panel-content h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-title {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1px;
    font-family: 'Barlow Semi Condensed', 'Barlow Semi Condensed Fallback', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    text-align: left;
}

.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item-full {
    /*margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); */
    /* Rule kept for future styling */
    display: block;
}

.logout-button {
    width: 100%;
    background: var(--accent-orange, #ff6d00);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-button:hover {
    background: #ff8c1a;
    transform: translateY(-1px);
}

.logout-button:active {
    transform: translateY(1px);
}

.logout-button i {
    font-size: 16px;
}

.reset-environment-btn {
    width: 100%;
    background: var(--accent-orange, #ff6d00);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reset-environment-btn:hover {
    background: #ff8c1a;
}

.reset-environment-btn:active {
    background: #e65100;
}

.setting-item label {
    margin-right: 10px;
    font-size: 14px;
}

.setting-item select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    width: 180px;
    transition: border-color 0.2s, background-color 0.2s;
}

.setting-item select:focus {
    border-color: var(--border-focus);
    outline: none;
    background: var(--bg-elevated);
}

.setting-item select option {
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 4px 8px;
}

/* Themed dropdown class for consistent styling */
.themed-dropdown {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    outline: none !important;
    transition: border-color 0.2s, background-color 0.2s !important;
}

.themed-dropdown:focus {
    border-color: var(--border-focus) !important;
    background: var(--bg-elevated) !important;
}

.themed-dropdown option {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    padding: 4px 8px !important;
}

/* Settings sidebar specific dropdown overrides */
#settingsSidebar select {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
}

#settingsSidebar select:focus {
    border-color: var(--border-focus) !important;
    background: var(--bg-elevated) !important;
}

/* Themed input class for consistent styling */
.themed-input {
    background: var(--bg-input) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-input) !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
    outline: none !important;
    transition: border-color 0.2s, background-color 0.2s !important;
}

/* Range input styling to match primary bright theme */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(
        to right,
        var(--primary-bright) 0%,
        var(--primary-bright) var(--progress, 50%),
        var(--text-muted) var(--progress, 50%),
        var(--text-muted) 100%
    );
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

/* Range slider track for Firefox */
input[type="range"]::-moz-range-track {
    height: 6px;
    background: linear-gradient(
        to right,
        var(--primary-bright) 0%,
        var(--primary-bright) var(--progress, 50%),
        var(--text-muted) var(--progress, 50%),
        var(--text-muted) 100%
    );
    border-radius: 3px;
    border: none;
}

/* Range slider thumb for WebKit browsers */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-bright);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Range slider thumb for Firefox */
input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary-bright);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.themed-input:focus {
    border-color: var(--border-focus) !important;
    background: var(--bg-elevated) !important;
}

/* Date input specific styling */
input[type="date"].themed-input {
    cursor: pointer !important;
}

/* Date input color scheme for webkit browsers - Global for all date/time inputs */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(var(--calendar-picker-invert, 0)) brightness(var(--calendar-picker-brightness, 1)) !important;
    cursor: pointer !important;
    opacity: var(--calendar-picker-opacity, 1) !important;
    background: var(--calendar-picker-background, transparent) !important;
    border-radius: var(--calendar-picker-border-radius, 0) !important;
    padding: var(--calendar-picker-padding, 0) !important;
    border: var(--calendar-picker-border, none) !important;
    box-shadow: var(--calendar-picker-shadow, none) !important;
}

/* Light theme calendar picker styling */
[data-theme="dark"] {
    --calendar-picker-invert: 1;
    --calendar-picker-brightness: 0.02;
    --calendar-picker-opacity: 1;
    --calendar-picker-background: rgba(0, 0, 0, 0.4);
    --calendar-picker-border-radius: 4px;
    --calendar-picker-padding: 3px;
    --calendar-picker-border: 1px solid rgba(0, 0, 0, 0.5);
    --calendar-picker-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    
    /* Modal and overlay colors */
    --overlay-bg: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.35);
    --primary-bg-light: rgba(0, 204, 173, 0.1);
    
    /* Notification colors */
    --success-bg: rgba(76, 175, 80, 0.9);
    --error-bg: rgba(244, 67, 54, 0.9);
    --warning-bg: rgba(255, 152, 0, 0.9);
    --info-bg: rgba(33, 150, 243, 0.9);
    
    /* Shadow variations */
    --shadow-medium: rgba(0, 0, 0, 0.15);
    
    /* Text on primary color */
    --text-on-primary: #111;
    
    /* Info Box Colors for Light Theme */
    --infobox-bg: var(--panel-bg);
    --infobox-text: #111111;
    --infobox-header-bg: #888888;
    --infobox-header-text: #111111;
    --infobox-row-bg: #e0e0e0;
    --infobox-row-text: #111111;
    --infobox-close-btn: #666;
    --infobox-close-btn-hover: #111111;
    --infobox-shadow: rgba(0,0,0,0.15);
}

/* Dark theme calendar picker styling */
:root {
    --calendar-picker-brightness: 1.2;
    --calendar-picker-opacity: 1;
    --calendar-picker-background: rgba(255, 255, 255, 0.15);
    --calendar-picker-border-radius: 2px;
    --calendar-picker-padding: 1px;
    --calendar-picker-border: 1px solid rgba(255, 255, 255, 0.2);
    --calendar-picker-shadow: 0 1px 2px rgba(255, 255, 255, 0.05);
    
    /* Modal and overlay colors */
    --overlay-bg: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.35);
    --primary-bg-light: rgba(0, 204, 173, 0.1);
    
    /* Notification colors */
    --success-bg: rgba(76, 175, 80, 0.9);
    --error-bg: rgba(244, 67, 54, 0.9);
    --warning-bg: rgba(255, 152, 0, 0.9);
    --info-bg: rgba(33, 150, 243, 0.9);
    
    /* Shadow variations */
    --shadow-medium: rgba(0, 0, 0, 0.15);
    
    /* Text on primary color */
    --text-on-primary: #fff;
    
    /* Toggle switch button */
    --toggle-button: #ffffff;
    
    /* Info Box Colors (Dark Theme Default) */
    --infobox-bg: var(--panel-bg);
    --infobox-text: #fff;
    --infobox-header-bg: #222;
    --infobox-header-text: #fff;
    --infobox-row-bg: rgba(0, 0, 0, 0.7);
    --infobox-row-text: #e0e0e0;
    --infobox-close-btn: #bbb;
    --infobox-close-btn-hover: #fff;
    --infobox-shadow: rgba(0,0,0,0.25);
}

/* ===================================== */
/* Info Box Theming */
/* ===================================== */

/* Custom Info Box Card-Based Styling */
#customInfoBoxHeader {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #customInfoBoxHeader {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Close button styling */
#customInfoBoxClose {
    color: #bbb;
}

#customInfoBoxClose:hover {
    color: #fff;
    opacity: 1 !important;
}

.custom-infobox-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.custom-infobox-section-card {
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.custom-infobox-section-header {
    background: var(--infobox-header-bg);
    color: var(--infobox-header-text);
    padding: 4px 14px;
    font-weight: bold;
    font-size: 1.15em;
    letter-spacing: 0.5px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.custom-infobox-section-content {
    background: var(--infobox-row-bg);
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 1;
}

.custom-infobox-row {
    display: flex;
}

.custom-infobox-row-key {
    background: var(--infobox-row-bg);
    padding: 10px 16px;
    flex: 0 0 40%;
    text-align: left;
    font-weight: normal;
    color: var(--infobox-row-text);
    font-size: 1em;
}

.custom-infobox-row-value {
    background: var(--infobox-row-bg);
    padding: 10px 16px;
    flex: 1;
    color: var(--infobox-row-text);
    font-size: 1em;
    word-break: break-word;
}

/* Light Theme Overrides */
[data-theme="dark"] .custom-infobox-section-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .custom-infobox-section-header {
    background: #888888;
    color: #111111;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .custom-infobox-section-content {
    background: #e0e0e0;
}

[data-theme="dark"] .custom-infobox-row-key {
    background: #e0e0e0;
    color: #111111;
}

[data-theme="dark"] .custom-infobox-row-value {
    background: #e0e0e0;
    color: #111111;
}

/* Custom Info Box Scrollbar Styling */
#customInfoBoxContent {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

#customInfoBoxContent::-webkit-scrollbar {
    width: 8px;
}

#customInfoBoxContent::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

#customInfoBoxContent::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

#customInfoBoxContent::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Light theme scrollbar overrides */
[data-theme="dark"] #customInfoBoxContent {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

[data-theme="dark"] #customInfoBoxContent::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Light theme close button styling */
[data-theme="dark"] #customInfoBoxClose {
    color: #444 !important;
}

[data-theme="dark"] #customInfoBoxClose:hover {
    color: #111 !important;
}

/* Green info box (export info) */
.info-box-green {
    font-size: 12px !important;
    color: var(--text-primary) !important;
    padding: 12px !important;
    background: rgba(0, 204, 173, 0.15) !important;
    border-radius: 6px !important;
    border-left: 3px solid var(--primary-bright) !important;
}

/* Blue info box (Google Earth export info) */
.info-box-blue {
    font-size: 12px !important;
    color: var(--text-primary) !important;
    padding: 12px !important;
    background: rgba(26, 115, 232, 0.15) !important;
    border-radius: 6px !important;
    border-left: 3px solid #1a73e8 !important;
}

/* Light theme specific adjustments for info boxes */
[data-theme="dark"] .info-box-green {
    background: rgba(0, 204, 173, 0.1) !important;
}

[data-theme="dark"] .info-box-blue {
    background: rgba(26, 115, 232, 0.1) !important;
}

/* ===================================== */
/* Base Layer Section Container Theming */
/* ===================================== */

.base-layer-section-wrapper {
    grid-column: 1 / -1;
    background: var(--bg-section) !important;
    border: 2px solid var(--border-strong) !important;
    border-radius: 8px !important;
    margin: 12px 0 8px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s !important;
    overflow: hidden !important;
    box-shadow: 0 3px 12px var(--shadow-medium) !important;
}

.base-layer-section-header {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0 !important;
    padding: 12px 16px !important;
    background: var(--bg-header) !important;
    border-bottom: 3px solid var(--border-strong) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.base-layer-section-content {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    background: var(--bg-elevated) !important;
    border-radius: 0 !important;
    padding: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    justify-items: stretch !important;
    transition: background-color 0.2s !important;
    margin: 0 !important;
}

/* Special styling for preset content (User Presets section) */
.base-layer-section-content.preset-content {
    background: var(--bg-input) !important;
    min-height: 40px !important;
    padding: 12px !important;
}

/* Preset tile specific styling */
.preset-name {
    color: var(--text-secondary) !important;
    font-weight: normal !important;
}

.preset-name[data-preset-id="default"] {
    color: var(--primary-bright) !important;
    font-weight: 600 !important;
}

.preset-name[data-preset-id="add-preset"] {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

/* Section description text */
.base-layer-section-description {
    font-size: 12px !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    line-height: 1.4 !important;
    text-align: center !important;
    background: var(--bg-section) !important;
    border-top: 1px solid var(--border-subtle) !important;
}

/* Google 3D Detail Slider Container */
.google-detail-slider-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.google-detail-slider-container label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    text-align: center !important;
    margin-bottom: 4px !important;
}

.google-detail-slider-container .environment-slider {
    flex: 1 1 0% !important;
    min-width: 40px !important;
    max-width: calc(100% - 30px) !important;
}

/* Slider value and description text */
.google-detail-slider-container span {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    min-width: 20px !important;
    text-align: center !important;
}

.google-detail-slider-container div {
    font-size: 10px !important;
    color: var(--text-muted) !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

.setting-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-off-bg);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--toggle-button);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-orange, #ff6d00);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-orange, #ff6d00);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.menu-counter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2em;
    min-width: 2em;
    max-width: 2em;
    height: 2em;
    font-size: 0.92em;
    font-weight: bold;
    color: var(--text-on-counter);
    background: var(--bg-counter);
    border-radius: 50%;
    box-shadow: inset 2px 3px 10px 2px var(--shadow-counter-inset), inset 0 0 0 2px var(--border-counter-inner);
    letter-spacing: 0.5px;
    margin: 0 6px 0 0;
    vertical-align: middle;
    pointer-events: none;
    text-align: center;
    padding: 0;
}

.menu-btn-text {
    position: relative;
    z-index: 2;
    margin-top: 0;
}

.menu-panel.panel-open .button-container .menu-btn:first-child {
    border-top-left-radius: 0 !important;
}
.menu-panel.panel-open .button-container .menu-btn:last-child {
    border-top-right-radius: 0 !important;
}

#currentProjectName {
    position: fixed;
    top: 0px;
    left: 5px;
    transform: none;
    z-index: 2000;
    font-size: 2.1rem;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
    letter-spacing: 1px;
    pointer-events: none;
    user-select: none;
    margin: 0;
    padding: 0 5px;
    text-align: left;
}

.delete-project {
    background: rgba(220, 53, 69, 0.3) !important;
}
.delete-project:hover {
    background: rgba(220, 53, 69, 0.5) !important;
}

.tag-buttons {
    display: flex;
    gap: 5px;
}
.tag-item button {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.tag-item button:hover {
    background: rgba(0, 0, 0, 0.5);
}
.tag-name {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow: visible;
    max-width: 400px;
    flex: 1 1 0;
}
.tag-text {
    display: block;
    font-size: 0.95em;
    color: var(--text-accent);
    opacity: 0.7;
    margin-right: 12px;
    transition: color 0.15s, opacity 0.15s;
    white-space: normal;
    word-break: break-word;
    max-width: 400px;
    overflow-wrap: break-word;
}
.tag-item .delete-tag {
    background: rgba(220, 53, 69, 0.3) !important;
}
.tag-item .delete-tag:hover {
    background: rgba(220, 53, 69, 0.5) !important;
}

.cesium-infoBox {
    right: 10px !important;
    margin-right: 3px !important;
    border-radius: 12px !important;
    transform: scaleY(0.9);
    transform-origin: top right;
    box-shadow: none !important;
    background: var(--panel-bg) !important;
    height: 80vh !important;
    max-height: 80vh !important;
    overflow: auto !important;
}

.cesium-infoBox-description {
    height: 100% !important;
}

.cesium-infoBox-description table tr:first-child th,
.cesium-infoBox-description table tr:first-child td {
    padding-top: 20px !important;
}
.cesium-infoBox-description table th, .cesium-infoBox-description table td {
    padding-top: 8px !important;
}

.cesium-infoBox-title, .cesium-infoBox-header {
    border-top-right-radius: 12px !important;
    min-height: 28px !important;
    font-size: 1.3em !important;
    line-height: 1.3em !important;
    padding: 12px 18px 10px 18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.cesium-infoBox-title {
    font-weight: 600 !important;
    flex: 1 1 auto;
    text-align: center;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    pointer-events: none;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}
.cesium-infoBox-camera, .cesium-infoBox-camera svg, .cesium-infoBox-camera svg path {
    width: 50px !important;
    height: 32px !important;
    font-size: 1.3em !important;
    min-width: 50px !important;
    min-height: 32px !important;
    vertical-align: middle;
    margin-left: 0px;
    position: relative;
    pointer-events: auto;
    color: #bbb;
    fill: #bbb;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    filter: none !important;
    transition: color 0.15s, fill 0.15s;
}
.cesium-infoBox-camera:hover, .cesium-infoBox-camera:focus,
.cesium-infoBox-camera svg:hover, .cesium-infoBox-camera svg:focus,
.cesium-infoBox-camera svg path:hover, .cesium-infoBox-camera svg path:focus {
    color: #fff !important;
    fill: #fff !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    filter: none !important;
}
.cesium-infoBox-fa-close {
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 1.3em;
    color: #bbb;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.85;
    transition: color 0.15s, opacity 0.15s;
}
.cesium-infoBox-fa-close:hover, .cesium-infoBox-fa-close:focus {
    color: #fff !important;
    opacity: 1;
    background: none !important;
    border: none !important;
}

#transform-mode-controls {
    background: var(--panel-bg) !important;
}

/* Sidebar layout for left column navigation */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 17vw !important;
    min-width: 272px !important;
    max-width: 408px !important;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    box-shadow: 2px 0 16px rgba(0,0,0,0.25);
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%); /* Start collapsed */
}

#sidebar.expanded {
    transform: translateX(0);
}

body #sidebarToggle.sidebar-collapse-btn {
    position: fixed;
    top: 50%;
    left: 50px;
    transform: translate(-100%, -50%);
    width: 72px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1em;
    padding: 28px 0 28px 0;
    background: var(--bg-secondary);
    border: none;
    border-radius: 0 6px 6px 0;
    color: var(--primary-dark);
    cursor: pointer;
    box-shadow: 2px 0 8px -2px rgba(0,0,0,0.2);
    z-index: 3000;
    transition: left 0.3s ease-in-out, background 0.3s, color 0.3s;
}

@media (min-width: 1920px) {
    #sidebarToggle.sidebar-collapse-btn { left: 408px; }
}
@media (max-width: 1280px) {
    #sidebarToggle.sidebar-collapse-btn { left: 272px; }
}

body #sidebar.expanded ~ #sidebarToggle.sidebar-collapse-btn {
    left: calc(max(min(17vw, 408px), 272px) + 50px);
    transition: left 0.3s ease-in-out;
}

/* Mobile-specific toggle button positioning */
@media (max-width: 600px) {
    body #sidebar.expanded ~ #sidebarToggle.sidebar-collapse-btn {
        left: calc(100vw - 72px + 50px) !important;
    }
}

body #sidebar.collapsed ~ #sidebarToggle.sidebar-collapse-btn {
    left: 0;
}

body #sidebar.expanded {
    transform: translateX(0);
}

body #sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.sidebar-collapse-btn i {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.sidebar-section {
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--bg-section);
    /* overflow: hidden; */
    box-shadow: 0 2px 8px var(--shadow-medium);
    transition: margin-bottom 0.3s ease-in-out;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    user-select: none;
    transition: background 0.15s;
    gap: 10px;
    min-height: 56px;
    height: 56px;
}
.sidebar-header:hover {
    background: var(--bg-elevated-hover);
}
/* ================================================================ */
/* SIDEBAR HEADER UNIFIED STYLING */
/* ================================================================ */

.sidebar-header > span {
    flex: 1 1 auto;
    text-align: left;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-accent);
    opacity: 1;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}

.sidebar-header:hover > span {
    color: var(--text-accent);
    opacity: 1;
}

/* Settings sidebar headers - same styling as main sidebar */
#settingsSidebar .sidebar-header > span {
    color: var(--text-accent);
    opacity: 1;
    font-weight: 600;
}

#settingsSidebar .sidebar-header:hover > span {
    color: var(--text-accent);
    opacity: 1;
    font-weight: 600;
}
.sidebar-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    gap: 0;
}
.sidebar-header .add-view-btn,
.sidebar-header .add-model-btn,
.sidebar-header .add-project-btn,
.sidebar-header .add-tag-btn,
.sidebar-header .add-tileset-btn {
    margin-right: 0;
    margin-left: 0;
    font-size: 1.1em;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    padding: 0 8px;
}
.sidebar-header .add-view-btn:hover,
.sidebar-header .add-model-btn:hover,
.sidebar-header .add-project-btn:hover,
.sidebar-header .add-tag-btn:hover,
.sidebar-header .add-tileset-btn:hover {
    color: var(--text-primary);
}
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1em;
    margin-left: 0;
    margin-right: 0;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sidebar-toggle:hover {
    color: var(--text-primary);
}
.sidebar-toggle .fa-chevron-down {
    transition: transform 0.3s ease-in-out;
}
.sidebar-section.collapsed .sidebar-toggle .fa-chevron-down {
    transform: rotate(-90deg);
}
.sidebar-content {
    /* Remove max-height and overflow-y so sections expand naturally */
    padding: 10px 18px 16px 18px;
    transition: all 0.3s ease-in-out;
    background: none;
}
.sidebar-section.collapsed .sidebar-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}
/* Custom scrollbar for dark theme */
#sidebar, .sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
#sidebar::-webkit-scrollbar, .sidebar-content::-webkit-scrollbar {
    width: 8px;
    background: var(--scrollbar-track);
}
#sidebar::-webkit-scrollbar-thumb, .sidebar-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}
/* Remove old bottom menu styles if needed */
.menu-panel, .button-container, .content-panel, .panel-container {
    display: none !important;
}

#currentProjectName {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    position: static;
    top: auto;
    left: auto;
    transform: none;
    z-index: auto;
    text-align: left;
    pointer-events: auto;
    user-select: auto;
}

/* Remove any other width adjustments for Cesium container */
.cesium-viewer {
    width: 100% !important;
    height: 100vh !important;
}

.cesium-viewer canvas {
    width: 100% !important;
    height: 100vh !important;
}

#cesiumContainer.sidebar-collapsed {
    /* Remove this class entirely as we don't need it anymore */
    display: none;
}

.model-buttons,
.view-buttons,
.project-buttons,
.gis-data-item .model-buttons {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

/* Force .model-item to match unified line item style */
.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px;
    margin-bottom: 6px;
    background: var(--bg-elevated) !important;
    border-radius: 8px !important;
    color: #fff !important;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px var(--shadow-medium) !important;
    border: 1px solid transparent !important;
    min-height: 36px;
    box-sizing: border-box;
}
.model-item:hover {
    background: var(--bg-elevated-hover) !important;
    border-color: var(--border-subtle) !important;
    box-shadow: 0 8px 16px var(--shadow-strong) !important;
    transform: translateY(-2px) !important;
}

/* Match .model-name and .model-text to .project-name and .view-text */
.model-name,
.model-text {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
    font-size: 0.95em;
    color: var(--text-accent);
    opacity: 0.7;
    display: inline-block;
    vertical-align: middle;
}

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

/* Unified .menu-toggle (three-dot menu) style for all line items */
.menu-toggle {
  background: none !important;
  border: none;
  color: var(--text-muted) !important;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 50%;
  transition: color 0.2s;
  z-index: 2;
}
.menu-toggle:focus,
.menu-toggle.active,
.menu-toggle:hover {
  background: none !important;
  color: var(--text-primary) !important;
}

/* Visibility toggle button style for GIS data items */
.toggle-visibility {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff !important;
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  margin-right: 4px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-visibility:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff !important;
}
.toggle-visibility:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Shared menu styles for all list items */
.item-menu {
    flex-shrink: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    position: relative;
    justify-content: flex-end;
    height: 100%;
    min-width: 48px;
}
.item-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
    background: var(--bg-modal);
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow-medium);
    z-index: 1;
    gap: 6px;
    border: none;
}
.item-actions button,
.item-actions input[type="color"],
.item-actions .icon-tag,
.item-actions .delete-project,
.item-actions .delete-model,
.item-actions .delete-tag,
.item-actions .ai-enhance-view,
.item-actions .ai-enhance-view i {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted) !important;
    background: transparent !important;
    transition: color 0.15s;
}
.item-actions button:hover,
.item-actions input[type="color"]:hover,
.item-actions .icon-tag:hover,
.item-actions .delete-project:hover,
.item-actions .delete-model:hover,
.item-actions .delete-tag:hover,
.item-actions .ai-enhance-view:hover,
.item-actions .ai-enhance-view:hover i {
    color: var(--text-primary) !important;
    background: transparent !important;
}
.item-menu.open .item-actions {
    transform: translateY(-50%) scaleX(1);
    opacity: 1;
    pointer-events: auto;
}
.item-actions button, .item-actions input[type="color"], .item-actions .icon-tag {
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    font-size: 20px;
    padding: 0 8px;
    margin: 0 2px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-actions button:hover, .item-actions input[type="color"]:hover, .item-actions .icon-tag:hover {
    background: var(--bg-elevated-hover);
    color: var(--text-primary);
}
/* Remove tint for delete/trash buttons in menu popups */
.item-actions .delete-project,
.item-actions .delete-model,
.item-actions .delete-tag,
.item-actions .delete-project i,
.item-actions .delete-model i,
.item-actions .delete-tag i {
    color: var(--text-muted) !important;
    background: transparent !important;
    filter: none !important;
    transition: color 0.15s;
}
.item-actions .delete-project:hover,
.item-actions .delete-model:hover,
.item-actions .delete-tag:hover,
.item-actions .delete-project:hover i,
.item-actions .delete-model:hover i,
.item-actions .delete-tag:hover i {
    color: var(--text-primary) !important;
    background: transparent !important;
    filter: none !important;
}


.item-actions input[type="color"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    padding: 0px !important;
    margin: 10px !important;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-actions .icon-tag {
    vertical-align: middle;
    align-self: center;
    height: 40px;
    height: 40px;
    min-width: 50px;
    max-width: 50px;
    padding: 0;
    margin: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body, .content-panel, .panel-container {
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

/* Apply safe area padding to sidebar only for horizontal insets, not top */
#sidebar {
  padding-top: 0px;
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

#sidebarToggle.sidebar-collapse-btn {
    width: 72px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1.1em;
    padding: 28px 0 28px 0;
}
#sidebarCurrentProjectName.sidebar-project-vertical {
    color: var(--primary-dark) !important;
    opacity: 1;
    letter-spacing: 0.05em;
    display: block;
    text-align: center;
    font-size: 1.05em;
    font-weight: bold;
    line-height: 1.1;
    margin-bottom: 2px;
    white-space: pre;
    user-select: none;
    text-transform: uppercase;
}
#sidebarToggle.sidebar-collapse-btn:hover #sidebarCurrentProjectName.sidebar-project-vertical {
    opacity: 1;
    color: var(--primary-bright) !important;
}

/* Ensure any other text/icons in left sidebar toggle also change color */
#sidebarToggle.sidebar-collapse-btn:hover,
#sidebarToggle.sidebar-collapse-btn:hover * {
    color: var(--primary-bright) !important;
}

/* Settings sidebar toggle hover effect */
body #settingsSidebarToggle.sidebar-collapse-btn.right:hover {
    color: var(--primary-bright) !important;
}

.project-item:hover .project-name,
.view-item:hover .view-text,
.model-item:hover .model-text,
.tag-item:hover .tag-text,
.gis-data-item:hover span {
    color: var(--text-accent);
    opacity: 1;
}

.view-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 36px;
    box-sizing: border-box;
    box-shadow: 0 4px 8px var(--shadow-medium);
}
.view-name {
    flex: 1 1 0;
    min-width: 0;
    max-width: 65%;
    display: flex;
    align-items: center;
}
.view-text {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1em;
    color: var(--text-accent);
    opacity: 0.7;
    margin-right: 12px;
    transition: color 0.15s, opacity 0.15s;
    display: inline-block;
    vertical-align: middle;
}

/* Right-side settings sidebar */
#settingsSidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 17vw;
    min-width: 272px;
    max-width: 408px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    box-shadow: -2px 0 16px rgba(0,0,0,0.25);
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%); /* Start collapsed */
}

#settingsSidebar.expanded {
    transform: translateX(0);
}

#settingsSidebar .sidebar-section {
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--bg-section);
    box-shadow: 0 2px 8px var(--shadow-medium);
    transition: margin-bottom 0.3s ease-in-out;
}

#settingsSidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    user-select: none;
    transition: background 0.15s;
    gap: 10px;
    min-height: 56px;
    height: 56px;
}

#settingsSidebar .sidebar-header:hover {
    background: var(--bg-elevated-hover);
}

#settingsSidebar .sidebar-content {
    padding: 10px 18px 16px 18px;
    transition: all 0.3s ease-in-out;
    background: none;
}

#settingsSidebar .sidebar-section.collapsed .sidebar-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Hide Cesium's default base layer picker dropdown */
.cesium-baseLayerPicker-dropDown, .cesium-baseLayerPicker-button {
    display: none !important;
}

/* Base Layer Grid Styles for Settings Sidebar */
.base-layer-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-align: left;
}
.base-layer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.base-layer-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-elevated);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 4px 8px 4px;
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 2px 8px var(--shadow-light);
    min-height: 110px;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.base-layer-tile:hover {
    background: var(--bg-elevated-hover);
    border-color: var(--border-strong);
    box-shadow: 0 4px 12px var(--shadow-medium);
}
.base-layer-tile.selected {
    border: 2px solid var(--text-link);
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

/* Preset tiles styling - inherit standard base-layer-tile behavior */
.preset-tile {
    /* Remove any custom styling to inherit base-layer-tile behavior */
}

/* Remove custom hover styling for preset tiles - let them use standard base-layer-tile:hover */

.preset-delete-btn:hover {
    background: rgba(255, 140, 0, 1) !important;
    opacity: 1 !important;
}

.preset-name:hover {
    background: var(--bg-hover);
}

.preset-name:focus {
    background: var(--bg-active);
    border: 1px solid var(--primary-bright);
}

.base-layer-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin-bottom: 4px;
    object-fit: cover;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.base-layer-name {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 2px;
    word-break: break-word;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding: 0 4px;
}

#sidebar, .sidebar-content, #settingsSidebar, #settingsSidebar .sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
#sidebar::-webkit-scrollbar, .sidebar-content::-webkit-scrollbar, #settingsSidebar::-webkit-scrollbar, #settingsSidebar .sidebar-content::-webkit-scrollbar {
    width: 8px;
    background: var(--scrollbar-track);
}
#sidebar::-webkit-scrollbar-thumb, .sidebar-content::-webkit-scrollbar-thumb, #settingsSidebar::-webkit-scrollbar-thumb, #settingsSidebar .sidebar-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}

.cesium-baseLayerPicker-button,
.cesium-viewer-toolbar .cesium-baseLayerPicker-dropDown {
    display: none !important;
}

/* Settings Sidebar - Larger labels and dropdowns */
#settingsSidebar .sidebar-section label,
#settingsSidebar .setting-item label,
#settingsSidebar select {
  font-size: 15px !important;
  font-weight: 600 !important;
}

.cesium-baseLayerPicker-dropDown, .cesium-baseLayerPicker-button {
    display: none !important;
}
.cesium-viewer-toolbar .cesium-baseLayerPicker-container {
    display: none !important;
}

/* --- Cesium: Hide base layer picker UI but keep functionality for sidebar --- */
.cesium-baseLayerPicker-dropDown,
.cesium-baseLayerPicker-button,
.cesium-viewer-toolbar .cesium-baseLayerPicker-container {
    display: none !important;
}

.cesium-baseLayerPicker-selected {
    display: none !important;
}

.cesium-toolbar-button .cesium-baseLayerPicker-selected,
.cesium-toolbar-button[title*="Bing Maps"],
.cesium-toolbar-button[data-bind*="toggleDropDown"] {
    display: none !important;
}

/* ================================================================ */
/* FONT FAMILY OVERRIDES - Ensure Barlow Semi Condensed everywhere */
/* ================================================================ */

/* Sidebar font overrides to ensure Barlow Semi Condensed is used */
#sidebar,
#sidebar *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
#settingsSidebar,
#settingsSidebar *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.sidebar-header,
.sidebar-header *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.sidebar-content,
.sidebar-content *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.sidebar-section,
.sidebar-section *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.view-item,
.view-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.project-item,
.project-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.model-item,
.model-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.tag-item,
.tag-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.gis-data-item,
.gis-data-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.markup-item,
.markup-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.setting-item,
.setting-item *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.settings-section-label,
.settings-account-label,
.settings-architectural-header,
.settings-thank-you-text,
.settings-discount-text,
.base-layer-title,
.base-layer-name,
.ai-gallery-reminder-text,
.gallery-modal-title,
.ai-modal-content-large,
.ai-modal-content-large *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.modal-content,
.modal-content *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.modal-body,
.modal-body *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.modal-title,
.modal-header,
.modal-footer,
.gallery-card,
.gallery-card *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.card,
.card *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.card-body,
.card-title,
.card-text,
.filename,
.file-name,
.ai-guidance-container,
.ai-guidance-container *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.ai-guidance-label {
    font-family: 'Barlow Semi Condensed', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}

/* Bootstrap overrides - ensure forms, buttons, inputs use Barlow Semi Condensed */
.btn:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.form-control:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.form-select:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.input-group-text:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
label:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
input:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
select:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
textarea:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
button:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]) {
    font-family: 'Barlow Semi Condensed', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}

/* Ensure Font Awesome icons maintain their proper font-family */
.fa,
.fas,
.far,
.fab,
.fal,
.fad,
.fat,
[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
}

/* Additional broad overrides for any remaining text elements */
p:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
span:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
div:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h1:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h2:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h3:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h4:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h5:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
h6:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.text:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.content:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.title:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]),
.name:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fat):not([class*="fa-"]) {
    font-family: 'Barlow Semi Condensed', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}

/* ================================================================ */
/* BRAND NAME STYLING - InContext3D with split colors */
/* ================================================================ */

/* Brand name component styling */
.brand-name {
    display: inline;
    font-weight: inherit;
}

.brand-name .incontext {
    color: var(--primary-dark) !important;
}

/* Pricing page specific override for InContext text */
.plan-card .brand-name .incontext {
    color: #fff !important;
}

/* Desktop features dropdown styling */
.features-dropdown-content {
    border: 1px solid var(--primary-bright) !important;
}

/* Desktop features dropdown hover effect */
.features-dropdown-content a:hover {
    background: var(--primary-dark) !important;
}

/* Ensure proper scrolling on mobile devices and desktop mobile simulation */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        scroll-behavior: smooth;
    }
}

.brand-name .three-d {
    color: var(--accent-orange) !important;
}

#settingsSidebarToggle.sidebar-collapse-btn.right {
    position: fixed;
    top: 50%;
    right: 50px;
    transform: translate(100%, -50%);
    width: 72px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 1.5em;
    padding: 28px 0 28px 0;
    background: var(--bg-secondary);
    border: none;
    border-radius: 6px 0 0 6px;
    color: var(--primary-dark);
    cursor: pointer;
    box-shadow: -2px 0 8px -2px rgba(0,0,0,0.2);
    z-index: 3000;
    transition: right 0.3s ease-in-out, background 0.3s, color 0.3s;
    outline: none !important;
}

#settingsSidebarToggle .cesium-geocoder-searchButton {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================================ */
/* UNIFIED SIDEBAR TOGGLE BUTTONS */
/* ================================================================ */

.sidebar-toggle-btn {
    background: none !important;
    border: none !important;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s;
    margin: 0;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus,
.sidebar-toggle-btn:active {
    color: var(--text-primary) !important;
    background: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Legacy class - redirect to new unified class */
.sidebar-icon-btn {
    background: none !important;
    border: none !important;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.2s;
    margin: 0;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon-btn:hover,
.sidebar-icon-btn:focus,
.sidebar-icon-btn:active {
    color: var(--text-primary) !important;
    background: none !important;
    outline: none !important;
    box-shadow: none !important;
}
#settingsSidebar.expanded ~ #settingsSidebarToggle.sidebar-collapse-btn.right {
    right: calc(max(min(17vw, 408px), 272px) + 50px);
    transition: right 0.3s ease-in-out;
}

/* Mobile-specific settings toggle button positioning */
@media (max-width: 600px) {
    #settingsSidebar.expanded ~ #settingsSidebarToggle.sidebar-collapse-btn.right {
        right: calc(100vw - 72px + 50px) !important;
    }
}

#settingsSidebar.collapsed ~ #settingsSidebarToggle.sidebar-collapse-btn.right {
    right: 0;
}
#settingsSidebarToggle .fa-search,
#settingsSidebarToggle .fa-cog {
    font-size: 1em;
}

.sidebar-geocoder-flyout {
    position: absolute;
    left: auto;
    right: 100%;
    top: 0;
    margin-right: 16px;
    z-index: 4000;
    background: rgba(30,30,30,0.98);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 8px 12px;
    display: none;
    transition: opacity 0.2s, transform 0.2s;
}
.sidebar-geocoder-flyout.open {
    display: block;
    opacity: 1;
    transform: translateX(-12px);
}

.cesium-geocoder {
    position: fixed !important;
    top: 50%;
    right: 90px;
    transform: translateY(-50%);
    z-index: 5000;
    background: rgba(30,30,30,0.98);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 8px 12px;
    display: none;
    transition: opacity 0.2s, transform 0.2s;
}
.cesium-geocoder.open {
    display: block;
}

.sidebar-flyout {
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 16px;
    z-index: 4000;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 16px 24px;
    display: none;
    min-width: 500px;
    min-height: 80px;
    color: var(--text-primary);
    font-size: 1.1em;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.sidebar-flyout.open {
    display: block;
}

#locationFlyout {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5000;
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 90vw;
    max-width: 500px;
    min-width: 280px;
    min-height: 80px;
    color: var(--text-primary);
    font-size: 1.1em;
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
#locationFlyout.open {
    display: flex;
}

.cesium-viewer-geocoderContainer .cesium-geocoder-searchButton {
    display: none !important;
}

.cesium-viewer-geocoderContainer form {
    display: flex;
    align-items: center;
    width: 100%;
}
.cesium-geocoder-input {
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--bg-input) !important;
    border: 1.5px solid var(--border-input) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    font-size: 0.85em !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border 0.18s, box-shadow 0.18s;
    padding-left: 12px !important;
}
.cesium-geocoder-input:focus {
    border: 1.5px solid #3a3b40 !important;
    box-shadow: none !important;
}
.cesium-geocoder-input::-webkit-search-cancel-button {
    appearance: none;
    height: 18px;
    width: 18px;
    background: url('data:image/svg+xml;utf8,<svg fill="%23bbb" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 8.586l4.95-4.95 1.414 1.414L11.414 10l4.95 4.95-1.414 1.414L10 11.414l-4.95 4.95-1.414-1.414L8.586 10l-4.95-4.95L5.05 3.636 10 8.586z"/></svg>') center/18px 18px no-repeat !important;
    background-color: transparent !important;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
}
.cesium-geocoder-input::-webkit-search-cancel-button:hover {
    background: url('data:image/svg+xml;utf8,<svg fill="%23fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 8.586l4.95-4.95 1.414 1.414L11.414 10l4.95 4.95-1.414 1.414L10 11.414l-4.95 4.95-1.414-1.414L8.586 10l-4.95-4.95L5.05 3.636 10 8.586z"/></svg>') center/18px 18px no-repeat !important;
}

#locationFlyout .cesium-viewer-geocoderContainer {
    width: 100%;
}
#locationFlyout .cesium-viewer-geocoderContainer form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    flex-wrap: wrap;
}

/* Responsive input field */
#locationFlyout .cesium-geocoder-input {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    #locationFlyout {
        width: 95vw;
        max-width: none;
        padding: 16px;
        font-size: 1em;
        top: 35%;
    }
    
    #locationFlyout .cesium-geocoder-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

@media (max-width: 480px) {
    #locationFlyout {
        width: 98vw;
        padding: 12px;
        border-radius: 8px;
        top: 30%;
    }
    
    #locationFlyout .cesium-geocoder-input {
        font-size: 16px;
        padding: 10px;
    }
}

.cesium-geocoder-input::placeholder,
.cesium-geocoder-input::-webkit-input-placeholder,
.cesium-geocoder-input:-ms-input-placeholder {
    font-size: .85em !important;
    color: #bbb !important;
    opacity: 1 !important;
}

/* Search button flyout states - simplified */
#locationFlyout.open ~ #settingsSidebarToggle.sidebar-collapse-btn.right {
    border-top-left-radius: 0 !important;
}

#settingsSidebarToggle.flyout-open {
    border-top-left-radius: 0 !important;
}

#settingsSidebarToggle .cesium-viewer-fullscreenContainer {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto !important;
    margin: 12px 0 0 0 !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-fullscreenButton {
    background: none !important;
    border: none !important;
    color: #ccc !important;
    cursor: pointer;
    padding: 8px !important;
    border-radius: 50% !important;
    transition: color 0.2s, background 0.2s;
    margin: 0 !important;
    outline: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.1em !important;
    min-width: 30px;
    min-height: 30px;
    box-shadow: none !important;
}
#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-fullscreenButton:hover,
#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-fullscreenButton:focus {
    color: var(--text-primary) !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-svgPath-svg,
#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-svgPath-svg path,
#settingsSidebarToggle .cesium-viewer-fullscreenContainer .cesium-fullscreenButton i {
    fill: currentColor !important;
    color: inherit !important;
    font-size: 1.1em !important;
    width: 1em;
    height: 1em;
    display: block;
    margin: 0 auto;
}

#settingsSidebarFullscreenBtn,
#settingsSidebarFullscreenBtn:hover,
#settingsSidebarFullscreenBtn:focus,
#settingsSidebarFullscreenBtn:active,
#settingsSidebarCogBtn,
#settingsSidebarCogBtn:hover,
#settingsSidebarCogBtn:focus,
#settingsSidebarCogBtn:active {
    background: transparent !important;
    box-shadow: none !important;
}

.project-item.current {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-bright) 100%);
    color: var(--text-primary);
    border: 2px solid var(--primary-bright);
    box-shadow: 0 2px 8px rgba(0,255,170,0.12);
    opacity: 1;
}
.project-item.current .project-name {
    color: #eceff1;
}

/* Light theme selected project text - better contrast */
[data-theme="dark"] .project-item.current .project-name {
    color: var(--primary-bright) !important;
}

/* Drawing sliders now use the same .environment-slider class as settings sidebar */

.cesium-performanceDisplay {
    position: fixed !important;
    top: 12px !important;
    right: 18px !important;
    left: auto !important;
    z-index: 3001 !important;
    pointer-events: none;
}

.cesium-infoBox-fa-close {
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 1.3em;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.cesium-infoBox-fa-close:hover {
    opacity: 1;
    color: var(--primary-bright);
}

.cesium-infoBox-iframe {
    margin-top: 60px !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    overflow: auto !important;
}

/* Account section buttons in settings sidebar - now using basicbutton class */
/* These buttons now inherit from .basicbutton instead of needing overrides */

/* Export and Import buttons inherit normal font-weight from basicbutton class */

.toggle-tags-visibility-btn,
.toggle-models-visibility-btn,
.toggle-markups-visibility-btn,
.toggle-gisdata-visibility-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1em;
    margin-left: 0;
    margin-right: 0;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toggle-tags-visibility-btn:hover,
.toggle-models-visibility-btn:hover,
.toggle-markups-visibility-btn:hover,
.toggle-gisdata-visibility-btn:hover {
    color: var(--text-primary);
}

/* Responsive transform controls toolbar for mobile */
@media (max-width: 600px) {
  #transform-mode-controls {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    gap: 6px !important;
    padding: 8px 4px !important;
  }
  #transform-mode-controls button {
    padding: 6px 8px !important;
    font-size: 13px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    width: auto !important;
    height: 36px !important;
    flex: 0 0 auto !important;
  }
  #transform-mode-controls button span.button-label {
    display: none !important;
  }
  
  /* Responsive drawing3d markup toolbar for mobile - clean size swap */
  .drawing-toolbar,
  #drawing3d-toolbar {
    gap: 6px !important;
    padding: 8px 4px !important;
  }
  .drawing-toolbar button,
  .drawing-toolbar input[type="color"],
  #drawing3d-toolbar button,
  #drawing3d-toolbar input[type="color"] {
    font-size: 13px !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 auto !important;
  }
  .drawing-toolbar .drawing-tool-btn,
  .drawing-toolbar .undo-redo-btn {
    font-size: 13px !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 auto !important;
  }
  /* Text buttons get auto width but still compact */
  .drawing-toolbar #3d-cancel,
  .drawing-toolbar #3d-save {
    width: auto !important;
    min-width: 80px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    height: 36px !important;
  }
}

/* Shared modal content style for large AI modals */
.ai-modal-content-large {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-modal);
    border-radius: 18px;
    padding: 0 60px 36px 60px;
    max-width: 1200px;
    max-height: 96vh;
    overflow: hidden auto;
    box-shadow: 0 8px 32px var(--shadow-heavy);
    color: var(--text-primary);
    min-width: 340px;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-elevated);
    position: relative;
}

/* Shared preview image style for AI modals */
.ai-modal-preview-img {
    max-width: 100%;
    max-height: 600px;
    border: 1.5px solid var(--border-input);
    border-radius: 8px;
    background: var(--bg-secondary);
    margin-bottom: 2px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* AI Guidance container for both modals */
.ai-guidance-container {
  width: 100%;
  margin: 0;
  padding: 18px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--border-input);
  border-radius: 7px;
  background: var(--bg-elevated);
}

/* AI Guidance label/header for both modals */
.ai-guidance-label {
  font-size: 1.08em;
  font-weight: 600;
  color: var(--accent-orange);
  margin: 14px 0 6px 0;
  letter-spacing: 0.2px;
  opacity: 0.92;
  text-align: left;
  padding-left: 18px;
}

/* Modal header for AI modals */
.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-bottom: 15px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Settings cog button - special styling */
#settingsSidebarCogBtn {
    background: none !important;
    border: none !important;
    color: var(--primary-dark) !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.15s;
    margin: 0;
    outline: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#settingsSidebarCogBtn:hover {
    color: var(--primary-bright) !important;
    background: none !important;
    outline: none !important;
}

#settingsSidebarCogBtn:focus,
#settingsSidebarCogBtn:active {
    color: var(--primary-dark) !important;
    background: none !important;
    outline: none !important;
}

#aiLibraryModalBtn {
    color: var(--primary-dark, #00585b) !important;
    background: none !important;
    border: none !important;
    transition: color 0.15s;
}
#aiLibraryModalBtn:hover {
    color: var(--primary-bright) !important;
}

/* Unified Settings Sidebar Toggle Colors */
.setting-item .switch .slider {
    background-color: var(--toggle-off-bg);
    transition: .4s;
}
.setting-item .switch input:checked + .slider {
    background-color: var(--accent-orange, #ff6d00);
}
.setting-item .switch input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-orange, #ff6d00);
}
.setting-item .switch .slider:before {
    background-color: var(--toggle-button);
}

@media (max-width: 700px) {
  .ai-library-grid {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

/* Responsive and rounded customInfoBox */
#customInfoBox {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 5000;
  background: var(--panel-bg, #23242a);
  border-radius: 12px;
  border-top-left-radius: 12px; /* Ensures top left is rounded */
  box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 16px;
  padding: 0px;
  max-width: 525px;
  width: 100%;
  min-width: 0;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: 'Barlow Semi Condensed', Arial, sans-serif;
  font-size: 1.1em;
  overflow: hidden;
}

@media (max-width: 600px) {
  #customInfoBox {
    right: 0;
    left: 0;
    top: 0;
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 0 0 16px 16px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    font-size: 1em;
  }
  #customInfoBoxHeader {
    min-height: 48px;
    padding: 12px 8px;
  }
  #customInfoBoxContent {
    padding: 8px 4px 6px;
  }
  
  /* Mobile sidebar management - ensure only one sidebar is visible at a time */
  #sidebar.expanded {
    z-index: 2001 !important;
  }
  
  #settingsSidebar.expanded {
    z-index: 2001 !important;
  }
  
  /* Ensure sidebars take full width on mobile but account for toggle button width */
  #sidebar.expanded,
  #settingsSidebar.expanded {
    width: calc(100vw - 72px) !important;
    max-width: calc(100vw - 72px) !important;
    min-width: calc(100vw - 72px) !important;
  }
}



#customInfoBoxHeader {
  color: var(--primary-bright);
}

/* Custom scrollbar for general disclaimer modal */
#generalDisclaimerModalOverlay > div {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
#generalDisclaimerModalOverlay > div::-webkit-scrollbar {
  width: 8px;
  background: var(--scrollbar-track);
}
#generalDisclaimerModalOverlay > div::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

/* Center the gallery modal title and right-align the close button in the gallery modal only */
.ai-modal-header .gallery-modal-title {
  flex: 1;
  text-align: center;
}
.ai-modal-header .gallery-modal-close {
  margin-left: 18px;
}

#aiChatModal .ai-chat-area {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
#aiChatModal .ai-chat-area::-webkit-scrollbar {
  width: 8px;
  background: var(--scrollbar-track);
}
#aiChatModal .ai-chat-area::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

/* AI Chat send button now uses .basicbutton class - no custom styling needed */

.tooltip {
    z-index: 99999 !important;
    background-color: #23242a !important;
    color: #fff !important;
    pointer-events: none !important;
}

/* Ensure tooltips are properly positioned and don't interfere with interactions */
.tooltip .tooltip-inner {
    background-color: #000000 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    max-width: 300px !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

/* Custom styling for AI enhancement button tooltips */
.tooltip.ai-enhance-tooltip {
    max-width: none !important;
    width: var(--tooltip-width) !important;
    text-align: center !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.tooltip.ai-enhance-tooltip .tooltip-inner {
    max-width: 200px !important;
    width: auto !important;
    min-width: 0 !important;
    box-sizing: border-box;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: center !important;
    padding: 8px 12px !important;
    background-color: #000000 !important;
    color: #fff !important;
}

/* Style for action button tooltips */
.tooltip.action-tooltip {
    margin-bottom: 4px !important;
}

.tooltip .tooltip-arrow, 
.tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow::before,
.tooltip.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow::before {
    border-top-color: #000000 !important;
    border-bottom-color: #000000 !important;
}

button[data-bs-custom-class="ai-enhance-tooltip"] {
    box-sizing: border-box;
}

.btn-24 {
  width: 24px;
  height: 24px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ref-add-btn {
  background: var(--primary-bright);
  color: #222;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  margin-left: 8px;
}

.gis-data-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 6px;
    background: var(--bg-elevated);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    min-height: 36px;
    box-sizing: border-box;
    height: auto !important;
    max-height: none !important;
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.gis-data-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: auto !important;
    max-height: none !important;
}

.gis-data-name {
    font-size: 0.95em;
    color: var(--text-primary);
    opacity: 0.9;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: auto !important;
    max-height: none !important;
    min-height: 1.2em !important;
    line-height: 1.2 !important;
}

.gis-data-details {
    font-size: 0.8em;
    color: var(--text-muted);
    opacity: 0.7;
}

.gis-data-type {
    display: inline-block;
    background: var(--primary-dark, #00585b);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 500;
    margin-right: 6px;
}

.zoom-btn {
    background: var(--primary-dark, #00585b);
    color: var(--text-primary);
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-right: 4px;
}

.zoom-btn:hover {
    background: var(--primary-bright);
    color: var(--text-inverse);
}

/* Context Menu Styles */
.context-menu {
    background: rgba(42, 42, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 150px;
    overflow: hidden;
    z-index: 10000;
}

.context-menu-item {
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item i {
    width: 16px;
    text-align: center;
}

.drawing-toolbar .drawing-tool-btn:hover {
    background: var(--scrollbar-thumb);
}

.drawing-toolbar .drawing-tool-btn.active {
    background: var(--primary-bright);
    color: #000;
}

.drawing-toolbar .instructions {
    color: #888; 
    font-size: 12px; 
    margin-left: 15px;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.2em;
    background: var(--primary-dark);
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
}

/* Markup Item Specific Styles */
.markup-name {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    overflow: visible;
    max-width: 400px;
    flex: 1 1 0;
}

.markup-item:hover .markup-text {
    color: var(--text-primary);
    opacity: 1;
}

/* Drawing Toolbar Styles - Horizontal Layout */
.drawing-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background: var(--bg-panel);
    border-bottom: 2px solid var(--primary-bright);
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 20000;
    flex-shrink: 0;
    font-family: 'Barlow Semi Condensed', Arial, sans-serif;
    height: 60px;
    box-sizing: border-box;
    overflow-x: auto;
    white-space: nowrap;
}

.drawing-toolbar .drawing-tool-btn {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.drawing-toolbar .drawing-tool-btn:hover {
    background: var(--bg-elevated-hover);
}

.drawing-toolbar .drawing-tool-btn.active {
    background: var(--primary-bright);
    color: var(--text-on-primary);
}

.drawing-toolbar .undo-redo-btn {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    cursor: not-allowed;
    flex-shrink: 0;
}

.drawing-toolbar .undo-redo-btn:hover {
    background: var(--bg-elevated-hover);
}

.drawing-toolbar .undo-redo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.drawing-toolbar .instructions {
    color: var(--text-muted); 
    font-size: 12px; 
    margin-left: 15px;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.2em;
    background: var(--primary-dark);
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
}

/* Ensure buttons in drawing toolbars maintain their width and don't shrink */
.drawing-toolbar .basicbutton,
.drawing-toolbar .cancelbutton {
    flex-shrink: 0 !important;
    min-width: fit-content !important;
}

/* Specific button width constraints for drawing toolbars */
.drawing-toolbar #3d-save,
.drawing-toolbar #3d-complete-shape {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

.drawing-toolbar #3d-cancel {
    min-width: fit-content !important;
}

/* 2D drawing toolbar specific button widths */
.drawing-toolbar button[onclick*="addAsReferenceImage"],
.drawing-toolbar button[onclick*="replaceRenderImage"] {
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
}

/* When toolbar is active, adjust sidebar positioning */
body.toolbar-active #sidebar {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    position: fixed !important;
}

body.toolbar-active #sidebar.expanded {
    transform: translateX(0) translateY(0) !important;
}

body.toolbar-active #settingsSidebar {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
}

body.toolbar-active #settingsSidebar.expanded {
    transform: translateX(0) translateY(0) !important;
}

body.toolbar-active #sidebarToggle.sidebar-collapse-btn {
    top: calc(50% + 30px) !important;
}

body.toolbar-active #settingsSidebarToggle.sidebar-collapse-btn.right {
    top: calc(50% + 30px) !important;
}

/* Handle collapsed sidebars with toolbar active */
body.toolbar-active #sidebar.collapsed {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    position: fixed !important;
    transform: translateX(-100%) !important;
}

body.toolbar-active #settingsSidebar.collapsed {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    transform: translateX(100%) !important;
}

/* Unified Toggle Switch System */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-off-bg);
    transition: .4s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--toggle-button);
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: var(--accent-orange, #ff6d00);
}

.toggle-switch input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-orange, #ff6d00);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* Toggle Row Container */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 0 0;
}

.toggle-row:last-child {
    margin-bottom: 18px;
}

/* Toggle Label */
.toggle-label {
    font-size: 0.98em;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
    flex: 1;
}

/* Toggle Display Area */
.toggle-display {
    width: 100%;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    border-radius: 6px;
    margin: 10px 0 0 0;
    padding: 14px 16px;
    white-space: pre-line;
    display: none;
}

.toggle-display.show {
    display: block;
}

/* Settings Item Toggle Specific Styles */
.setting-item .toggle-switch .slider {
    background-color: var(--toggle-off-bg);
    transition: .4s;
}

.setting-item .toggle-switch input:checked + .slider {
    background-color: var(--accent-orange, #ff6d00);
}

.setting-item .toggle-switch input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-orange, #ff6d00);
}

.setting-item .toggle-switch .slider:before {
    background-color: var(--toggle-button);
}

/* Legacy Switch Support (for backward compatibility) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-off-bg);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--toggle-button);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--accent-orange, #ff6d00);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-orange, #ff6d00);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Export/Import Checkbox Styles */
.export-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
}

.import-checkbox {
    margin-right: 10px;
    transform: scale(1.2);
}

.export-option-checkbox {
    margin-right: 10px;
    transform: scale(1.1);
}

.google-earth-checkbox {
    margin-right: 10px;
    transform: scale(1.1);
}

/* === MOBILE NAVIGATION STYLES === */

/* Hamburger button styling */
@media (max-width: 900px) {
    .hamburger {
        display: block !important;
        background: none;
        border: none;
        font-size: 2em;
        color: var(--primary-dark);
        cursor: pointer;
        margin-left: 10px;
        z-index: 20;
        padding: 8px;
        border-radius: 6px;
        transition: all 0.2s ease;
    }
    
    .hamburger:hover {
        background: var(--primary-bright);
        color: var(--primary-dark);
        transform: scale(1.05);
    }
    
    .hamburger:active {
        transform: scale(0.95);
    }
    
    /* Make hamburger icon clickable */
    .hamburger i {
        pointer-events: none !important;
    }
}

/* Mobile dropdown styling */
#mobileNavDropdown {
    position: fixed !important;
    top: 60px !important;
    right: 18px !important;
    width: 220px !important;
    min-height: 100px !important;
    background-color: #181c1c !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    z-index: 99999 !important;
    padding: 8px 0 !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid var(--primary-bright) !important;
}

#mobileNavDropdown a, 
#mobileNavDropdown button {
    color: #fff !important;
    padding: 14px 20px !important;
    text-align: left !important;
    background: none !important;
    border: none !important;
    font: inherit !important;
    width: 100% !important;
    display: block !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
}

#mobileNavDropdown a:hover, 
#mobileNavDropdown button:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
    padding-left: 24px !important;
}

/* Features dropdown in mobile menu */
.mobile-features-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.mobile-features-toggle {
    background: none !important;
    border: none !important;
    font: inherit !important;
    cursor: pointer !important;
    padding: 14px 20px !important;
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: var(--primary-bright) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.mobile-features-toggle:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
    padding-left: 24px !important;
}

.mobile-features-dropdown {
    background-color: rgba(0, 0, 0, 0.3) !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.mobile-features-dropdown a {
    color: #ccc !important;
    padding: 12px 40px !important;
    font-size: 0.9em !important;
    font-weight: 400 !important;
}

.mobile-features-dropdown a:hover {
    background: var(--primary-dark) !important;
    color: #fff !important;
    padding-left: 44px !important;
}

/* Book Demo button in mobile menu - styled like other menu items */
#mobileBookDemoBtn {
    color: #fff !important;
    padding: 14px 20px !important;
    text-align: left !important;
    background: none !important;
    border: none !important;
    font: inherit !important;
    width: 100% !important;
    display: block !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
}

#mobileBookDemoBtn:hover {
    background: var(--primary-bright) !important;
    color: var(--primary-dark) !important;
    padding-left: 24px !important;
}

/* Animation for dropdown appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobileNavDropdown[style*="display: block"] {
    animation: slideDown 0.2s ease-out;
}


