/**
 * 预测插件 - WooCommerce整合样式
 * Fortune Telling Plugin - WooCommerce Integration Styles
 */

/* 订单页面预测结果区域 */
.fortune-result-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.fortune-result-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* 预测结果内容 */
.fortune-result-content {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fortune-ai-content {
    margin-bottom: 25px;
}

.fortune-ai-content h4 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.fortune-ai-content .content {
    line-height: 1.8;
    color: #555;
    font-size: 14px;
}

.fortune-ai-content .content strong {
    color: #333;
    font-weight: 600;
}

.fortune-ai-content .content em {
    color: #666;
    font-style: italic;
}

/* 推荐商品区域 */
.fortune-goods {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
    margin-bottom: 20px;
}

.fortune-goods h4 {
    color: #28a745;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
}

.fortune-goods ul {
    margin: 0;
    padding-left: 20px;
}

.fortune-goods li {
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}

/* 商品推荐网格 */
.fortune-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* 商品卡片样式 */
.fortune-product-card {
    background: #1a1a1a;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.fortune-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fortune-product-link:hover {
    text-decoration: none;
    color: inherit;
}

/* 商品图片 */
.fortune-product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fortune-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fortune-product-card:hover .fortune-product-image img {
    transform: scale(1.05);
}

/* 商品信息 */
.fortune-product-info {
    padding: 15px;
}

.fortune-product-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: white !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fortune-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
    margin: 0;
}

/* 商品操作按钮 */
.fortune-product-actions {
    padding: 0 15px 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fortune-product-actions .button {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.fortune-view-product {
    background-color: black !important;
    color: #fff !important;
}

.fortune-view-product:hover {
    background-color: #005a87;
    color: #fff !important;
}

.fortune-add-to-cart {
    background-color: black !important;
    color: #fff !important;
}

.fortune-add-to-cart:hover {
    background-color: #c82333;
    color: #fff !important;
}

/* 不可用商品样式 */
.fortune-product-unavailable {
    opacity: 0.6;
}

.fortune-product-unavailable .fortune-product-card {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.fortune-product-status {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
    margin: 5px 0;
}

.fortune-product-actions .fortune-product-unavailable {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    flex: 1;
}

/* 元数据区域 */
.fortune-metadata {
    background: #e9ecef;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    color: #6c757d;
}

.fortune-metadata p {
    margin: 0;
}

/* 等待消息样式 */
.fortune-waiting-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.fortune-waiting-message h4 {
    color: #856404;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.fortune-waiting-message p {
    color: #856404;
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.6;
}

.fortune-waiting-message .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #856404;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* 错误消息样式 */
.fortune-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.fortune-error-message h4 {
    color: #721c24;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.fortune-error-message p {
    color: #721c24;
    margin: 0 0 10px 0;
    font-size: 14px;
}

/* 感谢页面消息 */
.fortune-thankyou-message {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.fortune-thankyou-message h3 {
    color: #0c5460;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.fortune-thankyou-message .fortune-waiting-message {
    background: transparent;
    border: none;
    padding: 0;
}

.fortune-thankyou-message .button {
    background-color: #007cba;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.fortune-thankyou-message .button:hover {
    background-color: #005a87;
    color: #fff;
}

/* 我的订单页面预测状态列 */
.fortune-status-processing {
    color: #856404;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.fortune-status-completed {
    color: #155724;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.fortune-status-failed {
    color: #721c24;
    background: #f8d7da;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.fortune-status-pending {
    color: #0c5460;
    background: #d1ecf1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.fortune-status-na {
    color: #6c757d;
    font-size: 12px;
}

/* 购物车页面预测商品信息 */
.fortune-cart-info {
    color: #007cba;
    font-weight: 500;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fortune-result-section {
        margin: 20px 0;
        padding: 15px;
    }
    
    .fortune-result-content {
        padding: 15px;
    }
    
    .fortune-thankyou-message {
        padding: 20px;
        margin: 15px 0;
    }
    
    .fortune-thankyou-message h3 {
        font-size: 16px;
    }
    
    /* 商品推荐移动端样式 */
    .fortune-product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fortune-product-image {
        height: 150px;
    }
    
    .fortune-product-info {
        padding: 12px;
    }
    
    .fortune-product-name {
        font-size: 14px;
    }
    
    .fortune-product-price {
        font-size: 16px;
    }
    
    .fortune-product-actions {
        padding: 0 12px 12px;
        flex-direction: column;
    }
    
    .fortune-product-actions .button {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* 动画效果 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 打印样式 */
@media print {
    .fortune-result-section {
        background: #fff;
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .fortune-waiting-message .loading-spinner {
        display: none;
    }
    
    .fortune-thankyou-message .button {
        display: none;
    }
}