/**
 * Fortune Telling API - 前端样式
 */

/* 表单容器样式 */
.fortune-telling-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fortune-telling-form-container h3 {
    margin-top: 0;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 表单样式 */
.fortune-telling-form {
    margin-top: 20px;
}

.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-row .required {
    color: #e74c3c;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    color: #000;
    background-color: #fff;
}

.form-row select option {
    background-color: #fff;
    color: #000;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-row small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

/* 情侣表单特殊样式 */
.couple-section {
    background: #f9f9f9;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.couple-section h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 16px;
}

/* 提交按钮样式 */
.fortune-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fortune-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.fortune-submit-btn:active {
    transform: translateY(0);
}

.fortune-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载状态样式 */
.fortune-loading {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-top: 20px;
}

.fortune-loading p {
    margin: 0;
    color: #6c757d;
    font-style: italic;
}

.fortune-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* 结果显示样式 */
.fortune-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #28a745;
}

.fortune-result h4 {
    margin-top: 0;
    color: #155724;
    border-bottom: 1px solid #d4edda;
    padding-bottom: 10px;
}

.result-content {
    line-height: 1.6;
    color: #495057;
}

.result-content strong {
    color: #2c3e50;
}

.result-content em {
    color: #7f8c8d;
}

/* 商品推荐样式 */
.fortune-goods {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.fortune-goods h4 {
    margin-top: 0;
    color: #856404;
}

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

.fortune-goods li {
    margin-bottom: 5px;
    color: #6c757d;
}

/* 错误消息样式 */
.fortune-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #dc3545;
    margin-top: 20px;
}

.fortune-error strong {
    display: block;
    margin-bottom: 5px;
}

/* 成功消息样式 */
.fortune-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #28a745;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .fortune-telling-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .couple-section {
        padding: 10px;
        margin: 10px 0;
    }
    
    .form-row input[type="text"],
    .form-row input[type="email"],
    .form-row select {
        padding: 8px;
        font-size: 16px; /* 防止iOS缩放 */
        color: #000;
        background-color: #fff;
    }
    
    .fortune-submit-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .fortune-telling-form-container {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .fortune-telling-form-container h3 {
        color: #ecf0f1;
        border-bottom-color: #34495e;
    }
    
    .form-row label {
        color: #bdc3c7;
    }
    
    .form-row input[type="text"],
    .form-row input[type="email"] {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .form-row select {
        background-color: #fff !important;
        border-color: #4a5f7a;
        color: #000 !important;
    }
    
    .form-row select option {
        background-color: #fff !important;
        color: #000 !important;
    }
    
    .form-row input:focus,
    .form-row select:focus {
        border-color: #3498db;
    }
    
    .couple-section {
        background: #34495e;
        border-left-color: #3498db;
    }
    
    .couple-section h4 {
        color: #ecf0f1;
    }
    
    .fortune-result {
        background: #34495e;
        border-left-color: #27ae60;
    }
    
    .fortune-result h4 {
        color: #2ecc71;
        border-bottom-color: #27ae60;
    }
    
    .result-content {
        color: #bdc3c7;
    }
}