/* ============================================
   MARKETING ANALYTICS — Module Styles
   Builds on CTC Dash design tokens & components
   Shared module styles (KPIs, funnel, pills, etc.)
   now live in core/static/css/module-shared.css
   ============================================ */

/* ── Platform Badges ─────────────────────── */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.18em 0.6em;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.platform-facebook {
    background: rgba(24, 119, 242, 0.1);
    color: #1877F2;
    border: 1px solid rgba(24, 119, 242, 0.2);
}

.platform-google, .platform-google_ads {
    background: rgba(66, 133, 244, 0.1);
    color: #4285F4;
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.platform-google_organic {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.platform-organic, .platform-direct {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.platform-instagram, .platform-ig {
    background: rgba(225, 48, 108, 0.1);
    color: #E1306C;
    border: 1px solid rgba(225, 48, 108, 0.2);
}

[data-theme="dark"] .platform-facebook {
    background: rgba(24, 119, 242, 0.18);
    color: #5aa7ff;
}
[data-theme="dark"] .platform-google,
[data-theme="dark"] .platform-google_ads {
    background: rgba(66, 133, 244, 0.18);
    color: #7ab3ff;
}
[data-theme="dark"] .platform-google_organic {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}
[data-theme="dark"] .platform-instagram,
[data-theme="dark"] .platform-ig {
    background: rgba(225, 48, 108, 0.18);
    color: #f472b6;
}


/* ── Platform Toggle ─────────────────────── */
.platform-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.platform-toggle a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.4rem 0.9rem;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: calc(var(--radius-md) - 3px);
    text-decoration: none;
    transition: all 0.2s ease;
}

.platform-toggle a:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

.platform-toggle a.active {
    color: var(--text-inverse);
    background: var(--accent);
}

.platform-toggle .fb-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #1877F2; display: inline-block;
}

.platform-toggle .gads-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4285F4; display: inline-block;
}


/* ── Marketing Funnel Stage Colors ────────── */
.funnel-stage-1 .funnel-bar { background: var(--accent); }
.funnel-stage-2 .funnel-bar { background: #3b82f6; }
.funnel-stage-3 .funnel-bar { background: #8b5cf6; }
.funnel-stage-4 .funnel-bar { background: #6366f1; }
.funnel-stage-5 .funnel-bar { background: #14b8a6; }
.funnel-stage-6 .funnel-bar { background: #10b981; }
.funnel-stage-7 .funnel-bar { background: #ef4444; }
.funnel-stage-8 .funnel-bar { background: var(--accent-deep); }
.funnel-stage-9 .funnel-bar { background: #f97316; }


/* ── Channel Table ───────────────────────── */
.channel-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.channel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.channel-dot.facebook { background: #1877F2; }
.channel-dot.google_ads { background: #4285F4; }
.channel-dot.google_organic { background: #34A853; }
.channel-dot.instagram, .channel-dot.ig { background: #E1306C; }
.channel-dot.organic { background: #10b981; }
.channel-dot.direct { background: #6b7280; }

.mkt-conv-rate {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.88rem;
}

.mkt-conv-rate.good { color: var(--status-success); }
.mkt-conv-rate.mid { color: var(--status-warning); }
.mkt-conv-rate.low { color: var(--status-danger); }


/* ── Spend Mini Chart ────────────────────── */
.spend-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding: 0.5rem 0;
}

.spend-chart-bar {
    flex: 1;
    min-width: 3px;
    border-radius: 3px 3px 0 0;
    position: relative;
    cursor: default;
    transition: opacity 0.15s;
}

.spend-chart-bar:hover {
    opacity: 0.85;
}

.spend-chart-bar .fb-segment {
    background: #1877F2;
    border-radius: 3px 3px 0 0;
}

.spend-chart-bar .gads-segment {
    background: #4285F4;
}

.spend-chart-bar.fb-only { background: #1877F2; }
.spend-chart-bar.gads-only { background: #4285F4; }
.spend-chart-bar.mixed { background: linear-gradient(to top, #4285F4 50%, #1877F2 50%); }

.spend-chart-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-1);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-card);
}

.spend-chart-bar:hover .spend-chart-tooltip {
    display: block;
}


/* ── Star Rating ─────────────────────────── */
.stars-display {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.stars-display .star {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.stars-display .star.filled {
    color: #f59e0b;
    fill: #f59e0b;
}

.stars-display .star.half {
    color: #f59e0b;
}

.star-big {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #f59e0b;
    line-height: 1;
}

.star-sub {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rating-dist-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.rating-dist-label {
    flex: 0 0 24px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.rating-dist-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--surface-4);
    border-radius: 100px;
    overflow: hidden;
}

.rating-dist-bar {
    height: 100%;
    border-radius: 100px;
    background: #f59e0b;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rating-dist-count {
    flex: 0 0 36px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}


/* ── Review Card ─────────────────────────── */
.review-item {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
}

.review-item:hover {
    border-color: var(--border-default);
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.review-author {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.review-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.review-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* ── Marketing-specific KPI colors ────────── */
.mkt-kpi-value.fb-color { color: #1877F2; }
.mkt-kpi-value.gads-color { color: #4285F4; }
