/**
 * ActProof.ai - Score Transparency & Risk Quantification Styles
 */

/* ============================================
   Score Breakdown Tooltip
   ============================================ */

.score-card-hero.has-tooltip {
    cursor: pointer;
    position: relative;
}

.score-card-hero.has-tooltip:hover {
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg);
}

.score-breakdown-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    margin-top: 1rem;
    animation: tooltipSlideIn 0.2s ease-out;
}

.score-breakdown-container.hidden {
    display: none;
}

@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.score-breakdown-tooltip {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 480px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.2);
    backdrop-filter: blur(10px);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.tooltip-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tooltip-total {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breakdown-legend {
    display: grid;
    grid-template-columns: 24px 1fr 80px 50px 50px 60px;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 24px 1fr 80px 50px 50px 60px;
    gap: 0.5rem;
    padding: 0.5rem 0;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.breakdown-row:hover {
    background: rgba(124, 58, 237, 0.1);
    border-radius: 6px;
}

.breakdown-row.complete .breakdown-icon {
    color: var(--success);
}

.breakdown-row.partial .breakdown-icon {
    color: var(--warning);
}

.breakdown-row.missing .breakdown-icon {
    color: var(--error);
}

.breakdown-icon {
    font-size: 1rem;
    text-align: center;
}

.breakdown-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.breakdown-article {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-family: var(--font-mono);
}

.breakdown-weight {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: right;
}

.breakdown-score {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.breakdown-weighted {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 500;
    text-align: right;
}

.breakdown-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    text-align: center;
}

.breakdown-footer small {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

/* ============================================
   Fine Risk Widget
   ============================================ */

.fine-risk-widget {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.fine-risk-widget.risk-critical {
    border-color: var(--error);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.fine-risk-widget.risk-high {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.fine-risk-widget.risk-medium {
    border-color: var(--info);
}

.fine-risk-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fine-risk-header svg {
    color: var(--warning);
}

.risk-critical .fine-risk-header svg {
    color: var(--error);
}

.fine-risk-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.fine-risk-amount {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.fine-risk-amount .fine-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--warning);
}

.risk-critical .fine-risk-amount .fine-value {
    color: var(--error);
}

.fine-risk-amount .fine-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.fine-risk-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fine-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
}

.fine-detail .detail-label {
    color: var(--text-tertiary);
}

.fine-detail .detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.fine-detail.issues .detail-value {
    color: var(--error);
}

.fine-risk-source {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.fine-risk-source small {
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

/* ============================================
   Benchmark Widget
   ============================================ */

.benchmark-widget {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.6) 0%, rgba(17, 24, 39, 0.8) 100%);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.benchmark-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.benchmark-header svg {
    color: var(--primary-light);
}

.benchmark-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.benchmark-comparison {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.benchmark-your-score,
.benchmark-industry-score {
    text-align: center;
}

.benchmark-your-score .score-value,
.benchmark-industry-score .score-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.benchmark-your-score .score-value {
    color: var(--primary-light);
}

.benchmark-industry-score .score-value {
    color: var(--text-secondary);
}

.benchmark-your-score .score-label,
.benchmark-industry-score .score-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.benchmark-vs {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
}

.benchmark-delta {
    text-align: center;
    margin-bottom: 1rem;
}

.benchmark-delta .delta-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.benchmark-delta.positive .delta-value {
    color: var(--success);
}

.benchmark-delta.negative .delta-value {
    color: var(--error);
}

.benchmark-delta .delta-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.benchmark-percentile {
    margin-bottom: 1rem;
}

.percentile-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.percentile-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.percentile-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: var(--primary-light);
    border: 2px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.5);
}

.percentile-label {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.benchmark-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid var(--success);
    border-radius: 20px;
    color: var(--success);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.benchmark-badge.top25 svg {
    color: #fbbf24;
}

.benchmark-message {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   Summary Content Layout Updates
   ============================================ */

.summary-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .summary-content {
        grid-template-columns: 1fr;
    }
}

.summary-content > .score-card-hero {
    grid-column: 1;
}

.summary-content > .quick-actions {
    grid-column: 2;
    grid-row: 1;
}

.summary-content > #fineRiskWidget {
    grid-column: 1;
}

.summary-content > #benchmarkWidget {
    grid-column: 2;
}

@media (max-width: 1024px) {
    .summary-content > .score-card-hero,
    .summary-content > .quick-actions,
    .summary-content > #fineRiskWidget,
    .summary-content > #benchmarkWidget {
        grid-column: 1;
    }
}

/* ============================================
   Inline Article Citations
   ============================================ */

.article-citation {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary-light);
    font-family: var(--font-mono);
    cursor: help;
    transition: all 0.2s ease;
}

.article-citation:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--primary);
}

.article-citation::before {
    content: '§';
    color: var(--primary);
    font-weight: 600;
}
