/* ================================
   Palm Reading - Mystical Theme
   ================================ */

:root {
    /* Spacing */
    --container-max: 900px;
    --section-gap: 2.5rem;
    --card-radius: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Accent colors - mystical gold & violet (shared) */
    --gold-primary: #d4a853;
    --gold-light: #f0d78c;
    --gold-dark: #a67c3d;
    --violet: #8b7fd4;
    --violet-light: #b4a9e8;
    --rose: #c77d8e;
}

/* ================================
   Dark Theme (Default)
   ================================ */
[data-theme="dark"] {
    /* Core palette - deep night sky */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121f;
    --bg-card: rgba(20, 20, 35, 0.7);
    
    /* Text colors */
    --text-primary: #e8e6f0;
    --text-secondary: #a09cb5;
    --text-muted: #6b6880;
    
    /* Glass effect */
    --glass-bg: rgba(30, 28, 50, 0.6);
    --glass-border: rgba(212, 168, 83, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Component specific */
    --input-bg: rgba(0, 0, 0, 0.3);
    --card-hover-bg: rgba(212, 168, 83, 0.05);
    --card-selected-bg: rgba(212, 168, 83, 0.1);
    --result-step-bg: rgba(0, 0, 0, 0.2);
}

/* ================================
   Light Theme
   ================================ */
[data-theme="light"] {
    /* Core palette - warm cream & ivory */
    --bg-primary: #faf8f5;
    --bg-secondary: #f0ebe3;
    --bg-card: rgba(255, 255, 255, 0.85);
    
    /* Text colors */
    --text-primary: #2d2a3e;
    --text-secondary: #5a5670;
    --text-muted: #8a869c;
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(166, 124, 61, 0.25);
    --glass-shadow: 0 8px 32px rgba(166, 124, 61, 0.12);
    
    /* Component specific */
    --input-bg: rgba(255, 255, 255, 0.8);
    --card-hover-bg: rgba(212, 168, 83, 0.08);
    --card-selected-bg: rgba(212, 168, 83, 0.15);
    --result-step-bg: rgba(240, 235, 227, 0.6);
    
    /* Adjusted accents for light mode */
    --gold-light: #c49a3d;
    --violet-light: #7b6fc4;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif KR', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-smooth), color var(--transition-smooth), opacity 0.3s ease-in;
}

body.page-transition {
    opacity: 1;
}

/* Language-specific fonts */
[data-lang="ja"] body {
    font-family: 'Noto Sans JP', 'Noto Serif KR', sans-serif;
}

[data-lang="zh"] body {
    font-family: 'Noto Sans SC', 'Noto Serif KR', sans-serif;
}

/* ================================
   Global Controls Bar
   ================================ */
.global-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: background-color var(--transition-smooth);
}

/* Mobile Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 999;
    transition: left 0.3s ease-out;
    padding: 4rem 1.5rem 2rem;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu .nav-link {
    display: block;
    padding: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--glass-border);
}

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active {
    background: var(--card-hover-bg);
    color: var(--gold-light);
}

.controls-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    border-color: var(--gold-primary);
    background: var(--card-hover-bg);
}

.lang-flag {
    font-size: 1.1rem;
}

.lang-code {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.lang-arrow {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.language-selector.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 150px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    overflow: hidden;
}

.language-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-option:hover {
    background: var(--card-hover-bg);
}

.lang-option.active {
    background: var(--card-selected-bg);
    color: var(--gold-primary);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--gold-primary);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.theme-icon.sun {
    left: 8px;
    opacity: 0;
}

.theme-icon.moon {
    right: 8px;
    opacity: 1;
}

[data-theme="light"] .theme-icon.sun {
    opacity: 1;
}

[data-theme="light"] .theme-icon.moon {
    opacity: 0;
}

.theme-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    border-radius: 50%;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .theme-slider {
    left: calc(100% - 27px);
}

/* Animated Background Elements */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold-light);
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    opacity: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: var(--max-opacity); transform: scale(1.2); }
}

.mystic-orb {
    position: fixed;
    top: 20%;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle at 30% 30%, 
        rgba(139, 127, 212, 0.15) 0%, 
        rgba(212, 168, 83, 0.08) 40%, 
        transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: orbFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-50px, 50px) scale(1.1); }
    66% { transform: translate(30px, -30px) scale(0.95); }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 5rem 1.5rem 3rem;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
}

