/* IDSA Ecosystem Network V1.2 — premium discovery UI */

.eco-network-page {
    --eco-gap: 16px;
    --eco-radius: 16px;
    --eco-border: #e2e8f0;
    --eco-muted: #64748b;
    --eco-text: #0f172a;
    --eco-accent: #0f766e;
    --eco-accent-soft: #ecfdf5;
    --eco-primary: #2563eb;
    --eco-primary-hover: #1d4ed8;
    --eco-orange: #ea580c;
    --eco-orange-hover: #c2410c;
    --eco-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden;
}

.eco-page-body {
    min-height: 72vh;
    padding-bottom: 48px;
}

.eco-page-spacer {
    min-height: 24px;
}

/* Buttons — scoped CTA system */
.eco-network-page .eco-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.eco-network-page .eco-btn-primary {
    background: var(--eco-primary);
    color: #fff;
    border-color: var(--eco-primary);
}

.eco-network-page .eco-btn-primary:hover,
.eco-network-page .eco-btn-primary:focus-visible {
    background: var(--eco-primary-hover);
    border-color: var(--eco-primary-hover);
    color: #fff;
}

.eco-network-page .eco-btn-secondary {
    background: #fff;
    color: #1e293b;
    border-color: #cbd5e1;
}

.eco-network-page .eco-btn-secondary:hover,
.eco-network-page .eco-btn-secondary:focus-visible {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.eco-network-page .eco-btn-accent {
    background: #fff;
    color: var(--eco-orange);
    border-color: #fdba74;
}

.eco-network-page .eco-btn-accent:hover,
.eco-network-page .eco-btn-accent:focus-visible {
    background: #fff7ed;
    border-color: var(--eco-orange);
    color: var(--eco-orange-hover);
}

.eco-network-page .eco-btn-sm {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.88rem;
}

/* Hero */
.eco-hero-shell {
    margin-bottom: 8px;
    padding: 20px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 55%, #ffffff 100%);
    border: 1px solid #dbeafe;
    box-shadow: var(--eco-shadow);
}

.eco-hero-shell__inner {
    display: grid;
    gap: 20px;
    align-items: center;
}

.eco-hero-shell__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--eco-primary);
}

.eco-hero-shell__title {
    margin: 0 0 12px;
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    line-height: 1.15;
    font-weight: 800;
    color: var(--eco-text);
}

.eco-hero-shell__subtitle {
    margin: 0 0 18px;
    max-width: 38rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
}

.eco-hero-shell__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eco-hero-shell__actions .eco-btn {
    width: 100%;
}

.eco-hero-visual__card {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.eco-hero-visual__title {
    margin: 0 0 14px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--eco-muted);
}

.eco-hero-visual__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.eco-hero-visual__dot {
    aspect-ratio: 1;
    border-radius: 8px;
    background: #e2e8f0;
}

.eco-hero-visual__dot.is-accent {
    background: linear-gradient(135deg, #93c5fd, #5eead4);
}

.eco-hero-visual__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.eco-hero-visual__chips span {
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
}

/* Snapshot */
.eco-network-snapshot {
    margin-top: 20px;
}

.eco-network-snapshot__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eco-network-snapshot__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.eco-snapshot-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 14px;
    border: 1px solid var(--eco-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.eco-snapshot-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    font-size: 0.95rem;
    font-weight: 800;
    color: #0369a1;
}

.eco-snapshot-card__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--eco-muted);
}

.eco-snapshot-card__value {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    font-weight: 800;
    color: var(--eco-text);
    line-height: 1.05;
}

/* Panels */
.eco-panel {
    padding: 18px 16px;
    border: 1px solid var(--eco-border);
    border-radius: var(--eco-radius);
    background: #fff;
    box-shadow: var(--eco-shadow);
}

.eco-network-section {
    margin-top: 24px;
}

.eco-network-section__head {
    margin-bottom: 14px;
}

.eco-network-section__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--eco-text);
}

.eco-network-section__intro {
    margin: 0;
    font-size: 0.92rem;
    color: var(--eco-muted);
    line-height: 1.5;
}

.eco-district-explorer__group-label {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--eco-muted);
}

/* District search */
.eco-district-search {
    display: block;
    margin-bottom: 12px;
}

.eco-district-search__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
}

.eco-district-search__input {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--eco-border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--eco-text);
    background: #f8fafc;
    box-sizing: border-box;
}

.eco-district-search__input:focus-visible {
    outline: 2px solid var(--eco-primary);
    outline-offset: 2px;
    background: #fff;
}

.eco-location-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.eco-location-row .eco-btn {
    width: 100%;
    align-self: flex-start;
}

.eco-location-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--eco-muted);
}

.eco-location-status {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.45;
}

