/* state-rates.css — /electricity-prices-by-state/ page styles */

/* Map */
.ecus-map-container { margin: 40px 0; }
.ecus-map-header { margin-bottom: 24px; }
.ecus-map-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; padding: 0; display: block; }
.ecus-map-subtitle { font-size: 15px; color: #6b7280; margin: 0; }
.ecus-map-wrapper { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; }
.ecus-map-svg { width: 100%; }
.ecus-map-svg svg { width: 100%; height: auto; }
.ecus-state { cursor: pointer; stroke: #fff; stroke-width: 1; transition: opacity 0.2s ease; }
.ecus-state:hover { opacity: 0.85; stroke-width: 2; }

.ecus-map-legend { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; }
.ecus-legend-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; margin: 0 0 12px; padding: 0; }
.ecus-legend-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.ecus-legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; transition: background 0.15s ease; }
.ecus-legend-item:hover { background: #f3f4f6; }
.ecus-legend-color { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.ecus-legend-color.cat-verylow { background: #10b981; }
.ecus-legend-color.cat-low { background: #34d399; }
.ecus-legend-color.cat-average { background: #fbbf24; }
.ecus-legend-color.cat-moderate { background: #f97316; }
.ecus-legend-color.cat-high { background: #ef4444; }
.ecus-legend-color.cat-veryhigh { background: #991b1b; }
.ecus-legend-label { font-size: 13px; font-weight: 600; color: #374151; }
.ecus-legend-range { font-size: 12px; color: #9ca3af; margin-left: auto; }

.ecus-stats-box { border-top: 1px solid #e5e7eb; padding-top: 16px; }
.ecus-stats-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; margin: 0 0 10px; padding: 0; }
.ecus-stat-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 13px; }
.ecus-stat-row .ecus-stat-label { color: #6b7280; }
.ecus-stat-row .ecus-stat-value { font-weight: 700; color: #374151; }
.ecus-stat-row .ecus-stat-value.low { color: #16a34a; }
.ecus-stat-row .ecus-stat-value.high { color: #dc2626; }

.ecus-map-tooltip {
    position: absolute; z-index: 100; pointer-events: none;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 12px 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    opacity: 0; transition: opacity 0.15s ease;
    min-width: 180px;
}
.ecus-map-tooltip.ecus-visible { opacity: 1; }
.ecus-tooltip-state { font-size: 15px; font-weight: 700; color: #1f1f1f; display: block; margin-bottom: 4px; }
.ecus-tooltip-rate-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; }
.ecus-tooltip-rate-value { font-size: 22px; font-weight: 800; color: #1f1f1f; margin: 2px 0 6px; }
.ecus-tooltip-comparison { font-size: 12px; color: #6b7280; }
.ecus-tooltip-comparison .higher { color: #dc2626; font-weight: 600; }
.ecus-tooltip-comparison .lower { color: #16a34a; font-weight: 600; }

/* Table styles */
.ec-rate-change { font-weight: 600; font-size: 13px; }
.ec-rate-change--up { color: #dc2626; }
.ec-rate-change--down { color: #16a34a; }
.ec-table-highlight { background: #f0fdf4 !important; font-weight: 700; }
.ec-table-highlight td { font-weight: 700; color: #1f1f1f; }
.ec-table-search { display: flex; align-items: center; gap: 6px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px 12px; }
.ec-table-search i { color: #9ca3af; font-size: 16px; }
.ec-table-search input { border: none; background: transparent; outline: none; font-size: 14px; color: #374151; font-family: var(--body-font); width: 160px; }

/* Sortable table headers */
.ec-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.ec-sortable i { font-size: 12px; opacity: 0.4; margin-left: 4px; vertical-align: middle; transition: opacity 0.15s; }
.ec-sortable:hover i { opacity: 1; }

/* "Your State" auto-highlight */
.ec-your-state { background: #eff6ff !important; border-left: 3px solid #3b82f6; }
.ec-your-state td:first-child { padding-left: 9px; }

/* Charts & Regions */
.ec-chart-figure { margin: 32px 0; }
.ec-chart-figure figcaption { font-size: 13px; color: #6b7280; margin-top: 12px; text-align: center; }
.ec-chart-container { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px 24px 16px; overflow-x: auto; }
.ec-chart-container svg { width: 100%; height: auto; display: block; }
.ec-region-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.ec-region-card { background: #f9fafb; border: 1px solid #e5e7eb; border-left: 4px solid #e5e7eb; border-radius: 0 12px 12px 0; padding: 20px 24px; }
.ec-region-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.ec-region-name { font-size: 17px; font-weight: 700; margin: 0; padding: 0; color: #1f1f1f; }
.ec-region-rate { font-size: 20px; font-weight: 800; color: #1f1f1f; white-space: nowrap; }
.ec-region-vs { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.ec-region-vs strong { font-weight: 700; }
.ec-region-vs .above { color: #dc2626; }
.ec-region-vs .below { color: #16a34a; }
.ec-region-body { font-size: 14.5px; color: #4b5563; line-height: 1.7; margin: 0; }
.ec-region-card--red { border-left-color: #ef4444; }
.ec-region-card--orange { border-left-color: #f97316; }
.ec-region-card--yellow { border-left-color: #fbbf24; }
.ec-region-card--green { border-left-color: #34d399; }

/* Sticky Table of Contents */
.ec-toc {
    position: sticky;
    top: 72px;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
    margin: 0 0 24px;
}
.ec-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ec-toc ul::-webkit-scrollbar { display: none; }
.ec-toc a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.ec-toc a:hover { color: #1f1f1f; background: #e5e7eb; }
.ec-toc a.ec-toc-active { color: #fff; background: #7c3aed; }

/* Related Resources */
.ec-related { margin: 48px 0 32px; }
.ec-related h3 { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
.ec-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.ec-related-grid a {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
}
.ec-related-grid a:hover { background: #f3f4f6; border-color: #7c3aed; color: #7c3aed; }

/* Download link */
.ec-download-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #7c3aed;
    text-decoration: none;
}
.ec-download-link:hover { text-decoration: underline; }
.ec-download-link i { font-size: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .ecus-map-wrapper { grid-template-columns: 1fr; }
    .ecus-map-title { font-size: 20px; }
    .ec-chart-container { padding: 16px 12px; }
    .ec-region-card { padding: 16px 18px; }
    .ec-region-rate { font-size: 18px; }
    .ec-toc { margin: 0 0 20px; }
}
@media (max-width: 480px) {
    .ecus-map-legend { padding: 16px; }
}
