/* MapTrax v2.4.1.3 - Core Layout Styles */
/* Reset and base styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Top Toolbar - dark command chrome (neutral slate + accent hairline).
   The white-label base ships no brand mark; a tenant skin can add one by
   restoring an <img class="toolbar-logo"> and pointing it at its asset. */
.top-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary, #0a0a0f);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 10px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    border-bottom: 1px solid color-mix(in srgb, var(--gold, #c9a962) 28%, transparent);
}

.toolbar-logo {
    height: 32px;
    width: auto;
    margin-right: 12px;
}

.toolbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: #ffffff;
    letter-spacing: 0.01em;
    margin-right: 20px;
    white-space: nowrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.toolbar-section:last-child {
    border-right: none;
    margin-left: auto;
}

.toolbar-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.toolbar-select {
    padding: 8px 12px;
    border: 2px solid #b96c28;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #7a4d27;
    cursor: pointer;
    font-weight: 500;
    min-width: 250px;
}

/* Custom Dropdown with Delete Icons */
.custom-dropdown {
    position: relative;
    min-width: 250px;
}

.dropdown-selected {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #1d1d1f;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-selected:hover {
    background: #f5f5f7;
}

.dropdown-arrow {
    margin-left: 10px;
    font-size: 10px;
    transition: transform 0.2s;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #b96c28;
    border-radius: 6px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(121, 77, 39, 0.2);
}

.dropdown-list.open {
    display: block;
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    color: #7a4d27;
    font-size: 13px;
    transition: background 0.2s;
    border-bottom: 1px solid #f0e6db;
}

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

.dropdown-item:hover {
    background: #f5efe8;
}

.dropdown-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dropdown-item-text {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-item-meta {
    font-size: 11px;
    color: #a08567;
    font-weight: 400;
    line-height: 1.3;
}

.dropdown-item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.dropdown-action-icon {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    color: #7a4d27;
    opacity: 0.55;
    line-height: 1;
}

.dropdown-action-icon:hover {
    background: #e8dccb;
    opacity: 1;
}

.dropdown-action-icon.delete-btn:hover {
    background: #dc3545;
    color: white;
    opacity: 1;
}

/* Legacy .dropdown-delete selector — kept in case anything else uses it */
.dropdown-delete {
    color: #dc3545;
    font-size: 14px;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-delete:hover {
    background: #dc3545;
    color: white;
}

.dropdown-search {
    padding: 8px 10px;
    background: #fafafa;
    border-bottom: 1px solid #e0d4c2;
    position: sticky;
    top: 0;
    z-index: 2;
}

.dropdown-search-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d4c5b0;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    background: white;
    color: #7a4d27;
}

.dropdown-search-input:focus {
    outline: none;
    border-color: #b96c28;
    box-shadow: 0 0 0 2px rgba(185, 108, 40, 0.15);
}

.dropdown-empty {
    padding: 20px 12px;
    text-align: center;
    color: #a08567;
    font-size: 12px;
    font-style: italic;
}

/* Drag-and-drop overlay for project file imports */
.project-drop-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(121, 77, 39, 0.85);
    z-index: 10000;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    animation: dropFadeIn 0.15s ease-out;
}

.project-drop-indicator.visible {
    display: flex;
}

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

.project-drop-message {
    background: white;
    border: 3px dashed #b96c28;
    border-radius: 12px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-drop-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.project-drop-title {
    font-size: 18px;
    font-weight: 600;
    color: #7a4d27;
    margin-bottom: 4px;
}

.project-drop-hint {
    font-size: 13px;
    color: #a08567;
}

.toolbar-button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-button:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.toolbar-version {
    color: var(--gold, #c9a962);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    background: var(--gold-subtle, color-mix(in srgb, #c9a962 15%, transparent));
    border-radius: 4px;
}

/* PLSS State Dropdown */
.plss-dropdown {
    position: relative;
}

.plss-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plss-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    max-height: 400px;
    background: white;
    border: 2px solid #b96c28;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(121, 77, 39, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.plss-dropdown-menu.open {
    display: block;
}

.plss-menu-header {
    padding: 10px 12px;
    font-weight: 600;
    color: #794500;
    background: #f5efe8;
    border-bottom: 1px solid #ddd;
}

.plss-menu-actions {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.plss-menu-actions button {
    flex: 1;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #b96c28;
    background: white;
    color: #b96c28;
    border-radius: 4px;
    cursor: pointer;
}

.plss-menu-actions button:hover {
    background: #b96c28;
    color: white;
}

.plss-state-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
}

.plss-state-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.plss-state-item:hover {
    background: #f5efe8;
}

.plss-state-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #b96c28;
}

.plss-state-item label {
    flex: 1;
    cursor: pointer;
    font-size: 13px;
}

.plss-state-item .state-abbr {
    font-weight: 600;
    color: #794500;
    width: 30px;
}

.plss-vector-option {
    padding: 10px 12px;
    border-top: 1px solid #ddd;
    background: #e8f0e8;
}

.plss-vector-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    font-size: 13px;
}

.plss-vector-label input {
    margin-right: 6px;
}

.plss-vector-label span {
    display: flex;
    align-items: center;
}

