/**
 * AI Results Display Styles
 * 
 * 優化的 AI 分析結果顯示樣式
 * 
 * @author iShowPlay Team
 * @version 2.0.0
 * @date 2025-09-09
 */

/* ===========================
   AI 結果顯示區塊
   =========================== */

.ai-results-section {
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1rem;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-results-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 狀態欄 */
.ai-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, #f0f4ff 0%, #f8f9ff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-status-bar .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

.ai-status-bar .status-indicator.processing {
    background: #ff9800;
    animation: pulse 1s infinite;
}

.ai-status-bar .status-text {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* 生成內容預覽 */
.generated-content {
    padding: 1.5rem;
}

.content-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.content-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-preview {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

/* 腳本預覽樣式 */
.script-content {
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.script-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.script-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.script-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
}

.script-section p {
    margin: 0.5rem 0;
    color: #666;
    line-height: 1.5;
}

/* 操作按鈕 */
.ai-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: center;
}

.ai-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-actions .btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.ai-actions .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #999;
}

.ai-actions .btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.ai-actions .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* 平台預覽 */
.platform-preview,
.products-preview {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.platform-preview h4,
.products-preview h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.selected-platforms {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.platform-badge {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 商品卡片 */
.product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 1rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0;
}

.product-original-price {
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
    margin: 0.25rem 0 0 0;
}

.product-actions {
    padding: 0.75rem;
    background: #f8f9fa;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.product-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.product-actions .btn-edit {
    background: #2196f3;
    color: white;
}

.product-actions .btn-edit:hover {
    background: #1976d2;
}

.product-actions .btn-remove {
    background: #ff5252;
    color: white;
}

.product-actions .btn-remove:hover {
    background: #d32f2f;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .ai-results-section {
        margin: 1rem auto;
    }

    .ai-actions {
        flex-direction: column;
    }

    .ai-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .product-cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* 深色模式支援 */
[data-theme="dark"] .ai-results-container {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ai-status-bar {
    background: linear-gradient(90deg, #2a2a2a 0%, #333 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .content-section {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .content-preview {
    color: #e0e0e0;
}

[data-theme="dark"] .script-content {
    background: #333;
}

[data-theme="dark"] .ai-actions {
    background: #2a2a2a;
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ai-actions .btn-secondary {
    background: #333;
    color: #e0e0e0;
    border-color: #555;
}

[data-theme="dark"] .product-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .product-title {
    color: #e0e0e0;
}

[data-theme="dark"] .product-actions {
    background: #333;
}