/* ================================
   Hero Section
   ================================ */
.hero {
    text-align: center;
    padding: 2rem 0 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-symbol {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: gentleFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(212, 168, 83, 0.5));
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
}

.title-sub {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-style: italic;
    color: var(--violet-light);
    margin-top: 0.5rem;
    letter-spacing: 0.2em;
}

.hero-desc {
    white-space: pre-line;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ================================
   Section Styles
   ================================ */
.api-section,
.dominant-section,
.upload-section,
.action-section {
    margin-bottom: var(--section-gap);
    animation: fadeInUp 0.6s ease-out backwards;
}

.api-section { animation-delay: 0.1s; }
.dominant-section { animation-delay: 0.2s; }
.upload-section { animation-delay: 0.3s; }
.action-section { animation-delay: 0.4s; }

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

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-icon {
    font-size: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold-light);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

/* ================================
   API Key Section
   ================================ */
.api-section {
    padding: 1.75rem;
}

.api-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.api-input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

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

.api-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.toggle-btn {
    width: 50px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-btn:hover {
    background: rgba(212, 168, 83, 0.1);
}

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

.api-hint a {
    color: var(--violet-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.api-hint a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ================================
   Hand Selection
   ================================ */
.dominant-section {
    padding: 1.75rem;
}

.hand-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.hand-option {
    cursor: pointer;
}

.hand-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.hand-option input:checked + .hand-card {
    border-color: var(--gold-primary);
    background: var(--card-selected-bg);
    box-shadow: 0 0 30px rgba(212, 168, 83, 0.15);
}

.hand-option:hover .hand-card {
    background: var(--card-hover-bg);
}

.hand-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
}

.hand-option input:checked + .hand-card .hand-emoji {
    transform: scale(1.1);
}

.hand-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.hand-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================
   Upload Section
   ================================ */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

.upload-card {
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.upload-card:hover {
    transform: translateY(-2px);
}

.upload-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.upload-icon {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-card[data-hand="left"] .upload-icon {
    color: var(--violet-light);
}

.upload-card[data-hand="right"] .upload-icon {
    color: var(--gold-light);
}

.upload-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-meaning {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-zone {
    position: relative;
    aspect-ratio: 4/3;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-fast);
}

.upload-zone:hover {
    border-color: var(--gold-primary);
    background: var(--card-hover-bg);
}

.upload-zone.dragover {
    border-color: var(--gold-light);
    background: var(--card-selected-bg);
}

.upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

.upload-icon-large {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.upload-placeholder p {
    white-space: pre-line;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    color: var(--bg-primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.upload-zone:hover .upload-btn {
    transform: scale(1.05);
}

.upload-preview {
    position: absolute;
    inset: 0;
    display: none;
}

.upload-preview.active {
    display: block;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.remove-btn:hover {
    background: var(--rose);
}

/* ================================
   Analyze Button
   ================================ */
.action-section {
    text-align: center;
    padding: 1rem 0;
}

.analyze-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 50%, var(--gold-light) 100%);
    border: none;
    border-radius: 50px;
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

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

.analyze-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.25rem;
}

.action-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ================================
   Loading State
   ================================ */
.loading-section {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
}

.loading-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.crystal-ball {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.crystal-inner {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.2) 0%,
        rgba(139, 127, 212, 0.3) 30%,
        rgba(212, 168, 83, 0.2) 60%,
        rgba(139, 127, 212, 0.1) 100%);
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    box-shadow: 
        inset 0 -20px 40px rgba(0, 0, 0, 0.3),
        0 10px 40px rgba(139, 127, 212, 0.3);
    animation: crystalPulse 2s ease-in-out infinite;
}

@keyframes crystalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.crystal-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, 
        rgba(212, 168, 83, 0.3) 0%, 
        transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from { opacity: 0.5; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

.loading-text {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 2rem;
}

.loading-steps {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.loading-steps .step {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: var(--transition-fast);
}

.loading-steps .step.active {
    color: var(--gold-light);
    border-color: var(--gold-primary);
    background: rgba(212, 168, 83, 0.1);
}

/* ================================
   Results Section
   ================================ */
.results-section {
    display: none;
    animation: fadeInUp 0.8s ease-out;
}

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

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

.results-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.results-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.results-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

/* Result Typography */
.results-content h3 {
    font-size: 1.35rem;
    color: var(--gold-light);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.results-content h3:first-child {
    margin-top: 0;
}

.results-content h4 {
    font-size: 1.1rem;
    color: var(--violet-light);
    margin: 1.5rem 0 0.75rem;
}

.results-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.9;
}

.results-content strong {
    color: var(--text-primary);
}

.results-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.results-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.results-content li::marker {
    color: var(--gold-primary);
}

/* Result Cards for each section */
.result-step {
    background: var(--result-step-bg);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.result-step:last-child {
    margin-bottom: 0;
}

.result-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.result-step-icon {
    font-size: 1.5rem;
}

.result-step-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold-light);
}

.new-analysis-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--gold-primary);
    border-radius: 50px;
    color: var(--gold-light);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.new-analysis-btn:hover {
    background: var(--card-hover-bg);
    transform: translateY(-2px);
}

/* Light mode adjustments */
[data-theme="light"] .stars-container {
    opacity: 0.3;
}

[data-theme="light"] .mystic-orb {
    background: radial-gradient(circle at 30% 30%, 
        rgba(139, 127, 212, 0.08) 0%, 
        rgba(212, 168, 83, 0.05) 40%, 
        transparent 70%);
}

[data-theme="light"] .hero-symbol {
    filter: drop-shadow(0 0 15px rgba(166, 124, 61, 0.4));
}

[data-theme="light"] .title-line {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-primary) 50%, #8b6914 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .crystal-inner {
    background: radial-gradient(circle at 30% 30%, 
        rgba(255, 255, 255, 0.8) 0%,
        rgba(139, 127, 212, 0.2) 30%,
        rgba(212, 168, 83, 0.15) 60%,
        rgba(139, 127, 212, 0.1) 100%);
}

[data-theme="light"] .remove-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
}

/* ================================
   Navigation Links
   ================================ */
.nav-links {
    display: flex;
    gap: 0.5rem;
    margin-right: auto;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--gold-light);
    background: var(--card-hover-bg);
}

.nav-link.active {
    color: var(--gold-light);
    background: var(--card-selected-bg);
}

/* ================================
   Google Ads Container
   ================================ */
.ad-container {
    width: 100%;
    min-height: 100px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ad-container::before {
    content: 'Advertisement';
    opacity: 0.5;
}

/* ================================
   Footer Links
   ================================ */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

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

/* ================================
   Footer
   ================================ */
.footer {
    text-align: center;
    padding: 3rem 1rem 2rem;
    margin-top: 2rem;
}

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

.footer-sub {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ================================
   Blog Page Styles
   ================================ */
.blog-container {
    max-width: 1100px;
}

.blog-header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.blog-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 6vw, 3rem);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.blog-card {
    padding: 1.75rem;
    transition: var(--transition-smooth);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.blog-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.blog-card-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    display: inline-block;
    color: var(--violet-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.blog-card-link:hover {
    color: var(--gold-light);
}

/* Blog CTA */
.blog-cta {
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.blog-cta h2 {
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 0.75rem;
}

.blog-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition-smooth);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 168, 83, 0.4);
}

/* ================================
   Article Page Styles
   ================================ */
.article-container {
    max-width: 800px;
}

.article-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: var(--violet-light);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--gold-light);
}

.article-header h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    color: var(--gold-light);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-body {
    padding: 2.5rem;
}

.article-intro {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.9;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.article-body h2 {
    font-size: 1.5rem;
    color: var(--gold-light);
    margin: 2.5rem 0 1rem;
}

.article-body h3 {
    font-size: 1.15rem;
    color: var(--violet-light);
    margin: 1.5rem 0 0.75rem;
}

.article-body p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.article-body ul {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.article-body li strong {
    color: var(--text-primary);
}

.article-cta {
    background: var(--card-selected-bg);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    margin-top: 2.5rem;
}

.article-cta h3 {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.article-cta p {
    margin-bottom: 1.5rem;
}

/* Related Articles */
.related-articles {
    margin-top: 3rem;
}

.related-articles h2 {
    font-size: 1.25rem;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.related-card:hover {
    transform: translateY(-2px);
    background: var(--card-hover-bg);
}

.related-icon {
    font-size: 1.5rem;
}

.related-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ================================
   Page Content Styles (About, Privacy, Contact)
   ================================ */
.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.page-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-style: italic;
}

.content-card {
    padding: 2.5rem;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h2 {
    font-size: 1.35rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.about-section a {
    color: var(--violet-light);
}

.about-section a:hover {
    color: var(--gold-light);
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.comparison-item {
    background: var(--result-step-bg);
    padding: 1.5rem;
    border-radius: 12px;
}

.comparison-item h3 {
    color: var(--gold-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.comparison-item ul {
    padding-left: 1.25rem;
}

.comparison-item li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Page CTA */
.page-cta {
    text-align: center;
    padding: 2.5rem;
    margin-top: 2rem;
}

.page-cta h2 {
    font-size: 1.35rem;
    color: var(--gold-light);
    margin-bottom: 0.75rem;
}

.page-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ================================
   Legal Content (Privacy Policy)
   ================================ */
.legal-content {
    font-size: 0.95rem;
}

.legal-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 1rem;
}

.legal-section h3 {
    font-size: 1rem;
    color: var(--violet-light);
    margin: 1.25rem 0 0.75rem;
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.legal-section ul {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.legal-section li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.legal-section a {
    color: var(--violet-light);
}

/* ================================
   Contact Form
   ================================ */
.contact-intro {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-form {
    margin-bottom: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required {
    color: var(--rose);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.form-group select {
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.checkbox-label input {
    width: auto;
    accent-color: var(--gold-primary);
}

.checkbox-label a {
    color: var(--violet-light);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    border: none;
    border-radius: 50px;
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 168, 83, 0.4);
}

/* Form Success */
.form-success {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.form-success h3 {
    color: var(--gold-light);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.form-success p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Contact Info */
.contact-info {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.contact-info h2 {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-icon {
    font-size: 1.5rem;
}

.info-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.faq-section h2 {
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--result-step-bg);
    border-radius: 10px;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    transition: var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    float: right;
    color: var(--gold-primary);
    font-weight: bold;
}

.faq-item[open] summary::before {
    content: '−';
}

.faq-item summary:hover {
    background: var(--card-hover-bg);
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ================================
   Scrollbar
   ================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* ================================
   Media Queries
   ================================ */
@media (max-width: 768px) {
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .content-card {
        padding: 1.5rem;
    }
    
    .article-body {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 4.5rem 1rem 2rem;
    }
    
    .global-controls {
        padding: 0.5rem 1rem;
    }
    
    .controls-inner {
        gap: 0.5rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .lang-btn {
        padding: 0.4rem 0.6rem;
    }
    
    .lang-code {
        display: none;
    }
    
    .theme-toggle {
        width: 50px;
        height: 28px;
    }
    
    .theme-slider {
        width: 20px;
        height: 20px;
    }
    
    [data-theme="light"] .theme-slider {
        left: calc(100% - 23px);
    }
    
    .hero-symbol {
        font-size: 3rem;
    }
    
    .hand-selection {
        gap: 0.75rem;
    }
    
    .hand-card {
        padding: 1rem 0.75rem;
    }
    
    .hand-emoji {
        font-size: 2rem;
    }
    
    .analyze-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .results-content {
        padding: 1.5rem;
    }
    
    .loading-steps {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================
   Modal
   ================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold-primary);
    transform: rotate(90deg);
}

.modal-content {
    padding: 2.5rem;
}

.modal-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    color: var(--gold-light);
    margin: 0;
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.9;
}

.modal-body h2 {
    font-size: 1.35rem;
    color: var(--gold-light);
    margin: 2rem 0 1rem;
    padding-top: 1rem;
}

.modal-body h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
}

.modal-body h3 {
    font-size: 1.1rem;
    color: var(--violet-light);
    margin: 1.5rem 0 0.75rem;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-body .article-intro {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--result-step-bg);
    border-radius: 8px;
    border-left: 3px solid var(--gold-primary);
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.modal-body li::marker {
    color: var(--gold-primary);
}

.modal-body strong {
    color: var(--text-primary);
}

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

@media (max-width: 768px) {
    .modal-overlay {
        padding: 1rem;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }
}

