/* ==========================================================
   Insights Content Stylesheet
   Semantic classes for Claude-generated content in the
   InsightsWidget. Replaces inline styles in TinyMCE HTML.

   Scoped: these classes only work inside .ins-card-content
   (the InsightsWidget card body). Won't leak to other widgets.

   Dark mode: [data-theme="dark"] overrides at bottom.
   ========================================================== */

/* ----------------------------------------------------------
   SHARED: Colors (light mode defaults)
   ---------------------------------------------------------- */
:root {
    --op-content-text: #1a2a3a;
    --op-content-text-secondary: #4a5e70;
    --op-content-text-muted: #8899aa;
    --op-content-bg: #ffffff;
    --op-content-bg-subtle: #f5f7fa;
    --op-content-border: #D8DFE8;
    --op-content-brand: #0068b3;
    --op-content-brand-green: #7AC143;
    --op-content-up: #5fa332;
    --op-content-down: #d62728;
    --op-content-warn: #c49b00;
    --op-content-framework-red: #d62728;
    --op-content-framework-yellow: #b8860b;
    --op-content-framework-green: #5fa332;
}

/* ----------------------------------------------------------
   DAILYPLAY: Trade Ideas
   ---------------------------------------------------------- */

/* Section header with emoji — "The Income Generators", etc. */
.op-section-header {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 12px 0 4px;
    color: var(--op-content-text);
}

/* ----------------------------------------------------------
   Trade Card — mirrors StrategyCard (sc-medium) visual
   ---------------------------------------------------------- */

/* Trade card wrapper — matches sc-medium */
.op-trade-card {
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
    transition: box-shadow 0.2s;
}

.op-trade-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Trade header — matches sc-medium-header */
.op-trade-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--op-content-bg-subtle);
    border-bottom: 1px solid var(--op-content-border);
}

.op-trade-header-info {
    flex: 1;
    min-width: 0;
}

/* Badges row — sentiment + symbol */
.op-trade-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.op-trade-sentiment {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 3px;
}

.op-trade-sentiment-bullish {
    background: rgba(79, 122, 52, 0.15);
    color: var(--op-content-up);
}

.op-trade-sentiment-bearish {
    background: rgba(214, 39, 40, 0.15);
    color: var(--op-content-down);
}

.op-trade-symbol {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--op-content-text);
}

/* Trade title — "CCJ ($115.54) — Powering the AI Grid" */
.op-trade-title {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--op-content-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.op-trade-subtitle {
    font-size: 0.75rem;
    color: var(--op-content-text-secondary);
    margin-top: 2px;
}

/* Trade body — content below header */
.op-trade-body {
    padding: 12px 14px;
}

/* Legs box — structured display of buy/sell legs */
.op-trade-legs {
    background: var(--op-content-bg-subtle);
    border: 1px solid var(--op-content-border);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 0.8rem;
    line-height: 1.6;
}

.op-trade-legs-title {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--op-content-text-muted);
    margin-bottom: 4px;
}

/* Buy/Sell leg colors */
.op-leg-buy {
    color: var(--op-content-up);
    font-weight: 700;
}

.op-leg-sell {
    color: var(--op-content-down);
    font-weight: 700;
}

/* Metrics grid — matches sc-metrics / metric-box */
.op-trade-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
    margin: 10px 0;
}

.op-trade-metric-box {
    text-align: center;
    padding: 6px 4px;
    background: var(--op-content-bg-subtle);
    border-radius: 4px;
}

.op-trade-metric-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--op-content-text-muted);
    font-weight: 600;
}

.op-trade-metric-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--op-content-text);
    font-variant-numeric: tabular-nums;
}

/* Thesis / narrative sections */
.op-trade-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--op-content-text-muted);
    font-weight: 600;
    margin: 10px 0 4px;
}

.op-trade-narrative {
    font-size: 0.85rem;
    color: var(--op-content-text-secondary);
    line-height: 1.6;
    margin: 4px 0;
}

/* Technicals bar — left-border accent like sc-plain-english */
.op-trade-technicals {
    font-size: 0.8rem;
    color: var(--op-content-text-secondary);
    line-height: 1.5;
    border-left: 3px solid var(--op-content-border);
    padding: 6px 10px;
    margin: 8px 0;
}

/* Management checklist — matches sc-checklist */
.op-trade-mgmt {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.op-trade-mgmt li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--op-content-text-secondary);
}

.op-trade-mgmt li:last-child {
    border-bottom: none;
}

.op-mgmt-dot {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-top: 4px;
}

