/* Intelligence UI Styles - Consistent across all calculators */

.intelligence-response {
    font-family: inherit;
}

/* Mode Toggle */
.mode-toggle-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 20px;
}

.mode-toggle {
    display: flex;
    background: var(--card-bg, #f5f5f5);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color, #e0e0e0);
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-muted, #666);
}

.mode-btn.active {
    background: var(--primary-color, #2563eb);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: var(--hover-bg, #e5e5e5);
}

.mode-info {
    color: var(--text-muted, #999);
    cursor: help;
    font-size: 1.1em;
}

/* Answer Summary */
.answer-summary {
    background: linear-gradient(135deg, var(--primary-color, #2563eb) 0%, var(--primary-dark, #1d4ed8) 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.85em;
    opacity: 0.85;
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
}

/* Sections */
.section {
    background: var(--card-bg, white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color, #2563eb);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
}

.section-icon {
    font-size: 1.3em;
}

.section-header h3 {
    margin: 0;
    font-size: 1.2em;
    flex: 1;
}

.section-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.section-badge.success {
    background: #dcfce7;
    color: #166534;
}

.section-badge.low {
    background: #dcfce7;
    color: #166534;
}

.section-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.section-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

/* Explain Steps */
.explain-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.explain-step {
    padding: 16px;
    background: var(--step-bg, #f8fafc);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color, #2563eb);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.step-title {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.step-value {
    font-weight: 700;
    color: var(--primary-color, #2563eb);
    font-size: 1.1em;
}

.step-description {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.95em;
    line-height: 1.5;
}

/* Optimize Cards */
.optimize-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.optimize-card {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--card-bg, white);
}

.optimize-card.priority-high {
    border-left: 4px solid #22c55e;
}

.optimize-card.priority-medium {
    border-left: 4px solid #f59e0b;
}

.optimize-card.priority-low {
    border-left: 4px solid #94a3b8;
}

.optimize-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.optimize-header h4 {
    margin: 0;
    font-size: 1.05em;
}

.impact-badge {
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
}

.optimize-description {
    margin: 0 0 12px 0;
    color: var(--text-secondary, #64748b);
}

.optimize-impact {
    font-weight: 500;
    color: #166534;
    margin-bottom: 12px;
}

.action-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary, #64748b);
}

.action-steps li {
    margin-bottom: 4px;
}

.optimize-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--text-muted, #94a3b8);
}

/* Risk Section */
.risk-meter {
    margin-bottom: 24px;
}

.meter-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.meter-fill.low {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.meter-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.meter-fill.high {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-muted, #94a3b8);
}

.meter-score {
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.risk-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.risk-item {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.risk-item.level-high {
    background: #fef2f2;
    border-color: #fecaca;
}

.risk-item.level-medium {
    background: #fffbeb;
    border-color: #fde68a;
}

.risk-item.level-low {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.risk-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.risk-level-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.level-high .risk-level-badge {
    background: #dc2626;
    color: white;
}

.level-medium .risk-level-badge {
    background: #d97706;
    color: white;
}

.level-low .risk-level-badge {
    background: #16a34a;
    color: white;
}

.risk-category {
    color: var(--text-muted, #64748b);
    font-size: 0.9em;
}

.risk-message {
    font-weight: 600;
    margin: 0 0 8px 0;
}

.risk-description {
    margin: 0 0 12px 0;
    color: var(--text-secondary, #64748b);
}

.risk-suggestion {
    background: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95em;
}

.docs-needed {
    margin-top: 12px;
    font-size: 0.9em;
}

.docs-needed ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

.no-risks {
    text-align: center;
    padding: 24px;
    background: #f0fdf4;
    border-radius: 8px;
    color: #166534;
}

/* Actions Section */
.due-dates-subsection,
.actions-checklist {
    margin-bottom: 20px;
}

.due-dates-subsection h4,
.actions-checklist h4 {
    margin: 0 0 12px 0;
    font-size: 1em;
}

.due-dates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.due-date-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--step-bg, #f8fafc);
    border-radius: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.due-date-item.critical {
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.due-date {
    font-weight: 600;
    min-width: 120px;
}

.due-description {
    flex: 1;
    color: var(--text-secondary, #64748b);
}

.due-category {
    font-size: 0.85em;
    padding: 2px 8px;
    background: var(--primary-light, #dbeafe);
    color: var(--primary-color, #2563eb);
    border-radius: 4px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--step-bg, #f8fafc);
    margin-bottom: 8px;
}

.action-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.action-text {
    flex: 1;
}

.action-due {
    font-size: 0.85em;
    color: var(--text-muted, #94a3b8);
}

/* Learning Cards */
.learning-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.learning-card {
    padding: 20px;
    background: var(--step-bg, #f8fafc);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
}

.learning-card h4 {
    margin: 0 0 12px 0;
    font-size: 1em;
}

.learning-card p {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.95em;
    line-height: 1.5;
}

.card-tag {
    display: inline-block;
    margin-top: 12px;
    padding: 2px 8px;
    background: var(--primary-light, #dbeafe);
    color: var(--primary-color, #2563eb);
    border-radius: 4px;
    font-size: 0.8em;
}

/* Responsive */
@media (max-width: 640px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section {
        padding: 16px;
    }
    
    .optimize-header {
        flex-direction: column;
    }
    
    .due-date-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