.eco-location-status--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.eco-location-status--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.eco-location-status--warn {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.eco-nearby {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.eco-nearby__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eco-district-city--nearby,
.eco-district-city.is-nearby {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.eco-district-state.is-nearby {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.eco-district-state.is-nearby > .eco-district-state__toggle {
    background: #eff6ff;
}

.eco-district-search-results {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.eco-district-search-hit {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--eco-border);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.eco-district-search-hit:hover,
.eco-district-search-hit:focus-visible {
    border-color: #93c5fd;
    background: #eff6ff;
    outline: 2px solid var(--eco-primary);
    outline-offset: 2px;
}

.eco-district-search-hit__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

/* District explorer */
.eco-district-explorer {
    display: grid;
    gap: 12px;
}

.eco-district-state {
    border: 1px solid var(--eco-border);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}

.eco-district-state__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border: 0;
    background: transparent;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--eco-text);
    cursor: pointer;
    text-align: left;
}

.eco-district-state__toggle:focus-visible {
    outline: 2px solid var(--eco-primary);
    outline-offset: -2px;
}

.eco-district-state__count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--eco-muted);
}

.eco-district-cities {
    display: none;
    padding: 0 12px 14px;
    gap: 8px;
    flex-wrap: wrap;
}

.eco-district-state.is-open .eco-district-cities {
    display: flex;
}

.eco-district-city {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
}

.eco-district-city:hover,
.eco-district-city.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

/* Selected area */
.eco-district-view {
    padding: 4px 2px;
}

.eco-district-view__label {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--eco-muted);
}

.eco-district-view__name {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--eco-text);
    line-height: 1.25;
}

.eco-district-view__helper {
    margin: 0;
    font-size: 0.92rem;
    color: var(--eco-muted);
    line-height: 1.5;
}

/* Filter card */
.eco-filter-card {
    margin-bottom: 16px;
}

.eco-filter-card__title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--eco-text);
}

.eco-filter-card__group + .eco-filter-card__group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.eco-filter-card__group-label {
    margin: 0 0 8px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--eco-muted);
}

.eco-tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eco-tab-row--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
    max-width: 100%;
}

.eco-tab-row--scroll .eco-tab {
    flex: 0 0 auto;
}

.eco-tab {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--eco-border);
    background: #f8fafc;
    font-size: 0.86rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
}

.eco-tab.is-active {
    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;
}

.eco-tab:focus-visible {
    outline: 2px solid var(--eco-primary);
    outline-offset: 2px;
}

/* Results stage */
.eco-results-stage {
    min-height: 260px;
}

.eco-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px;
}

.eco-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--eco-border);
    border-radius: var(--eco-radius);
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.eco-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--eco-text);
    min-width: 0;
}

.eco-card__meta {
    margin: 0;
    font-size: 0.86rem;
    color: var(--eco-muted);
}

.eco-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.eco-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.eco-chip--type {
    background: #e0f2fe;
    color: #0369a1;
}

.eco-chip--category {
    background: #fef3c7;
    color: #92400e;
}

.eco-chip--trust {
    background: #ede9fe;
    color: #5b21b6;
}

.eco-card__chat {
    margin: 0;
    font-size: 0.84rem;
    color: #334155;
}

.eco-card__chat strong {
    color: var(--eco-muted);
    font-weight: 700;
}

.eco-card__actions {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    width: 100%;
}

.eco-card__connect-hint {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--eco-muted);
}

.eco-card__actions .eco-btn {
    width: 100%;
}

/* Empty + loading */
.eco-loading,
.eco-error {
    padding: 18px 16px;
    border-radius: var(--eco-radius);
    border: 1px dashed var(--eco-border);
    background: #f8fafc;
    font-size: 0.92rem;
    color: #334155;
    text-align: center;
}

.eco-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.eco-empty-premium {
    padding: 28px 20px;
    border-radius: 18px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    text-align: center;
    box-shadow: var(--eco-shadow);
}

.eco-empty-premium__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe, #ccfbf1);
    font-size: 1.4rem;
    color: #0369a1;
}

.eco-empty-premium__title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--eco-text);
}

.eco-empty-premium__text {
    margin: 0 0 16px;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

.eco-empty-premium__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    justify-content: center;
    margin-bottom: 12px;
}

.eco-empty-premium__actions .eco-btn {
    width: 100%;
}

.eco-empty-premium__note {
    margin: 0;
    font-size: 0.82rem;
    color: var(--eco-muted);
}

.eco-network-hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .eco-hero-shell {
        padding: 28px 24px;
    }

    .eco-location-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .eco-location-row .eco-btn {
        width: auto;
    }

    .eco-hero-shell__inner {
        grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
        gap: 24px;
    }

    .eco-hero-shell__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .eco-hero-shell__actions .eco-btn {
        width: auto;
        min-width: 11rem;
    }

    .eco-network-snapshot__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .eco-snapshot-card {
        padding: 18px 16px;
    }

    .eco-empty-premium__actions {
        flex-direction: row;
        align-items: center;
    }

    .eco-empty-premium__actions .eco-btn {
        width: auto;
        min-width: 11rem;
    }

    .eco-card__actions .eco-btn {
        width: auto;
        min-width: 9.5rem;
    }
}

@media (min-width: 900px) {
    .eco-page-body {
        min-height: 78vh;
    }

    .eco-results-stage {
        min-height: 320px;
    }
}
