/* ============================================================
   COMPATIBILITY RADAR CHART
   Matches the Dragon personality page radar style:
   - Bold Cinzel labels outside the chart
   - Subtitle words below each label
   - Hover highlights label + enlarges dot
   - Tooltip triggers on label hover
   - Expandable bar rows with pair-specific blurbs
   ============================================================ */

.cp-radar-section {
    padding-top: 1rem;
}

.cp-radar-wrap {
    max-width: 900px;
    margin: 0 auto;
}

/* Header: match type + overall score */
.cp-radar-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.cp-radar-match-type {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 234, 214, 0.5);
    margin-bottom: 0.25rem;
}

.cp-radar-overall {
    font-family: 'Cinzel', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-accent, #E8C547);
    line-height: 1;
}

.cp-radar-overall-label {
    font-size: 0.75rem;
    color: rgba(240, 234, 214, 0.4);
    margin-top: 0.15rem;
}

/* SVG chart container -- overflow visible so labels don't clip */
.cp-radar-chart-area {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 1rem;
    overflow: visible;
    padding: 0 1rem;
}

.cp-radar-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    overflow: visible;
}

/* Tooltip -- structured card like the Dragon page */
.cp-radar-tooltip {
    position: absolute;
    background: rgba(18, 18, 36, 0.96);
    border: 1px solid rgba(232, 197, 71, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    pointer-events: none;
    max-width: 280px;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.cp-radar-tip-header {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(240, 234, 214, 0.5);
    margin-bottom: 4px;
}

.cp-radar-tip-score {
    margin-bottom: 6px;
}

.cp-radar-tip-word {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #E8C547;
}

.cp-radar-tip-score {
    font-size: 0.85rem;
    color: rgba(240, 234, 214, 0.6);
}

.cp-radar-tip-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(240, 234, 214, 0.7);
    margin-bottom: 8px;
}

/* Dragon-page-style word scale inside tooltip */
.cp-radar-tip-scale {
    border-top: 1px solid rgba(232, 197, 71, 0.1);
    padding-top: 8px;
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
}

.cp-radar-tip-scale-row {
    font-size: 0.68rem;
    color: rgba(240, 234, 214, 0.25);
    padding: 1px 0;
    white-space: nowrap;
}

.cp-radar-tip-scale-row::after {
    content: '\203A';
    margin: 0 5px;
    opacity: 0.3;
}

.cp-radar-tip-scale-row:last-child::after {
    display: none;
}

.cp-radar-tip-scale-row--active {
    color: #E8C547;
    font-weight: 600;
}

.cp-radar-tip-scale-row--active::after {
    opacity: 0.6;
}

.cp-radar-tip-scale-word {
    /* just the word, no extra styling needed */
}

.cp-radar-tip-scale-marker {
    display: none;
}

/* Insight cards: biggest strength + challenge */
.cp-radar-insights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 1rem 0;
}

.cp-radar-insight-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(232, 197, 71, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
}

.cp-radar-insight-label {
    font-size: 0.7rem;
    color: rgba(240, 234, 214, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.cp-radar-insight-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.cp-radar-insight-value--strength {
    color: var(--color-accent, #E8C547);
}

.cp-radar-insight-value--challenge {
    color: #c97a5a;
}

/* Bar chart breakdown */
.cp-radar-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 1rem;
}

.cp-radar-bar-row {
    border-radius: 8px;
    transition: background 0.15s ease;
}

.cp-radar-bar-row:hover {
    background: rgba(232, 197, 71, 0.04);
}

.cp-radar-bar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
}

.cp-radar-bar-label {
    font-size: 0.8rem;
    color: rgba(240, 234, 214, 0.5);
    width: 140px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-radar-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(232, 197, 71, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.cp-radar-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cp-radar-bar-fill--animated {
    width: var(--bar-target);
}

/* Color coding by score level */
.cp-radar-bar-fill--high {
    background: #4ade80;
}

.cp-radar-bar-fill--good {
    background: var(--color-accent, #E8C547);
}

.cp-radar-bar-fill--mid {
    background: #f59e0b;
}

.cp-radar-bar-fill--low {
    background: #f87171;
}

.cp-radar-bar-score {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(240, 234, 214, 0.8);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

/* ============================================================
   EXPANDABLE BAR ROWS
   Bars with blurbs show a chevron indicator.
   Clicking expands/collapses a BaZi-grounded explanation.
   ============================================================ */

.cp-radar-bar-row--expandable {
    cursor: pointer;
}

.cp-radar-bar-row--expandable:hover {
    background: rgba(232, 197, 71, 0.06);
}

/* Chevron indicator */
.cp-radar-bar-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(240, 234, 214, 0.3);
    transition: transform 0.2s ease, border-top-color 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.cp-radar-bar-row--open .cp-radar-bar-chevron {
    transform: rotate(180deg);
    border-top-color: var(--color-accent, #E8C547);
}

/* Blurb content area */
.cp-radar-bar-blurb {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
    padding: 0 12px 0 12px;
}

.cp-radar-bar-row--open .cp-radar-bar-blurb {
    max-height: 300px;
    opacity: 1;
    padding: 0 12px 12px 12px;
}

.cp-radar-bar-blurb p {
    font-size: 0.82rem;
    line-height: 1.55;
    color: rgba(240, 234, 214, 0.65);
    margin: 0;
    border-left: 2px solid rgba(232, 197, 71, 0.15);
    padding-left: 12px;
}

/* Highlight the expanded row */
.cp-radar-bar-row--open {
    background: rgba(232, 197, 71, 0.04);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .cp-radar-bar-label {
        width: 110px;
        font-size: 0.75rem;
    }

    .cp-radar-insights {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cp-radar-overall {
        font-size: 1.75rem;
    }

    .cp-radar-svg {
        max-width: 360px;
    }

    .cp-radar-bar-blurb p {
        font-size: 0.78rem;
    }

    .cp-radar-bar-row--open .cp-radar-bar-blurb {
        max-height: 400px;
    }
}