/**
 * Composite Response Styles
 * Styles for structured composite responses from the Multi-Platform Treasurer
 */

/* Main composite container */
.composite-response {
    margin: 16px 0;
    padding: 0;
}

/* Block titles */
.block-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding: 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

/* Cards Block Styles */
.cards-block {
    margin-bottom: 24px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.analytics-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.card-trend.trend-up {
    background: #dcfce7;
    color: #166534;
}

.card-trend.trend-down {
    background: #fef2f2;
    color: #dc2626;
}

.card-trend.trend-neutral {
    background: #f1f5f9;
    color: #475569;
}

.card-description {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.4;
}

/* Table Block Styles */
.table-block {
    margin-bottom: 24px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    font-size: 14px;
}

.data-table tr:hover {
    background: #f9fafb;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Metrics Block Styles */
.metrics-block {
    margin-bottom: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.metric-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.metric-change {
    font-size: 12px;
    font-weight: 600;
}

.metric-change.positive {
    color: #059669;
}

.metric-change.negative {
    color: #dc2626;
}

/* Summary Block Styles */
.summary-block {
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.summary-content {
    color: #374151;
    line-height: 1.6;
}

/* Actions Block Styles */
.actions-block {
    margin-bottom: 24px;
}

.actions-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.action-button {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.action-button.secondary {
    background: #6b7280;
}

.action-button.secondary:hover {
    background: #4b5563;
}

.action-button.success {
    background: #059669;
}

.action-button.success:hover {
    background: #047857;
}

.action-button.danger {
    background: #dc2626;
}

.action-button.danger:hover {
    background: #b91c1c;
}

/* Alert Block Styles */
.alert-block {
    margin-bottom: 24px;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid;
}

.alert-block.alert-info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

.alert-block.alert-success {
    background: #f0fdf4;
    border-left-color: #22c55e;
    color: #166534;
}

.alert-block.alert-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-block.alert-error,
.alert-block.alert-danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

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

.alert-icon {
    margin-right: 8px;
    font-size: 16px;
}

.alert-title {
    font-weight: 600;
    font-size: 14px;
}

.alert-content {
    font-size: 14px;
    line-height: 1.5;
}

/* List Block Styles */
.list-block {
    margin-bottom: 24px;
}

.block-list {
    margin-top: 16px;
    padding-left: 20px;
}

.block-list li {
    margin-bottom: 8px;
    color: #374151;
    line-height: 1.5;
}

/* Recommendations Block Styles */
.recommendations-block {
    margin-bottom: 24px;
}

.recommendations-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rec-priority {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.rec-priority.high {
    background: #fef2f2;
    color: #dc2626;
}

.rec-priority.medium {
    background: #fffbeb;
    color: #d97706;
}

.rec-priority.low {
    background: #f0fdf4;
    color: #059669;
}

.rec-content {
    flex: 1;
}

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

.rec-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Chart Block Styles */
.chart-block {
    margin-bottom: 24px;
}

.chart-placeholder {
    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #6b7280;
}

.chart-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chart-message {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.chart-data {
    font-size: 12px;
    font-family: monospace;
    background: #f3f4f6;
    padding: 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timeline Block Styles */
.timeline-block {
    margin-bottom: 24px;
}

.timeline {
    margin-top: 16px;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-event {
    position: relative;
    margin-bottom: 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-left: 20px;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
}

.timeline-date {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.timeline-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Fallback Block Styles */
.fallback-block {
    margin-bottom: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
}

.fallback-title {
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 8px;
}

.fallback-content {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 12px;
    font-size: 12px;
    color: #374151;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-container {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        text-align: center;
    }
    
    .recommendation-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rec-priority {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .card-value {
        font-size: 24px;
    }
    
    .timeline {
        padding-left: 16px;
    }
    
    .timeline-event {
        margin-left: 16px;
    }
    
    .timeline-event::before {
        left: -24px;
    }
}
