@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a1a;
    --bg-card: #12122a;
    --bg-card-hover: #1a1a3a;
    --accent-gold: #d4a853;
    --accent-purple: #8b5cf6;
    --accent-purple-dark: #6d28d9;
    --accent-teal: #06b6d4;
    --text-primary: #f0e6f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2a2a5a;
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
    --gradient-mystic: linear-gradient(135deg, #1a0533, #0d0d2b, #1a0533);
    --gradient-gold: linear-gradient(135deg, #d4a853, #f0d68a, #d4a853);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

body {
    font-family: 'Noto Sans Thai', 'Sarabun', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

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

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ===== LAYOUT ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER / TITLE ===== */
.site-header {
    text-align: center;
    padding: 30px 0;
}

.logo {
    font-size: 3rem;
    margin-bottom: 8px;
    display: block;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.site-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
    letter-spacing: 4px;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    border: none;
    border-radius: 16px;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

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

.btn-gold {
    background: var(--gradient-gold);
    color: #1a0533;
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(212, 168, 83, 0.5);
}

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

.btn-outline:hover {
    background: var(--accent-purple);
    color: white;
}

.btn-back {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.btn-back:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* ===== HERO SECTION (Main page) ===== */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
}

.hero-orb {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(139,92,246,0.15), transparent 70%);
    border: 1px solid rgba(139,92,246,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    animation: pulse-orb 4s ease-in-out infinite;
    position: relative;
}

.hero-orb::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(transparent, var(--accent-purple), transparent, var(--accent-gold), transparent);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 1px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 1px));
    animation: spin 8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-orb {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(139,92,246,0.1); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px rgba(139,92,246,0.2); }
}

.hero-orb .orb-icon {
    font-size: 5rem;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    line-height: 1.7;
    margin-bottom: 40px;
}

/* ===== SUB-BUTTONS (2 choices) ===== */
.choice-section {
    display: none;
    margin-top: 40px;
    animation: fadeUp 0.5s ease;
}

.choice-section.active {
    display: block;
}

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

.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.choice-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.choice-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.15);
    background: var(--bg-card-hover);
}

.choice-card .card-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
}

.choice-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.choice-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== FORM STYLES ===== */
.form-section {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.form-group label .label-icon {
    margin-right: 6px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input option {
    background: #0a0a1a;
    color: #f0e6f6;
}

.form-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ===== RESULT SECTION ===== */
.result-section {
    animation: fadeUp 0.6s ease;
    margin-top: 20px;
}

.result-header {
    text-align: center;
    margin-bottom: 36px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.result-header .result-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.result-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.result-header .result-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== FORECAST CARDS ===== */
.forecast-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.forecast-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 28px;
    transition: all 0.3s ease;
}

.forecast-card:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow);
}

