/* ============================================
   Tarot Gypsy - 神秘暗黑風格樣式表
   ============================================ */

/* CSS 變數 */
:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --accent-gold: #d4af37;
    --accent-gold-light: #f0d875;
    --accent-purple: #6b4c9a;
    --accent-purple-light: #8b6cba;
    --accent-mystic: #4a3f6b;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --border-color: #2a2a3e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    --shadow-purple: 0 0 30px rgba(107, 76, 154, 0.4);
    --transition: all 0.3s ease;
    --font-display: 'Cinzel', serif;
    --font-body: 'Noto Sans TC', sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基礎樣式 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 星空背景 - 多層次神秘效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 50%, #050508 100%);
    z-index: -3;
}

/* 神秘月光光暈 */
body::after {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    background: radial-gradient(circle,
        rgba(107, 76, 154, 0.15) 0%,
        rgba(74, 63, 107, 0.08) 30%,
        transparent 70%);
    z-index: -2;
    animation: moonPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes moonPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 迷霧效果容器 */
#mystic-fog {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.fog-layer {
    position: absolute;
    bottom: -10%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to top,
        rgba(26, 26, 46, 0.6) 0%,
        rgba(26, 26, 46, 0.3) 30%,
        transparent 100%);
    animation: fogDrift 20s ease-in-out infinite;
}

.fog-layer:nth-child(2) {
    animation-duration: 25s;
    animation-delay: -5s;
    opacity: 0.5;
}

.fog-layer:nth-child(3) {
    animation-duration: 30s;
    animation-delay: -10s;
    opacity: 0.3;
}

@keyframes fogDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-25%); }
}

/* 星空容器 */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.star.golden {
    background: var(--accent-gold-light);
    box-shadow: 0 0 4px var(--accent-gold);
}

.star.purple {
    background: var(--accent-purple-light);
    box-shadow: 0 0 4px var(--accent-purple);
}

/* 漂浮粒子容器 */
#floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatUp var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}

/* 滑鼠軌跡效果 */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(212, 175, 55, 0.8) 0%,
        rgba(212, 175, 55, 0) 70%);
    z-index: 9999;
    animation: trailFade 0.8s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* 神秘裝飾元素 */
.mystic-decoration {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
    font-size: 2rem;
    color: var(--accent-gold);
    animation: symbolFloat 15s ease-in-out infinite;
}

@keyframes symbolFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.05;
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
        opacity: 0.15;
    }
}

/* 導航列 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--accent-gold);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.logo:hover {
    color: var(--accent-gold-light);
    text-shadow: var(--shadow-gold);
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-gold);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* 手機選單按鈕 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* 主要內容區 */
.main-content {
    min-height: calc(100vh - 200px);
    padding-top: 80px;
}

/* 頁尾 */
.footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content {
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-gold);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 通用按鈕 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 標題 */
.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* 卡片元素 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 1rem 2rem;
        text-align: center;
    }

    .nav-link::after {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .section-title {
        font-size: 2rem;
    }

    .container {
        padding: 0 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-gold);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-gold), 0 0 30px var(--accent-purple);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.glow {
    animation: glow 2s ease-in-out infinite;
}
