/* AI Analysis Styling - Clean Banner Style */

/* ===== AI ANALYSIS CONTAINER ===== */
.ai-analysis-container {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    order: -1; /* Move to top */
    flex-shrink: 0;
}

/* ===== AI ANALYSIS HEADER - USING BANNER GRADIENT ===== */
.ai-analysis-header {
    background-image: url('https://www.mooncat.ai/wp-content/uploads/2025/05/gradient-background-updated-2.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 1.25rem;
    position: relative;
}

/* Fallback gradient if banner image doesn't load */
.ai-analysis-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    z-index: 1;
}

.ai-analysis-header > * {
    position: relative;
    z-index: 2;
}

/* ===== AI ANALYSIS TITLE ===== */
.ai-analysis-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #374151; /* Dark grey text like your banner */
    font-weight: 600;
    font-size: 1.1rem;
}

.ai-analysis-title .mooncat-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ===== AI ANALYSIS SUMMARY TEXT ===== */
.ai-analysis-summary {
    color: #374151; /* Dark grey text like your banner */
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* ===== AI ANALYSIS BADGES - SUBTLE COLORS ===== */
.ai-analysis-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ai-recommendation-badge,
.ai-risk-badge {
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    color: white;
}

/* Subtle recommendation colors */
.ai-recommendation-badge.support,
.ai-recommendation-badge.for {
    background: rgba(34, 197, 94, 0.8); /* Subtle green */
}

.ai-recommendation-badge.oppose,
.ai-recommendation-badge.against {
    background: rgba(239, 68, 68, 0.8); /* Subtle red */
}

.ai-recommendation-badge.abstain,
.ai-recommendation-badge.neutral {
    background: rgba(107, 114, 128, 0.8); /* Subtle grey */
}

/* Subtle risk level colors */
.ai-risk-badge.risk-low {
    background: rgba(34, 197, 94, 0.8); /* Subtle green */
}

.ai-risk-badge.risk-medium {
    background: rgba(251, 191, 36, 0.8); /* Subtle yellow */
    color: #1f2937; /* Dark text for better contrast */
}

.ai-risk-badge.risk-high {
    background: rgba(239, 68, 68, 0.8); /* Subtle red */
}

/* ===== LOADING AND ERROR STATES ===== */
.ai-analysis-loading {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    text-align: center;
    color: #374151; /* Dark grey text */
    font-style: italic;
    border-radius: 8px;
}

.ai-analysis-error {
    background: rgba(239, 68, 68, 0.1);
    padding: 1.25rem;
    text-align: center;
    color: #dc2626;
    font-style: italic;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* ===== PROPOSAL CARD INTEGRATION ===== */
.proposal-card .ai-analysis-container {
    margin-top: 0;
    margin-bottom: 1rem;
    order: -1; /* Move AI analysis to the top */
}

.proposal-card.has-ai-analysis .proposal-header {
    margin-top: 1rem;
}

/* ===== MODAL AI ANALYSIS ===== */
.modal-ai-analysis {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-ai-analysis .ai-analysis-header {
    border-radius: 12px;
    margin-bottom: 1rem;
}

.modal-ai-analysis .ai-analysis-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.modal-ai-analysis .ai-analysis-summary {
    font-size: 1rem;
    line-height: 1.6;
}

/* ===== DETAILED ANALYSIS SECTION ===== */
.ai-detailed-analysis {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #e5e7eb;
}

.ai-detailed-analysis h4 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.ai-metric {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-metric:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ai-metric-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.ai-metric-content {
    color: #6b7280;
    line-height: 1.6;
    font-size: 0.9rem;
}

.ai-metric-content ul {
    margin: 0;
    padding-left: 1.5rem;
}

.ai-metric-content li {
    margin-bottom: 0.5rem;
    color: #6b7280;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .ai-analysis-header {
        padding: 1rem;
    }
    
    .ai-analysis-title {
        font-size: 1rem;
    }
    
    .ai-analysis-title .mooncat-logo {
        width: 18px;
        height: 18px;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    }
    
    .ai-analysis-summary {
        font-size: 0.875rem;
    }
    
    .ai-analysis-badges {
        gap: 0.5rem;
    }
    
    .ai-recommendation-badge,
    .ai-risk-badge {
        font-size: 0.8125rem;
        padding: 0.25rem 0.75rem;
    }
    
    .ai-detailed-analysis {
        padding: 1rem;
    }
}

/* ===== ANIMATION ===== */
@keyframes aiAnalysisSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-analysis-container {
    animation: aiAnalysisSlideIn 0.3s ease-out;
}

/* ===== ENSURE PROPER LAYOUT ===== */
.proposal-card .proposal-info {
    width: 100%;
}

.proposal-card .proposal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.proposal-card .proposal-state {
    align-self: flex-end;
    margin-top: -2rem;
    position: relative;
    z-index: 3;
}

/* ===== HOVER EFFECTS ===== */
.ai-analysis-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* ===== ACCESSIBILITY ===== */
.ai-analysis-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===== COMPACT MODE FOR SUMMARY VIEW ===== */
.proposal-card .ai-analysis-container .ai-analysis-summary {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    /* Limit to 2 lines for summary view */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proposal-card .ai-analysis-container .ai-analysis-badges {
    gap: 0.5rem;
}

.proposal-card .ai-recommendation-badge,
.proposal-card .ai-risk-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

