/* =====================================================================
   insights.css  -  Key Insights & Recommendations cards

   Load on EVERY page that renders insights (after style.css):
     <link rel="stylesheet" href="insights.css">

   Markup it styles (produced by renderInsights / generateInsights):
     <div class="hm-ins">
       <div class="hm-iic">ICON</div>
       <div>
         <div class="hm-ititle"><b>Title</b><span class="hm-tag">TAG</span></div>
         <p>Finding text</p>
         <strong>Recommendation: ...</strong>
       </div>
     </div>

   Colours use CSS variables with CourtIQ-blue fallbacks, so the cards
   follow the team theme when team-theme.js sets --accent / --border,
   and look correct with the default style.css when it doesn't.
   ===================================================================== */

/* ---------- containers (one per page) ---------- */

#insights,
#teamInsights,
#insightsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
}

/* ---------- card ---------- */

.hm-ins {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border, #1b4165);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    transition: border-color .15s ease, background .15s ease;
}

.hm-ins:hover {
    border-color: var(--accent, #35c5f4);
    background: rgba(255, 255, 255, .05);
}

/* text column */
.hm-ins > div:last-child {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- icon ---------- */

.hm-iic {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    border-radius: 10px;
    background: rgba(53, 197, 244, .12);
}

/* ---------- title + tag ---------- */

.hm-ititle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.hm-ititle b {
    font-size: 14px;
    line-height: 1.25;
    font-weight: 700;
    color: #fff;
}

.hm-tag {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--accent, #35c5f4);
    background: rgba(53, 197, 244, .14);
    border: 1px solid rgba(53, 197, 244, .35);
}

/* ---------- body text ---------- */

.hm-ins p {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.5;
    font-weight: 400;
    color: rgba(255, 255, 255, .82);
}

.hm-ins strong {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--accent, #35c5f4);
}

/* ---------- empty state ---------- */

.hm-empty {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
}

/* ---------- small screens ---------- */

@media (max-width: 650px) {
    #insights,
    #teamInsights,
    #insightsGrid {
        grid-template-columns: minmax(0, 1fr);
    }
    .hm-ins { padding: 12px 14px; }
}

/* =====================================================================
   SHARED INSIGHTS PANEL  (outer box + heading, same on every page)

   <section class="insights-panel">
     <h2><span class="bulb">💡</span> Key Insights &amp; Recommendations</h2>
     <div id="insightsGrid"></div>      <!-- or #insights / #teamInsights -->
   </section>
   ===================================================================== */

.insights-panel {
    min-width: 0;
    margin-top: 16px;
    padding: 20px 22px 22px;
    background: var(--surface, #091d36);
    border: 1px solid var(--border, #12578a);
    border-radius: 20px;
}

.insights-panel > h2,
.insights-panel > h3 {
    margin: 0 0 16px;
    font-size: 17px;
    line-height: 1.3;
    color: #eaf2ff;
}

.insights-panel .bulb { margin-right: 6px; }

/* equal-height cards in a row */
.insights-panel #insights,
.insights-panel #teamInsights,
.insights-panel #insightsGrid {
    align-items: stretch;
}