/* ============================================================
   daily-card.css — 每日一牌組件樣式
   設計風格：與 Cyber Tarot 一致的黑底金色系 + 神秘感
   ============================================================ */

/* ==================== 摺疊按鈕 ==================== */

.daily-card-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 24px;
    color: var(--gold, #d4af37);
    font-size: 13px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px auto;
    width: fit-content;
    user-select: none;
}

.daily-card-toggle-btn:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.12);
}

.daily-card-toggle-text {
    font-size: 13px;
}

.daily-card-toggle-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.daily-card-toggle-btn.expanded .daily-card-toggle-arrow {
    transform: rotate(180deg);
}

.daily-card-star {
    font-size: 14px;
    color: var(--gold, #d4af37);
    opacity: 0.7;
}

/* ==================== 展開面板 ==================== */

.daily-card-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.daily-card-panel.expanded {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.2) transparent;
}

.daily-card-panel.expanded::-webkit-scrollbar {
    width: 4px;
}

.daily-card-panel.expanded::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
}

/* ==================== 容器 ==================== */

.daily-card-widget {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 16px 16px;
    box-sizing: border-box;
    color: var(--gold, #d4af37);
    font-family: 'Noto Sans TC', sans-serif;
}

/* ==================== 日期 ==================== */

.daily-card-date {
    text-align: center;
    font-size: 12px;
    color: rgba(212, 175, 55, 0.5);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

/* ==================== 牌面容器 ==================== */

.daily-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==================== 翻牌動畫 ==================== */

.daily-card-flip-container {
    width: 140px;
    height: 240px;
    perspective: 800px;
    cursor: pointer;
    margin-bottom: 16px;
}

.daily-card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.daily-card-flip-container.flipped .daily-card-flipper {
    transform: rotateY(180deg);
}

.daily-card-front,
.daily-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.daily-card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.daily-card-front img,
.daily-card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.daily-card-back {
    transform: rotateY(180deg);
}

/* 翻牌提示文字 */
.daily-card-tap-hint {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: var(--gold, #d4af37);
    letter-spacing: 1px;
    animation: dailyCardPulse 2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

@keyframes dailyCardPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 翻牌後的金色邊框發光 */
.daily-card-flip-container.flipped .daily-card-back {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.35), 0 4px 20px rgba(212, 175, 55, 0.2);
}

/* ==================== 牌名 ==================== */

.daily-card-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--gold, #d4af37);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ==================== 集體解讀 ==================== */

.daily-card-reading {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    margin-bottom: 12px;
}

.daily-card-reading p {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(212, 175, 55, 0.9);
    margin: 0;
    text-align: justify;
}

/* ==================== 載入骨架 ==================== */

.daily-card-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.skeleton-card {
    width: 120px;
    height: 200px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 10px;
}

.skeleton-text {
    width: 80%;
    height: 14px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 4px;
}

.skeleton-text.short {
    width: 50%;
}

.pulse {
    animation: dailyCardPulseLoad 1.5s ease-in-out infinite;
}

@keyframes dailyCardPulseLoad {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ==================== 錯誤 & 重試 ==================== */

.daily-card-error {
    text-align: center;
    font-size: 13px;
    color: rgba(212, 175, 55, 0.5);
    margin-bottom: 12px;
}

.daily-card-retry {
    display: block;
    margin: 0 auto;
    padding: 8px 24px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: var(--gold, #d4af37);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.daily-card-retry:hover {
    border-color: var(--gold, #d4af37);
}

/* ==================== Toast 通知 ==================== */

.daily-card-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold, #d4af37);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Noto Sans TC', sans-serif;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* ==================== hidden 工具類 ==================== */

.daily-card-widget .hidden {
    display: none !important;
}

/* ==================== 手機端調適 ==================== */

@media (max-width: 480px) {
    .daily-card-flip-container {
        width: 110px;
        height: 189px;
    }

    .daily-card-name {
        font-size: 15px;
    }

    .daily-card-reading p {
        font-size: 13px;
        line-height: 1.7;
    }

    .daily-card-widget {
        padding: 12px 12px;
    }
}
