/**
 * 预测插件 - 购买弹窗样式
 * Fortune Telling Plugin - Purchase Modal Styles
 */

/* 弹窗遮罩层 */
.fortune-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

/* 弹窗内容容器 */
.fortune-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

/* 弹窗头部 */
.fortune-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fortune-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.fortune-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.fortune-modal-close:hover {
    background-color: #f5f5f5;
    color: #666;
}

/* 弹窗主体 */
.fortune-modal-body {
    padding: 20px 24px;
}

.product-info {
    margin-bottom: 20px;
}

.product-info h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

.product-description {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.purchase-notice {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.purchase-notice p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.purchase-notice strong {
    color: #dc3545;
}

/* 弹窗底部 */
.fortune-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap; /* 允许按钮换行 */
}

.fortune-modal-footer .btn {
    padding: 12px 24px; /* 增加内边距 */
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 140px; /* 统一设置最小宽度 */
    white-space: nowrap; /* 防止文字换行 */
    box-sizing: border-box; /* 确保padding计算在内 */
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    min-width: 140px; /* 取消按钮也设置相同的最小宽度 */
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-primary {
    background-color: #007cba;
    color: #fff;
    min-width: 140px; /* 主要按钮设置相同的最小宽度 */
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 购买成功消息 */
.fortune-purchase-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.fortune-purchase-success h4 {
    color: #155724;
    margin: 0 0 12px 0;
    font-size: 16px;
}

.fortune-purchase-success p {
    color: #155724;
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* 加载动画 */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fortune-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .fortune-modal-header,
    .fortune-modal-body,
    .fortune-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .fortune-modal-footer {
        flex-direction: column;
        gap: 8px; /* 减少垂直间距 */
    }
    
    .fortune-modal-footer .btn {
        width: 100%;
        margin-bottom: 0; /* 移除额外的margin，使用gap控制间距 */
        min-width: auto; /* 移动端不限制最小宽度 */
        padding: 14px 20px; /* 移动端增加垂直padding */
    }
}

/* 中等屏幕优化 */
@media (max-width: 992px) and (min-width: 769px) {
    .fortune-modal-footer .btn {
        min-width: 130px; /* 中等屏幕适中的最小宽度 */
        font-size: 13px; /* 稍微减小字体 */
        padding: 11px 20px; /* 稍微减小内边距 */
    }
}

/* 等待结果页面样式 */
.fortune-waiting-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

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

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

.fortune-waiting-message .waiting-time {
    font-weight: 600;
    color: #d63384;
}