.op-mgmt-dot-warn { background: #f59e0b; }
.op-mgmt-dot-stop { background: #dc3545; }
.op-mgmt-dot-target { background: #4f7a34; }

/* CTA button — "View Trade in OptionsPlay" */
.op-cta-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--op-content-brand);
    color: #ffffff !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.op-cta-btn:hover {
    background: #005a9e;
    text-decoration: none;
}

/* Warning callout */
.op-callout-warning {
    background: #fff3cd;
    border-left: 4px solid var(--op-content-warn);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--op-content-text);
    margin: 8px 0;
}

/* Research overview section at bottom */
.op-research-overview {
    font-size: 0.85rem;
    color: var(--op-content-text-secondary);
    line-height: 1.6;
    margin: 12px 0;
}

/* ----------------------------------------------------------
   MARKET INSIGHT: Newsletter
   ---------------------------------------------------------- */

/* Branded header bar */
.op-insight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 3px solid var(--op-content-brand-green);
    margin-bottom: 16px;
}

.op-insight-header img {
    height: 34px;
}

.op-insight-header-right {
    text-align: right;
    color: var(--op-content-brand);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Context tagline — date, day count, framework status */
.op-context-line {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--op-content-text-muted);
    margin: 4px 0;
}

/* Hero section */
.op-hero {
    margin-bottom: 20px;
}

.op-hero-overline {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.op-hero-headline {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--op-content-text);
    letter-spacing: -0.3px;
    line-height: 1.25;
    margin-bottom: 6px;
}

.op-hero-body {
    font-size: 0.85rem;
    color: var(--op-content-text-secondary);
    line-height: 1.55;
}

/* Ticker strip — horizontal row of market data cells */
.op-ticker-strip {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
}

.op-ticker-cell {
    flex: 1 1 0;
    min-width: 80px;
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid var(--op-content-border);
}

.op-ticker-cell:last-child {
    border-right: none;
}

.op-ticker-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--op-content-text-muted);
}

.op-ticker-value {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 2px;
}

.op-ticker-change {
    font-size: 0.65rem;
    margin-top: 1px;
}

/* Ticker direction colors */
.op-tick-up {
    color: var(--op-content-up);
}

.op-tick-down {
    color: var(--op-content-down);
}

.op-tick-neutral {
    color: var(--op-content-warn);
}

/* Section divider — "MARKET OVERVIEW", "VOLATILITY", etc. */
.op-section-divider {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--op-content-brand);
    margin: 20px 0 10px;
}

/* Info card — bordered box for narrative sections */
.op-info-card {
    background: var(--op-content-bg-subtle);
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 8px 0;
    font-size: 0.85rem;
    color: var(--op-content-text-secondary);
    line-height: 1.6;
}

/* Accent left border variants */
.op-info-card-green {
    border-left: 4px solid var(--op-content-up);
}

.op-info-card-blue {
    border-left: 4px solid var(--op-content-brand);
}

.op-info-card-red {
    border-left: 4px solid var(--op-content-down);
}

.op-info-card-yellow {
    border-left: 4px solid var(--op-content-warn);
}

/* Info card title */
.op-info-card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

/* Scorecard — row of metric cards */
.op-scorecard {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.op-score-cell {
    flex: 1 1 0;
    min-width: 100px;
    background: var(--op-content-bg-subtle);
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    padding: 10px;
}

.op-score-cell-green {
    border-top: 3px solid var(--op-content-up);
}

.op-score-cell-yellow {
    border-top: 3px solid var(--op-content-warn);
}

.op-score-cell-red {
    border-top: 3px solid var(--op-content-down);
}

.op-score-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--op-content-text-muted);
}

.op-score-value {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 3px;
}

.op-score-detail {
    font-size: 0.7rem;
    margin-top: 2px;
}

.op-score-note {
    font-size: 0.65rem;
    margin-top: 3px;
}

/* Framework indicator — RED / YELLOW / GREEN status */
.op-framework {
    display: inline-flex;
    gap: 6px;
    margin: 10px 0;
}

.op-framework-card {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    font-size: 0.8rem;
}

.op-framework-card-active {
    font-weight: 700;
}

.op-framework-red {
    border-color: var(--op-content-framework-red);
    color: var(--op-content-framework-red);
}

.op-framework-yellow {
    border-color: var(--op-content-framework-yellow);
    color: var(--op-content-framework-yellow);
}

.op-framework-green {
    border-color: var(--op-content-framework-green);
    color: var(--op-content-framework-green);
}

