/**
 * Workflow AI Insights Panel Styles
 * Extracted from workflows.html - Health score, predictions, recommendations
 */

/* ============== AI INSIGHTS PANEL STYLES ============== */

.wf-insight-section {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wf-insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
}

.wf-insight-header i {
    color: #8b5cf6;
    font-size: 14px;
}

.wf-refresh-btn {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wf-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wf-refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Health Score */
.wf-health-score {
    display: flex;
    align-items: center;
    gap: 20px;
}

.health-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.health-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.health-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.health-progress {
    fill: none;
    stroke: #34d399;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease-out;
}

.health-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.health-value span {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.health-value small {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
}

.health-status.warning .status-dot { background: #fbbf24; }
.health-status.critical .status-dot { background: #f87171; }

/* Predictions */
.wf-predictions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prediction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: all 0.2s;
}

.prediction-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pred-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pred-icon.engagement {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.pred-icon.collection {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.pred-icon.retention {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.pred-info {
    display: flex;
    flex-direction: column;
}

.pred-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.pred-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* Recommendations */
.wf-recommendations {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.recommendation-card.loading {
    pointer-events: none;
}

.rec-skeleton {
    height: 40px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rec-type {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.rec-type.optimization {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.rec-type.timing {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.rec-type.channel {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.rec-impact {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.rec-impact.high { color: #34d399; }
.rec-impact.medium { color: #fbbf24; }

.rec-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.rec-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Segments */
.wf-segments {
    padding-top: 8px;
}

.segment-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.segment-fill {
    height: 100%;
    transition: width 0.5s ease-out;
}

.segment-fill.high-value { background: #8b5cf6; }
.segment-fill.responsive { background: #34d399; }
.segment-fill.escalation { background: #f87171; }

.segment-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.legend-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-item .dot.high-value { background: #8b5cf6; }
.legend-item .dot.responsive { background: #34d399; }
.legend-item .dot.escalation { background: #f87171; }

/* AI Actions */
.wf-ai-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ai-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-action-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.ai-action-btn i {
    font-size: 20px;
}

.ai-action-btn span {
    font-size: 11px;
    font-weight: 500;
}

.ai-action-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Spin animation for loading states */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

.wf-refresh-btn i.spin {
    animation: spin 1s linear infinite;
}

/* Status dots for health status */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.excellent { background: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
.status-dot.good { background: #34d399; }
.status-dot.warning { background: #F59E0B; }
.status-dot.critical { background: #EF4444; animation: pulse-critical 1s ease-in-out infinite; }

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Enhanced recommendation cards */
.recommendation-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeInUp 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rec-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.recommendation-card.optimization .rec-icon { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.recommendation-card.warning .rec-icon { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.recommendation-card.suggestion .rec-icon { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.recommendation-card.info .rec-icon { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.rec-content {
    flex: 1;
    min-width: 0;
}

.rec-action-btn {
    margin-top: 8px;
    padding: 4px 10px;
    font-size: 10px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s;
}

.rec-action-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

.no-recommendations {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.no-recommendations i {
    font-size: 24px;
    color: #10B981;
}

/* AI Analysis Results in chat */
.ai-analysis-results {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.ai-analysis-results h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #a78bfa;
}

.analysis-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.score-value {
    font-size: 32px;
    font-weight: 700;
    color: #10B981;
}

.score-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.analysis-insights h5, .analysis-recs h5 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.analysis-insights ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.analysis-insights li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analysis-insights li i {
    color: #fbbf24;
    flex-shrink: 0;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
}

.rec-item:hover {
    background: rgba(139, 92, 246, 0.15);
}

.rec-item i {
    color: #8b5cf6;
}

.rec-item.opt {
    background: rgba(16, 185, 129, 0.1);
}

.rec-item.opt i {
    color: #10B981;
}

/* Analysis performance metrics */
.analysis-perf {
    margin: 12px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.analysis-perf h5 {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perf-metrics {
    display: flex;
    gap: 16px;
}

.perf-metrics span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.perf-metrics i {
    color: #8b5cf6;
}

.analysis-recs.optimization h5 {
    color: #10B981;
}