.forecast-card .card-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tag-weekly { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.tag-today { background: rgba(6,182,212,0.15); color: var(--accent-teal); }
.tag-luck { background: rgba(212,168,83,0.15); color: var(--accent-gold); }
.tag-tarot { background: rgba(239,68,68,0.15); color: #ef4444; }

.forecast-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.forecast-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== LUCK SOURCES ===== */
.luck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.luck-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.luck-item:hover {
    background: rgba(212,168,83,0.05);
    border-color: var(--accent-gold);
}

.luck-item .luck-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.luck-item .luck-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.luck-item .luck-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== TAROT LAYOUT ===== */
.tarot-spread {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.tarot-card-wrapper {
    text-align: center;
    animation: cardReveal 0.8s ease forwards;
    opacity: 0;
    transform: translateY(30px) rotateY(90deg);
}

.tarot-card-wrapper:nth-child(1) { animation-delay: 0.1s; }
.tarot-card-wrapper:nth-child(2) { animation-delay: 0.4s; }
.tarot-card-wrapper:nth-child(3) { animation-delay: 0.7s; }

@keyframes cardReveal {
    to { opacity: 1; transform: translateY(0) rotateY(0); }
}

.tarot-card-img {
    width: 180px;
    height: 280px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.tarot-card-img:hover {
    transform: scale(1.05) translateY(-8px);
    border-color: var(--accent-gold);
}

.tarot-card-label {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tarot-card-name {
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.tarot-interpretation {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 28px;
    margin-top: 16px;
}

.tarot-interpretation h4 {
    color: var(--accent-purple);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.tarot-interpretation p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.tarot-interpretation .position-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
}

.badge-past { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-present { background: rgba(139,92,246,0.2); color: var(--accent-purple); }
.badge-future { background: rgba(212,168,83,0.2); color: var(--accent-gold); }

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .choice-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .tarot-spread {
        gap: 16px;
    }
    .tarot-card-img {
        width: 140px;
        height: 210px;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .site-title {
        font-size: 1.5rem;
    }
    .luck-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== SPINNER ===== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 20px auto;
}

.hidden { display: none; }

/* ===== THEME: สดชื่น (Fresh/Bright) ===== */
body.theme-fresh {
    --bg-dark: #f0f7f4;
    --bg-card: #ffffff;
    --bg-card-hover: #f0fdf4;
    --accent-gold: #10b981;
    --accent-purple: #38bdf8;
    --accent-purple-dark: #0284c7;
    --accent-teal: #0d9488;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #d1d5db;
    --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.1);
    --gradient-mystic: linear-gradient(135deg, #ecfdf5, #f0fdf4, #ecfdf5);
    --gradient-gold: linear-gradient(135deg, #10b981, #34d399, #10b981);
    --gradient-purple: linear-gradient(135deg, #38bdf8, #7dd3fc);
}

body.theme-fresh {
    background: linear-gradient(135deg, #f0f7f4 0%, #ecfdf5 50%, #fefce8 100%);
}

body.theme-fresh .forecast-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-color: #e2e8f0;
}

body.theme-fresh .forecast-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
}

body.theme-fresh .tarot-card-img {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-color: #e2e8f0;
}

body.theme-fresh .tarot-card-img:hover {
    border-color: #10b981;
}

body.theme-fresh .tarot-interpretation {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

body.theme-fresh .result-header {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

body.theme-fresh .tag-weekly {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

body.theme-fresh .tag-today {
    background: rgba(56, 189, 248, 0.12);
    color: #0284c7;
}

body.theme-fresh .tag-luck {
    background: rgba(251, 191, 36, 0.12);
    color: #b45309;
}

body.theme-fresh .tag-tarot {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

body.theme-fresh .badge-past {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

body.theme-fresh .badge-present {
    background: rgba(56, 189, 248, 0.12);
    color: #0284c7;
}

body.theme-fresh .badge-future {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

body.theme-fresh .choice-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

body.theme-fresh .choice-card:hover {
    border-color: #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

body.theme-fresh .form-input {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1e293b;
}

body.theme-fresh .form-input option {
    background: #ffffff;
    color: #1e293b;
}

body.theme-fresh .form-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.1);
}

body.theme-fresh .hero-orb {
    border-color: rgba(16, 185, 129, 0.2);
    background: radial-gradient(circle at center, rgba(16,185,129,0.08), transparent 70%);
}

body.theme-fresh .hero-orb::before {
    background: conic-gradient(transparent, #10b981, transparent, #fbbf24, transparent);
}

body.theme-fresh .luck-item:hover {
    background: rgba(16, 185, 129, 0.04);
    border-color: #10b981;
}

body.theme-fresh .btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

body.theme-fresh .btn-primary:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

body.theme-fresh .btn-outline {
    color: #10b981;
    border-color: #10b981;
}

body.theme-fresh .btn-outline:hover {
    background: #10b981;
    color: white;
}

body.theme-fresh .site-title {
    background: linear-gradient(135deg, #059669, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.theme-fresh .hero h1 {
    background: linear-gradient(135deg, #059669, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.theme-fresh .btn-gold {
    background: linear-gradient(135deg, #10b981, #34d399, #10b981);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

body.theme-fresh .btn-gold:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

body.theme-fresh .tarot-card-name {
    color: #059669;
}

body.theme-fresh .tarot-interpretation h4 {
    color: #0284c7;
}

body.theme-fresh footer {
    border-top-color: #e2e8f0;
}

body.theme-fresh .star {
    background: #94a3b8;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-gold);
    box-shadow: 0 0 16px rgba(212, 168, 83, 0.2);
}

body.theme-fresh .theme-toggle {
    border-color: #d1d5db;
    background: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body.theme-fresh .theme-toggle:hover {
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}
