/*
 * habitat.css
 * Lab 04 — Habitat Analyst
 * Three-column: place list | habitat profile | summary
 *
 * Path: /projects/yea3d/admin/lab/habitat.css
 * Author: M. Hamilton / Claude collaboration
 * Date: March 2026
 */

/* ── 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., 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: var(--font-mono); 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, serif; font-size: 22px; font-weight: normal;
    color: #E8F2E4; line-height: 1.2; margin: 0;
}

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

/* ── Left panel ── */
#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: var(--font-mono); 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; }
.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: var(--font-mono); 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: var(--font-mono); 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 { 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: var(--font-mono); font-size: 9px; color: #a09888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Center — habitat profile ── */
#instrument-viewport {
    flex: 1; position: relative; background: #faf8f3;
    border: 1.5px solid #d8d0c4; overflow-y: auto;
}

.habitat-profile { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }

.habitat-empty {
    font-family: var(--font-mono); font-size: 12px; color: #a09888;
    text-align: center; padding: 4rem 1rem; line-height: 1.5;
}

.habitat-place-name {
    font-family: Georgia, serif; font-size: 20px; font-weight: 700;
    color: #2c2416; line-height: 1.2;
}
.habitat-place-sub {
    font-family: var(--font-mono); font-size: 11px; color: #8a7e6e;
    letter-spacing: 0.05em; margin-top: 2px;
}

/* Profile cards */
.habitat-card {
    background: #fff; border: 1px solid #d8d0c4; border-radius: 6px;
    padding: 0.8rem 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.habitat-card-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem;
}

.habitat-card-swatch {
    width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
}

.habitat-card-title {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
    text-transform: uppercase; color: #8a7e6e;
}

.habitat-card-source {
    font-family: var(--font-mono); font-size: 9px; color: #a09888;
    margin-left: auto;
}

.habitat-card-value {
    font-family: Georgia, serif; font-size: 15px; color: #2c2416;
    line-height: 1.3; margin-bottom: 0.3rem;
}

.habitat-card-detail {
    font-family: var(--font-mono); font-size: 10px; color: #8a7e6e;
    line-height: 1.4;
}

.habitat-card-row {
    display: flex; justify-content: space-between; padding: 3px 0;
}
.habitat-card-row-label { font-family: var(--font-mono); font-size: 10px; color: #a09888; }
.habitat-card-row-value { font-family: Georgia, serif; font-size: 12px; color: #2c2416; text-align: right; max-width: 65%; }

/* Omernik levels */
.omernik-levels { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.omernik-level {
    padding: 4px 8px; background: #faf8f3; border-radius: 4px;
    border-left: 3px solid #5c7a3a;
}
.omernik-level-label { font-family: var(--font-mono); font-size: 9px; color: #a09888; letter-spacing: 0.08em; text-transform: uppercase; }
.omernik-level-value { font-family: Georgia, serif; font-size: 12px; color: #2c2416; }

/* No data state */
.habitat-no-data {
    font-family: var(--font-mono); font-size: 10px; color: #a09888;
    font-style: italic; padding: 4px 0;
}

/* ── Right panel — summary ── */
#summary-panel {
    width: 220px; min-width: 220px; background: #faf8f3;
    border: 1.5px solid #d8d0c4; border-left: none;
    border-radius: 0 5px 5px 0; overflow-y: auto; padding: 0.6rem;
}
.summary-content { font-family: Georgia, serif; color: #3A3226; }
.summary-empty {
    font-family: var(--font-mono); font-size: 11px; color: #a09888;
    text-align: center; padding: 2rem 0.5rem; line-height: 1.5;
}
.summary-place-name {
    font-family: Georgia, serif; font-size: 14px; font-weight: 700;
    color: #2c2416; margin-bottom: 0.5rem; line-height: 1.2;
}
.summary-section {
    margin-top: 0.6rem; padding-top: 0.5rem;
    border-top: 1px solid rgba(74,124,74,0.14);
}
.summary-section-label {
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
    text-transform: uppercase; color: #8a7e6e; margin-bottom: 0.3rem;
}
.summary-row { display: flex; justify-content: space-between; padding: 3px 0; }
.summary-row-label { font-family: var(--font-mono); font-size: 10px; color: #a09888; }
.summary-row-value { font-family: Georgia, serif; font-size: 12px; color: #2c2416; text-align: right; max-width: 60%; }

.summary-sources {
    margin-top: 0.8rem; padding-top: 0.5rem;
    border-top: 1px solid rgba(74,124,74,0.14);
}
.summary-source-tag {
    display: inline-block; padding: 2px 6px; margin: 2px;
    font-family: var(--font-mono); font-size: 9px;
    border-radius: 3px; letter-spacing: 0.05em;
}
.summary-source-tag.available { background: #e8e4d8; color: #3e5a2a; }
.summary-source-tag.missing { background: #F0EDED; color: #A09888; }

/* ── 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: var(--font-mono); 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(74,124,74,0.14); }
.filter-apply-btn { flex: 1; padding: 8px 12px; font-family: var(--font-mono); font-size: 12px; color: #fff; background: #5c7a3a; border: none; border-radius: 4px; cursor: pointer; }
.filter-apply-btn:hover { background: #3A6C3A; }
.filter-clear-btn { padding: 8px 12px; font-family: var(--font-mono); font-size: 12px; color: #8a7e6e; background: transparent; border: 1px solid #d8d0c4; border-radius: 4px; cursor: pointer; }
.filter-clear-btn:hover { background: #e8e4d8; 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: auto; min-height: 500px; }
    #summary-panel { width: 100%; min-width: auto; border-left: 1.5px solid #d8d0c4; border-radius: 0 0 5px 5px; max-height: 300px; }
}
