/* ===== 占卜頁面專用樣式 ===== */

.divination-container {
    min-height: 80vh;
    padding: 3rem 0;
}

.divination-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.divination-step.active {
    display: block;
}

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

.step-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.step-header i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: block;
}

.step-header h2 {
    font-size: 2.2rem;
    font-family: 'Noto Serif TC', serif;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== 問題輸入區 ===== */
.question-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#userQuestion {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: 'Noto Sans TC', sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
}

#userQuestion:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
}

#userQuestion::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.char-count {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 提示區 ===== */
.tips {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--secondary-color);
}

.tips h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.tips ul {
    list-style: none;
    padding: 0;
}

.tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.tips li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

/* ===== 動畫區域 ===== */
.animation-container {
    text-align: center;
}

.animation-frame {
    max-width: 700px;
    margin: 0 auto 2rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--secondary-color);
}

.animation-frame img {
    width: 100%;
    height: auto;
    display: block;
}

.energy-indicator {
    max-width: 500px;
    margin: 0 auto;
}

.energy-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.energy-fill {
    height: 100%;
    background: var(--gradient-1);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.energy-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.energy-text {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 600;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== 結果顯示區 ===== */
.result-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-section h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Noto Serif TC', serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== 問題顯示 ===== */
.your-question {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
}

/* ===== 卦象顯示 ===== */
.hexagram-display {
    text-align: center;
}

.hexagram-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hexagram-symbol {
    font-size: 5rem;
    line-height: 1;
    color: var(--secondary-color);
    filter: drop-shadow(0 0 20px rgba(218, 165, 32, 0.5));
}

.hexagram-name {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Noto Serif TC', serif;
    color: var(--text-primary);
}

.hexagram-number {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ===== AI 解卦 ===== */
.ai-interpretation {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1), rgba(0, 242, 254, 0.1));
}

.interpretation-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.interpretation-text p {
    margin-bottom: 1rem;
}

/* ===== 關鍵建議 ===== */
.key-advice {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1), rgba(245, 87, 108, 0.1));
}

.advice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.advice-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.advice-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.advice-text {
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* ===== 行動按鈕 ===== */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ===== 剩餘次數 ===== */
.remaining-uses {
    text-align: center;
    padding: 1.5rem;
    background: rgba(218, 165, 32, 0.1);
    border-radius: 15px;
    border: 2px solid var(--secondary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.remaining-uses i {
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.remaining-uses span {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.3rem;
}

.buy-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.buy-more:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    .step-card {
        padding: 2rem 1.5rem;
    }

    .step-header h2 {
        font-size: 1.8rem;
    }

    .step-header i {
        font-size: 3rem;
    }

    #userQuestion {
        min-height: 120px;
        font-size: 1rem;
    }

    .hexagram-symbol {
        font-size: 3.5rem;
    }

    .hexagram-name {
        font-size: 1.5rem;
    }

    .result-section {
        padding: 1.5rem;
    }

    .result-section h3 {
        font-size: 1.3rem;
    }

    .interpretation-text {
        font-size: 1rem;
    }

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

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

@media (max-width: 480px) {
    .divination-container {
        padding: 2rem 0;
    }

    .step-card {
        padding: 1.5rem 1rem;
    }

    .remaining-uses {
        flex-direction: column;
        font-size: 1rem;
    }
}
