/* =============================================================================
   Supporter Visualization — Styles
   Reuses pv- carousel/lightbox classes from plantingvisualization.css and the
   lv- lightbox spinner from locationvisualization.css; adds the supporter
   selector, KPI row, multi-location map legend/labels (cloned from
   personvisualization.css), and the supporter info panel (cloned from
   locationvisualization.css's location info panel).
   ============================================================================= */

/* ── Supporter selector ─────────────────────────────────────────────────────── */

.sv-selector-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.sv-selector-field {
    flex: 1 1 16rem;
    min-width: 16rem;
}

/* ── No-supporter welcome state ──────────────────────────────────────────────── */

.sv-empty-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2px dashed #d6d3d1;
    border-radius: 16px;
    color: #a8a29e;
    gap: 0;
    text-align: center;
    padding: 2rem;
}

/* ── KPI row ────────────────────────────────────────────────────────────────── */

#sv-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1023px) {
    #sv-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    #sv-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Location legend chips (above the map) ───────────────────────────────────── */

.sv-location-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sv-location-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid #d6d3d1;
    background: #fff;
    color: #1c1917;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sv-location-chip:hover {
    border-color: #52b788;
    background: #f0fdf6;
    color: #1b4332;
}

.sv-location-chip i {
    color: #198754;
    font-size: 0.75rem;
}

.sv-location-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e7e5e4;
    color: #57534e;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ── Map ──────────────────────────────────────────────────────────────────────── */

.sv-map-wrap {
    border: 1px solid #e7e5e4;
}

/* Permanent location-name label on the map (Leaflet tooltip) */
.sv-location-label {
    background: rgba(27, 67, 50, 0.92) !important;
    border: none !important;
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.sv-location-label::before {
    border-top-color: rgba(27, 67, 50, 0.92) !important;
}

/* ── Timeline dropdown ──────────────────────────────────────────────────────── */

.sv-timeline-dropdown-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 32rem;
}

.sv-dropdown-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #57534e;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sv-dropdown-with-swatch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sv-dropdown-with-swatch .form-input {
    flex: 1;
}

.sv-planting-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #d6d3d1;
    flex-shrink: 0;
    transition: background 0.2s;
    border: 2px solid rgba(0,0,0,0.08);
}

.sv-planting-swatch.sv-swatch-hidden {
    visibility: hidden;
}

/* ── Supporter info panel ─────────────────────────────────────────────────────── */

.sv-supporter-info-panel {
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
    overflow: hidden;
}

.sv-supporter-photo {
    float: left;
    width: 48%;
    aspect-ratio: 1 / 1;
    margin: 0 0.75rem 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sv-supporter-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sv-supporter-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #1b4332 0%, #40916c 100%);
    color: rgba(255, 255, 255, 0.45);
}

.sv-supporter-photo-placeholder i {
    font-size: 1.75rem;
}

.sv-supporter-photo-placeholder span {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.sv-supporter-panel-body {
    padding: 0.875rem 1rem 1rem;
    overflow: hidden; /* clearfix for the float */
}

.sv-supporter-description {
    font-size: 0.76rem;
    color: #78716c;
    line-height: 1.55;
    margin-bottom: 0.25rem;
}

/* ── Social / links section ─────────────────────────────────────────────────── */

.sv-social-section {
    margin-top: auto;
    padding-top: 0.625rem;
    border-top: 1px solid #f5f5f4;
}

.sv-social-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.4rem;
}

.sv-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sv-social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.77rem;
    color: #57534e;
    text-decoration: none;
    padding: 0.15rem 0;
    transition: color 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.sv-social-link:hover {
    color: #1b4332;
}

.sv-social-link i {
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    color: #a8a29e;
}

.sv-social-link:hover i {
    color: #2d6a4f;
}

.sv-social-link span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Responsive ───────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .sv-map-wrap {
        min-height: 320px !important;
    }
}

/* ── Responsive: stack info panel above map on narrow screens ────────────────── */

@media (max-width: 1023px) {
    #sv-info-map-row {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .sv-supporter-photo {
        width: 40%;
    }
}

@media (max-width: 640px) {
    .sv-supporter-info-panel {
        display: none;
    }
}
