/* ═══════════════════════════════════════════════════════════════════
 * Enhanced Candle Patterns Header
 * Adds: trend badge, confidence bar, strength label, excluded count
 * ═══════════════════════════════════════════════════════════════════ */


/* ─── Container ─── */
.cp-header-enhanced {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ─── Top Row: Trend + Consensus ─── */
.cp-header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}


/* ─── Trend Badge ─── */
.cp-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid currentColor;
    transition: all 0.2s ease;
    white-space: nowrap;
}


/* ─── Consensus (existing class - just inherit) ─── */
.cp-header-enhanced .cp-consensus {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
}


/* ─── Counter-trend Warning ─── */
.cp-counter-trend {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 5px 10px;
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.cp-with-trend {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 5px 10px;
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

/* 🆕 Counter-narrator warning — same logic as card banner.
   Color reflects the pattern direction (the suggested reversal). */
.cp-counter-narrator {
    margin-top: 6px;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid;
}
.cp-counter-narrator.cp-cn-bullish {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.06));
    border-color: rgba(34, 197, 94, 0.65);
    color: #86efac;
}
.cp-counter-narrator.cp-cn-bullish.cp-cn-strong {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(34, 197, 94, 0.08));
    border-color: rgba(34, 197, 94, 0.85);
    color: #bbf7d0;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}
.cp-counter-narrator.cp-cn-bearish {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.06));
    border-color: rgba(239, 68, 68, 0.65);
    color: #fca5a5;
}
.cp-counter-narrator.cp-cn-bearish.cp-cn-strong {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(239, 68, 68, 0.08));
    border-color: rgba(239, 68, 68, 0.85);
    color: #fecaca;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}


/* ─── Scores Row ─── */
.cp-header-enhanced .cp-scores {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 6px 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.cp-header-enhanced .cp-buy-score {
    color: #10b981;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.cp-header-enhanced .cp-sell-score {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}


/* ─── Stats Row: 3 boxes (Confidence, Strength, Excluded) ─── */
.cp-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 8px;
}

.cp-stat-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    min-width: 0;
    transition: all 0.2s ease;
}

.cp-stat-box:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(99, 102, 241, 0.3);
    cursor: help;
}

.cp-stat-label {
    font-size: 0.7rem;
    color: rgba(203, 213, 225, 0.6);
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.cp-stat-value {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ─── Confidence Bar ─── */
.cp-confidence-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.cp-confidence-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.3s ease;
}


/* ─── Mobile Responsive ─── */
@media (max-width: 480px) {
    .cp-header-enhanced {
        padding: 10px;
        gap: 8px;
    }
    
    .cp-header-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .cp-trend-badge {
        text-align: center;
        justify-content: center;
        font-size: 0.75rem;
    }
    
    .cp-header-enhanced .cp-consensus {
        text-align: center;
        font-size: 0.9rem;
    }
    
    .cp-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .cp-stat-box {
        padding: 6px 4px;
    }
    
    .cp-stat-label {
        font-size: 0.65rem;
    }
    
    .cp-stat-value {
        font-size: 0.78rem;
    }
}
