/*
 * biodiversity-public.css
 * Lab 05 — Public-facing Biodiversity Analyst
 * Three-column layout under YEA site header
 * Includes filter drawer, pills, search row
 *
 * Path: /projects/yea3d/labs/biodiversity-public.css
 * Author: M. Hamilton / Claude collaboration
 * Date: March 2026
 */

/* ================================================================
   SCOPED DESIGN TOKENS
   ================================================================ */

#instrument-workspace {
    --bg-deep: #06070d;
    --bg-panel: #0c0e18;
    --font-mono: 'DM Mono', monospace;
    --font-display: 'Instrument Serif', serif;
    --text-primary: #d4d6e0;
    --text-bright: #ffffff;
    --text-secondary: #6b6f85;
    --text-dim: #3a3d52;
    --accent: #e67e22;
    --eco-green: #3ddc84;
    --eco-blue: #4fc3f7;
    --eco-red: #ef5350;
    --transition-fast: 0.2s ease;
    --radius-sm: 3px;
    --font-size-xs: 9px;
    --font-size-sm: 10px;
    --font-size-md: 12px;
    --font-size-lg: 16px;
    --border: #1e2235;
    --border-hover: #2e3255;
    --space-xs: 4px;
    --space-sm: 8px;
}

/* ================================================================
   INSTRUMENT HEADER
   ================================================================ */

#instrument-header {
    background: linear-gradient(135deg, #252E22 0%, #2E3C2A 50%, #222A20 100%);
    border-bottom: 3px solid #5c7a3a;
    padding: 0.6rem 2rem;
}

.instrument-header-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.instrument-breadcrumb {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    color: rgba(106, 174, 106, 0.5);
    text-decoration: none;
    letter-spacing: 0.08em;
}
.instrument-breadcrumb:hover {
    color: rgba(106, 174, 106, 0.85);
}

.instrument-id {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: rgba(106, 174, 106, 0.5);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.instrument-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: normal;
    color: #E8F2E4;
    line-height: 1.2;
    margin: 0;
}

/* ================================================================
   WORKSPACE — three-column
   ================================================================ */

#instrument-workspace {
    display: flex;
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 1.5rem;
    height: 700px;
    gap: 0;
}

/* ================================================================
   LEFT PANEL — warm parchment
   ================================================================ */

#instrument-panel {
    width: 240px;
    min-width: 240px;
    background: #faf8f3;
    border: 1.5px solid #d8d0c4;
    border-right: none;
    border-radius: 5px 0 0 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 0.6rem 0.5rem;
}

.panel-label {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a7e6e;
    margin-bottom: 0.35rem;
    padding: 0 2px;
    flex-shrink: 0;
}

.panel-meta {
    font-family: Georgia, serif;
    font-size: 12px;
    color: #6b5d4d;
    padding: 0 2px;
}

.panel-dim {
    color: #a09888;
    font-weight: normal;
}

/* Search + filter button row */
.panel-search-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.panel-search {
    flex: 1;
    padding: 6px 8px;
    font-family: Georgia, serif;
    font-size: 12px;
    color: #2c2416;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
}
.panel-search:focus {
    outline: none;
    border-color: #5c7a3a;
}
.panel-search::placeholder {
    color: #a09888;
}

.filter-btn {
    width: 36px;
    height: 36px;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a7e6e;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
}
.filter-btn:hover {
    border-color: #5c7a3a;
    color: #5c7a3a;
}
.filter-btn.has-filters {
    border-color: #5c7a3a;
    background: #e8e4d8;
    color: #3e5a2a;
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #5c7a3a;
    color: #fff;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 4px;
    flex-shrink: 0;
}
.active-filters:empty {
    display: none;
    margin: 0;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 8px;
    background: #e8e4d8;
    border: 1px solid #d8d0c4;
    border-radius: 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #3e5a2a;
    line-height: 1;
}

.filter-pill-remove {
    cursor: pointer;
    color: #8a7e6e;
    font-size: 12px;
    line-height: 1;
}
.filter-pill-remove:hover {
    color: #3e5a2a;
}

.panel-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-shrink: 0;
}

/* Place list */
.place-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
}

.place-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.place-card:hover {
    border-color: #5c7a3a;
    background: #f0ede4;
}
.place-card.active {
    border-color: #5c7a3a;
    background: #e8e4d8;
}

.place-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5c7a3a;
    flex-shrink: 0;
}

.place-card-info {
    overflow: hidden;
    flex: 1;
}

.place-card-name {
    font-family: Georgia, serif;
    font-size: 11px;
    color: #2c2416;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.place-card-sub {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 9px;
    color: #a09888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================================================================
   CENTER — observation map
   ================================================================ */

#instrument-viewport {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    overflow: hidden;
}

/* ================================================================
   RIGHT PANEL — dark taxon sidebar
   ================================================================ */

#taxon-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-panel, #0c0e18);
    border: 1.5px solid #d8d0c4;
    border-left: none;
    border-radius: 0 5px 5px 0;
    overflow-y: auto;
    padding: 0.6rem 0.5rem;
    color: var(--text-primary, #d4d6e0);
}

#taxon-sidebar .sidebar-section {
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#taxon-sidebar .sidebar-section:last-child {
    border-bottom: none;
}

#taxon-sidebar .sidebar-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary, #6b6f85);
    margin-bottom: 4px;
}

#taxon-sidebar .sidebar-dim {
    color: var(--text-dim, #3a3d52);
}

#taxon-sidebar:empty::before {
    content: 'Select a place to view biodiversity observations';
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text-dim, #3a3d52);
    padding: 1rem 0.5rem;
    text-align: center;
    line-height: 1.5;
}

/* ================================================================
   FILTER DRAWER
   ================================================================ */

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}
.filter-overlay.visible {
    display: block;
}

.filter-drawer {
    position: fixed;
    top: 0;
    left: -340px;
    width: 320px;
    height: 100vh;
    background: #faf8f3;
    border-right: 2px solid #d8d0c4;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}
.filter-drawer.open {
    left: 0;
}

.filter-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #d8d0c4;
    flex-shrink: 0;
}

.filter-drawer-title {
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #2c2416;
}

.filter-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8a7e6e;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.filter-drawer-close:hover {
    color: #3e5a2a;
}

.filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.filter-group {
    margin-bottom: 1.2rem;
}

.filter-group-label {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a7e6e;
    margin-bottom: 0.4rem;
}

.filter-select {
    width: 100%;
    padding: 8px 10px;
    font-family: Georgia, serif;
    font-size: 13px;
    color: #2c2416;
    background: #faf8f3;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
}
.filter-select:focus {
    outline: none;
    border-color: #5c7a3a;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(92, 122, 58, 0.14);
}

.filter-apply-btn {
    flex: 1;
    padding: 8px 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #fff;
    background: #5c7a3a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.filter-apply-btn:hover {
    background: #4a6a2e;
}

.filter-clear-btn {
    padding: 8px 12px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: #8a7e6e;
    background: transparent;
    border: 1px solid #d8d0c4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-clear-btn:hover {
    background: #f0ede4;
    border-color: #5c7a3a;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1000px) {
    #instrument-workspace {
        flex-direction: column;
        height: auto;
    }
    #instrument-panel {
        width: 100%;
        min-width: auto;
        border-right: 1.5px solid #d8d0c4;
        border-radius: 5px 5px 0 0;
        max-height: 200px;
    }
    #instrument-viewport {
        height: 500px;
    }
    #taxon-sidebar {
        width: 100%;
        min-width: auto;
        border-left: 1.5px solid #d8d0c4;
        border-radius: 0 0 5px 5px;
        max-height: 300px;
    }
}