/* ═══════════════════════════════════════
   ForageIQ — Public Shortcode Styles
   ═══════════════════════════════════════ */

.fiq-pub {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1100px; margin: 0 auto; padding: 24px 0;
    color: #1a1a1a;
}

.fiq-pub-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.fiq-pub-title {
    font-size: 22px; font-weight: 800; margin: 0;
    background: linear-gradient(90deg, #16a34a, #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.fiq-pub-controls { display: flex; gap: 10px; }
.fiq-pub-select {
    padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; background: #fff; cursor: pointer;
}
.fiq-pub-select:focus { outline: none; border-color: #22c55e; }

/* Stats */
.fiq-pub-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 28px;
}
.fiq-pub-stat {
    background: #f9fafb; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 20px; text-align: center;
    transition: transform 0.2s;
}
.fiq-pub-stat:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.fiq-pub-stat-num { display: block; font-size: 34px; font-weight: 900; color: #1a1a1a; }
.fiq-pub-stat-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-top: 4px; }
.fiq-pub-stat--green .fiq-pub-stat-num { color: #16a34a; }
.fiq-pub-stat--blue .fiq-pub-stat-num { color: #2563eb; }

/* Sections */
.fiq-pub-section { margin-bottom: 36px; }
.fiq-pub-section-title {
    font-size: 18px; font-weight: 700; margin: 0 0 16px;
    padding-bottom: 8px; border-bottom: 3px solid #22c55e;
    display: inline-block;
}

/* Grid — CRITICAL: min-height:0 prevents grid items from growing infinitely */
.fiq-pub-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    min-height: 0;
}
.fiq-pub-grid > * { min-height: 0; min-width: 0; }
@media (max-width: 768px) { .fiq-pub-grid { grid-template-columns: 1fr; } }

/* Cards */
.fiq-pub-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 20px;
    overflow: hidden; /* prevent chart blowout */
}
.fiq-pub-card h4 { font-size: 14px; font-weight: 700; margin: 0 0 14px; color: #444; }

/* ── Chart Container — FIXES the infinite scroll bug ── */
.fiq-pub-chart-wrap {
    position: relative;
    width: 100%;
    height: 260px; /* fixed height stops Chart.js resize loop */
    overflow: hidden;
}
.fiq-pub-chart-wrap canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Tables */
.fiq-pub-table-wrap { overflow-x: auto; }
.fiq-pub-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fiq-pub-table th {
    text-align: left; padding: 10px 12px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
    color: #888; background: #f9fafb; border-bottom: 2px solid #e5e7eb;
}
.fiq-pub-table td {
    padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
    color: #555; font-variant-numeric: tabular-nums;
}
.fiq-pub-table tbody tr:hover td { background: #f9fdf9; }
.fiq-pub-highlight { font-weight: 700; color: #16a34a !important; }
.fiq-pub-highlight-blue { font-weight: 700; color: #2563eb !important; }

/* Tags */
.fiq-pub-tag-purple {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: #ede9fe; color: #6d28d9;
}

/* Compare Bars */
.fiq-pub-compare-item { margin-bottom: 14px; }
.fiq-pub-compare-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.fiq-pub-compare-label { font-size: 13px; font-weight: 600; color: #333; }
.fiq-pub-compare-value { font-size: 13px; }
.fiq-pub-compare-val { font-weight: 800; }
.fiq-pub-compare-diff { font-size: 12px; margin-left: 6px; }
.fiq-pub-compare-diff.positive { color: #16a34a; }
.fiq-pub-compare-diff.negative { color: #dc2626; }
.fiq-pub-compare-track {
    height: 22px; background: #f3f4f6; border-radius: 11px;
    position: relative; overflow: visible;
}
.fiq-pub-compare-fill {
    height: 100%; border-radius: 11px;
    transition: width 0.8s ease;
}
.fiq-pub-compare-pool {
    position: absolute; top: -3px; bottom: -3px; width: 3px;
    background: #f59e0b; border-radius: 2px; z-index: 2;
}

/* Empty */
.fiq-pub-empty {
    text-align: center; padding: 60px 24px;
    color: #999; font-size: 15px;
}

/* Notice */
.fiq-pub-notice {
    text-align: center; padding: 40px; background: #fef3c7;
    border: 1px solid #fbbf24; border-radius: 12px;
    font-size: 15px; color: #92400e;
}
.fiq-pub-notice a { color: #b45309; font-weight: 700; text-decoration: underline; }
.fiq-pub-notice--warning {
    text-align: left; background: #fff7ed;
    border-color: #fb923c; color: #7c2d12; line-height: 1.8;
}
.fiq-pub-notice--warning code {
    background: #fed7aa; padding: 2px 8px; border-radius: 4px;
    font-size: 13px; color: #7c2d12;
}