.plss-vector-label small {
    color: #666;
    font-size: 11px;
    margin-left: 22px;
    font-style: italic;
}

.plss-menu-footer {
    padding: 8px 12px;
    border-top: 1px solid #ddd;
    background: #f5efe8;
}

.plss-apply-btn {
    width: 100%;
    padding: 8px 16px;
    background: #b96c28;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.plss-apply-btn:hover {
    background: #a96932;
}

/* Oil Price Ticker */
.oil-ticker-section {
    padding-right: 15px;
}

.oil-ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    white-space: nowrap;
}

.oil-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.oil-ticker-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.oil-ticker-price {
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.oil-ticker-price.up {
    color: #34c759;
}

.oil-ticker-price.down {
    color: #ff3b30;
}

.oil-ticker-arrow {
    font-size: 10px;
}

.oil-ticker-arrow.up {
    color: #34c759;
}

.oil-ticker-arrow.down {
    color: #ff3b30;
}

.oil-ticker-link {
    text-decoration: none;
    cursor: pointer;
}

.oil-ticker-link:hover {
    opacity: 0.75;
}

.oil-ticker-divider {
    color: rgba(255, 255, 255, 0.18);
    font-size: 14px;
    margin: 0 2px;
}

.oil-ticker-refresh {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.3s;
    line-height: 1;
}

.oil-ticker-refresh:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.oil-ticker-refresh.spinning {
    animation: oil-ticker-spin 0.8s linear;
}

@keyframes oil-ticker-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.oil-ticker-timestamp {
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    font-style: italic;
    opacity: 0.9;
}

.oil-ticker-section.hidden {
    display: none;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
}

/* ---------------------------------------------------------------------------
   Quick Fund filter (v1.18.0.0) — the toolbar slot the Project controls used
   to occupy. One click opens a checkbox list of every fund; unchecking one
   hides its tracts on the map (State.hiddenFunds → tractHiddenReason).
   --------------------------------------------------------------------------- */
.fund-filter {
    position: relative;
    display: inline-flex;
}
.fund-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: space-between;
}
.fund-filter-popover {
    position: fixed;
    z-index: 10000;
    min-width: 250px;
    max-width: 340px;
    background: #1c2230;
    border: 1px solid #33405c;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    color: #e8ecf3;
    font-size: 13px;
    overflow: hidden;
}
.fund-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #2a3448;
    font-weight: 600;
}
.fund-filter-all {
    background: transparent;
    border: 1px solid #3d4a68;
    border-radius: 4px;
    color: #cfe0ff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    cursor: pointer;
}
.fund-filter-all:hover { background: rgba(255, 255, 255, 0.10); }
.fund-filter-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}
/* The row is a <label>, and the global `label` rule (overlays-controls.css)
   sets color #555 / font-size 10px — dark grey at 10px on this dark panel,
   which is unreadable. Everything below is explicit for that reason; don't
   drop the color/size declarations assuming inheritance. */
.fund-filter-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    margin-bottom: 0;
    cursor: pointer;
    color: #f2f5fa;
    font-size: 13px;
    font-weight: 500;
}
.fund-filter-row:hover { background: rgba(255, 255, 255, 0.10); }
.fund-filter-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f2f5fa;
    font-size: 13px;
    font-weight: 600;
}
.fund-filter-count {
    flex-shrink: 0;
    font-size: 12px;
    color: #a9b8d4;
    font-variant-numeric: tabular-nums;
}
/* An unchecked (hidden) fund reads as muted, so the map state is legible
   at a glance without hunting for the checkbox. */
.fund-filter-row:has(input:not(:checked)) .fund-filter-name {
    color: #8fa0bd;
    font-weight: 500;
}
.fund-filter-hint,
.fund-filter-empty {
    padding: 7px 12px;
    font-size: 11px;
    color: #8fa0bd;
    border-top: 1px solid #2a3448;
}
.fund-filter-empty { border-top: none; }

/* Projects popover — the relocated Project controls, opened from ⚙️ →
   Projects…. Hosts the ORIGINAL markup (re-parented), so the controls keep
   their toolbar styling. */
.project-tools-popover {
    position: fixed;
    z-index: 10000;
    background: #1c2230;
    border: 1px solid #33405c;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    color: #e8ecf3;
    padding-bottom: 12px;
}
.project-tools-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-bottom: 1px solid #2a3448;
    font-weight: 600;
    font-size: 13px;
}
.project-tools-close {
    background: transparent;
    border: 0;
    color: #cfe0ff;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
}
.project-tools-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
}
.project-tools-row .toolbar-label { color: #8fa0bd; }

/* The relocated project dropdown lives in a popover anchored to the
   bottom-mounted gear, so its absolutely-positioned list must stay inside
   the viewport — openProjectTools reserves room below the popover and this
   caps the list to it. */
.project-tools-popover .dropdown-list {
    max-height: 250px;
    overflow-y: auto;
}
/* Non-MMS hosts keep the controls inline in the toolbar (see
   mountProjectToolsInToolbar) — lay them out in a row, not stacked. */
#project-tools-host.project-tools-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}
#project-tools-host.project-tools-inline .project-tools-row {
    padding: 0;
}
