/* ========================================
   Recommendations Page Styles
   ======================================== */

/* Header Extension */
.recommendation-count {
    font-size: 0.875rem;
    margin-left: var(--space-md);
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.875rem;
}

.view-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* AI Insight Banner */
.ai-insight-banner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.ai-icon {
    font-size: 2.5rem;
}

.ai-insight-content {
    flex: 1;
}

.ai-insight-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ai-insight-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ai-insight-content strong {
    color: var(--accent-primary);
}

/* Recommendations Section */
.recommendations-section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

/* Recommendation Card */
.recommendation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: var(--transition-normal);
}

.recommendation-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.recommendation-card.priority-high {
    border-left: 4px solid var(--danger);
}

.recommendation-card.priority-medium {
    border-left: 4px solid var(--warning);
}

.recommendation-card.priority-low {
    border-left: 4px solid var(--text-tertiary);
}

/* Priority Header */
.rec-priority {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.priority-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.priority-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.priority-badge.low {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-secondary);
}

.rec-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Recommendation Header */
.rec-header {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.rec-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-icon.scale {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.rec-icon.pause {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.rec-icon.create {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.rec-icon.optimize {
    background: rgba(139, 92, 246, 0.15);
    color: #a855f7;
}

.rec-icon.insight {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.rec-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rec-reason {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Recommendation Details */
.rec-details {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-value.highlight {
    color: var(--success);
}

.detail-value.danger {
    color: var(--danger);
}

/* Confidence Bar */
.confidence-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
}

/* Impact Preview */
.impact-preview {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.impact-label {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 500;
}

.impact-value {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Placement Comparison */
.placement-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.placement-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.placement-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.placement-stats {
    display: flex;
    gap: var(--space-md);
    font-size: 0.8rem;
}

.placement-cpo {
    font-weight: 600;
}

.placement-cpo.good {
    color: var(--success);
}

.placement-cpo.ok {
    color: var(--warning);
}

.placement-cpo.bad {
    color: var(--danger);
}

.placement-spend {
    color: var(--text-tertiary);
}

.placement-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.bar-fill.good {
    background: var(--success);
}

.bar-fill.ok {
    background: var(--warning);
}

.bar-fill.bad {
    background: var(--danger);
}

/* Recommendation Actions */
.rec-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* History Section */
.history-section {
    margin-bottom: var(--space-xl);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.history-icon {
    font-size: 1.25rem;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-action {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.history-result {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.history-item.approved .history-result {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.history-item.rejected .history-result {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.history-item.auto .history-result {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet Landscape (≤ 1200px) */
@media (max-width: 1200px) {
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait (≤ 1024px) */
@media (max-width: 1024px) {
    .recommendations-content {
        padding: 16px;
    }
    
    .ai-insight-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .recommendation-card {
        padding: 16px;
    }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    .ai-insight-banner {
        padding: 12px;
    }
    
    .ai-insight-banner .btn {
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendation-card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .rec-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rec-icon {
        width: 40px;
        height: 40px;
    }
    
    .rec-title h3 {
        font-size: 0.95rem;
    }
    
    .rec-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .rec-actions .btn {
        width: 100%;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .view-toggle {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
    }
}

/* Mobile Small (≤ 480px) */
@media (max-width: 480px) {
    .recommendations-content {
        padding: 12px;
    }
    
    .ai-insight-banner {
        padding: 10px;
    }
    
    .ai-icon {
        font-size: 2rem;
    }
    
    .ai-insight-content h3 {
        font-size: 0.9rem;
    }
    
    .ai-insight-content p {
        font-size: 0.8rem;
    }
    
    .recommendation-card {
        padding: 10px;
    }
    
    .rec-icon {
        width: 36px;
        height: 36px;
    }
    
    .rec-title h3 {
        font-size: 0.9rem;
    }
    
    .rec-description {
        font-size: 0.8rem;
    }
    
    .priority-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .section-title {
        font-size: 1rem;
    }
}
