/* ==========================================================================
   AI Insights Panel Styles
   Generic styles for the AI Insights panel used across all areas
   ========================================================================== */

.ai-insights-panel {
    background: linear-gradient(135deg, #6b7a99 0%, #8b7b9c 100%);
    border-radius: 12px;
    padding: 14px;
    color: white;
    box-shadow: 0 4px 15px rgba(107, 122, 153, 0.25);
    height: fit-content;
}

/* Alternative color schemes for different areas */
.ai-insights-panel.theme-jobs {
    background: linear-gradient(135deg, #5a8a84 0%, #7ab89e 100%);
    box-shadow: 0 4px 15px rgba(90, 138, 132, 0.25);
}

.ai-insights-panel.theme-payroll {
    background: linear-gradient(135deg, #6b7a99 0%, #8b7b9c 100%);
}

.ai-insights-panel.theme-ar {
    background: linear-gradient(135deg, #a88aa8 0%, #c9848f 100%);
    box-shadow: 0 4px 15px rgba(168, 138, 168, 0.25);
}

.ai-insights-panel.theme-gl {
    background: linear-gradient(135deg, #6a9ab8 0%, #7eb8b8 100%);
    box-shadow: 0 4px 15px rgba(106, 154, 184, 0.25);
}

.ai-insights-panel.theme-bank {
    background: linear-gradient(135deg, #b88a8f 0%, #c9b87a 100%);
    box-shadow: 0 4px 15px rgba(184, 138, 143, 0.25);
}

.ai-insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-insights-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.ai-insights-title i {
    font-size: 18px;
}

.health-score {
    display: flex;
    align-items: center;
    gap: 6px;
}

.health-score-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}

.health-excellent { background: rgba(40, 167, 69, 0.9); }
.health-good { background: rgba(255, 193, 7, 0.9); color: #333; }
.health-warning { background: rgba(255, 152, 0, 0.9); }
.health-critical { background: rgba(220, 53, 69, 0.9); }

.status-badge-ai {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
}

.status-badge-ai.bg-success { background: rgba(40, 167, 69, 0.8); }
.status-badge-ai.bg-warning { background: rgba(255, 193, 7, 0.8); color: #333; }
.status-badge-ai.bg-danger { background: rgba(220, 53, 69, 0.8); }
.status-badge-ai.bg-info { background: rgba(23, 162, 184, 0.8); }

.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.quick-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
}

.quick-stat i {
    font-size: 14px;
    margin-bottom: 2px;
    display: block;
}

.quick-stat-value {
    font-weight: bold;
    font-size: 15px;
}

.quick-stat-label {
    font-size: 10px;
    opacity: 0.9;
}

.issue-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.issue-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
}

.issue-badge.critical { background: rgba(220, 53, 69, 0.9); }
.issue-badge.warning { background: rgba(255, 193, 7, 0.9); color: #333; }
.issue-badge.info { background: rgba(23, 162, 184, 0.9); }
.issue-badge.success { background: rgba(40, 167, 69, 0.9); }

/* Suggested Actions */
.suggested-actions {
    margin-bottom: 12px;
}

.suggested-actions-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.suggested-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.2s;
}

.suggested-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.suggested-action-content {
    flex: 1;
    min-width: 0;
}

.suggested-action-title {
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggested-action-desc {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

.suggested-action-btn {
    flex-shrink: 0;
    margin-left: 10px;
    font-size: 11px;
    padding: 4px 12px;
}

/* Insight Messages */
.insight-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 350px;
    overflow-y: auto;
}

.insight-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    transition: background 0.2s;
}

.insight-message:hover {
    background: rgba(255, 255, 255, 0.2);
}

.insight-message.severity-critical {
    background: rgba(220, 53, 69, 0.3);
    border-left: 3px solid #dc3545;
}

.insight-message.severity-warning {
    background: rgba(255, 193, 7, 0.2);
    border-left: 3px solid #ffc107;
}

.insight-message.severity-success {
    background: rgba(40, 167, 69, 0.2);
    border-left: 3px solid #28a745;
}

.insight-message.severity-info {
    background: rgba(23, 162, 184, 0.2);
    border-left: 3px solid #17a2b8;
}

.insight-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.insight-content {
    flex: 1;
    min-width: 0;
}

.insight-category {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    display: block;
    margin-bottom: 2px;
}

.insight-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 12px;
}

.insight-text {
    opacity: 0.9;
    font-size: 11px;
    line-height: 1.4;
    word-wrap: break-word;
}

.insight-action {
    color: white;
    font-size: 10px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.8;
    text-decoration: none;
}

.insight-action:hover {
    opacity: 1;
    color: white;
    text-decoration: underline;
}

/* Empty State */
.ai-insights-empty {
    text-align: center;
    padding: 20px;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ai-insights-empty i {
    font-size: 24px;
}

/* Buttons */
.ai-refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.ai-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-collapse-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    font-size: 12px;
}

.ai-collapse-btn:hover {
    opacity: 1;
}

/* Collapsed State */
.ai-insights-collapsed .insight-messages,
.ai-insights-collapsed .issue-badges,
.ai-insights-collapsed .quick-stats,
.ai-insights-collapsed .suggested-actions,
.ai-insights-collapsed .ai-insights-empty {
    display: none;
}

.ai-insights-collapsed {
    padding: 10px 14px;
}

/* Custom Scrollbar */
.insight-messages::-webkit-scrollbar {
    width: 6px;
}

.insight-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.insight-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 576px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .suggested-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .suggested-action-btn {
        margin-left: 0;
        width: 100%;
    }
}