/* Data card — side-by-side stat blocks */
.op-data-cards {
    display: flex;
    gap: 6px;
    margin: 10px 0;
}

.op-data-card {
    flex: 1;
    background: var(--op-content-bg-subtle);
    border: 1px solid var(--op-content-border);
    border-radius: 8px;
    padding: 12px 14px;
}

.op-data-card-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--op-content-text-muted);
    margin-bottom: 4px;
}

.op-data-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.op-data-card-note {
    font-size: 0.75rem;
    color: var(--op-content-text-secondary);
}

/* Futures curve strip */
.op-futures-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.op-futures-cell {
    flex: 1 1 0;
    min-width: 80px;
    text-align: center;
    padding: 8px;
    border: 1px solid var(--op-content-border);
    border-radius: 6px;
}

.op-futures-active {
    border-color: var(--op-content-down);
}

.op-futures-arrow {
    font-size: 0.8rem;
    color: var(--op-content-text-muted);
    flex: 0 0 auto;
}

.op-futures-month {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.op-futures-price {
    font-size: 1rem;
    font-weight: 700;
    margin: 2px 0;
}

.op-futures-change {
    font-size: 0.7rem;
}

/* Callout box — highlighted analysis block */
.op-callout-box {
    background: #fffbeb;
    border: 1px solid #E8E0A0;
    border-left: 4px solid var(--op-content-warn);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    font-size: 0.85rem;
    color: var(--op-content-text);
    line-height: 1.6;
}

.op-callout-box-red {
    background: #fef2f2;
    border-color: #fca5a5;
    border-left-color: var(--op-content-down);
}

/* Day counter — "Day 12" large number */
.op-day-counter {
    text-align: center;
}

.op-day-counter-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--op-content-text-muted);
}

.op-day-counter-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--op-content-text);
    line-height: 1;
}

/* ----------------------------------------------------------
   WEBINAR: Event Promos
   ---------------------------------------------------------- */

.op-event-desc {
    text-align: left;
    font-size: 0.9rem;
    color: var(--op-content-text-secondary);
    line-height: 1.7;
    margin: 10px 0;
}

.op-event-desc strong {
    display: block;
    text-align: center;
    font-size: 1rem;
    color: var(--op-content-text);
    margin-bottom: 8px;
}

.op-promo-img {
    display: block;
    max-width: 350px;
    margin: 12px auto;
    border-radius: 8px;
}

/* ----------------------------------------------------------
   SHARED: Responsive
   ---------------------------------------------------------- */

/* Narrow widget — stack ticker cells, scorecard */
@media (max-width: 400px) {
    .op-ticker-strip {
        flex-direction: column;
    }
    .op-ticker-cell {
        border-right: none;
        border-bottom: 1px solid var(--op-content-border);
    }
    .op-scorecard {
        flex-direction: column;
    }
    .op-data-cards {
        flex-direction: column;
    }
    .op-futures-strip {
        flex-direction: column;
    }
}

/* ----------------------------------------------------------
   DARK MODE
   ---------------------------------------------------------- */

[data-theme="dark"] {
    --op-content-text: #e5e7eb;
    --op-content-text-secondary: #9ca3af;
    --op-content-text-muted: #6b7280;
    --op-content-bg: #1f2937;
    --op-content-bg-subtle: #283040;
    --op-content-border: #374151;
    --op-content-brand: #60a5fa;
    --op-content-brand-green: #6fcf47;
    --op-content-up: #6fcf47;
    --op-content-down: #f87171;
    --op-content-warn: #fbbf24;
    --op-content-framework-red: #f87171;
    --op-content-framework-yellow: #fbbf24;
    --op-content-framework-green: #6fcf47;
}

[data-theme="dark"] .op-cta-btn {
    background: #2563eb;
}

[data-theme="dark"] .op-cta-btn:hover {
    background: #1d4ed8;
}

[data-theme="dark"] .op-callout-warning {
    background: #422006;
    border-left-color: var(--op-content-warn);
    color: var(--op-content-text);
}

[data-theme="dark"] .op-callout-box {
    background: #2d2a1a;
    border-color: #4a4520;
    border-left-color: var(--op-content-warn);
}

[data-theme="dark"] .op-callout-box-red {
    background: #2d1a1a;
    border-color: #4a2020;
    border-left-color: var(--op-content-down);
}

[data-theme="dark"] .op-trade-sentiment-bullish {
    background: rgba(111, 207, 71, 0.15);
}

[data-theme="dark"] .op-trade-sentiment-bearish {
    background: rgba(248, 113, 113, 0.15);
}
