:root {
    --background-color: #fcfaf5;
    --primary-color: #7b68ee; /* Medium Slate Blue */
    --secondary-color: #483d8b; /* Dark Slate Blue */
    --text-color: #2f4f4f;
    --container-bg: rgba(255, 255, 255, 0.95);
    --nav-bg: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --background-color: #1a1a2e;
    --primary-color: #a29bfe;
    --secondary-color: #6c5ce7;
    --text-color: #e0e0e0;
    --container-bg: #16213e;
    --nav-bg: #0f3460;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:ital,wght@0,400;0,700;1,400&family=Noto+Sans+KR:wght@300;400;700&display=swap');

body {
    margin: 0;
    font-family: 'Noto Sans KR', 'Lora', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Navigation */
.main-nav {
    width: 100%;
    background-color: var(--nav-bg);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.9rem;
}

/* Theme Toggle */
.theme-toggle {
    margin: 20px 0;
}

#theme-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
}

/* Container */
.container {
    background-color: var(--container-bg);
    max-width: 800px;
    width: 90%;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 2rem auto;
    text-align: center;
    flex: 1;
}

h1 {
    font-family: 'Cinzel', 'Noto Sans KR', serif;
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 3rem;
}

/* Tarot Card Display */
.tarot-display {
    perspective: 1000px;
    margin: 2rem auto;
    width: 200px;
    height: 320px;
}

.card-container {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    cursor: pointer;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.card-container.is-flipped {
    transform: rotateY(180deg);
}

.card-back, .card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-radius: 15px;
    border: 4px solid var(--primary-color);
    overflow: hidden;
}

.card-back {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: gold;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
}

.tarot-img, .tarot-img-detail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detail Page Specific */
.card-detail-page {
    text-align: center;
}

.detail-display {
    width: 240px;
    height: 400px;
    margin: 2rem auto;
    border-radius: 15px;
    border: 5px solid var(--primary-color);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.interpretation-box {
    text-align: left;
    background: rgba(0,0,0,0.03);
    padding: 2rem;
    border-radius: 15px;
    margin: 3rem 0;
}

.meaning-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.extended-content h3 {
    margin-top: 2rem;
    color: var(--primary-color);
}

.extended-content p {
    line-height: 1.8;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--secondary-color);
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid var(--secondary-color);
}

/* Card Links List */
.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.link-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.link-list a:hover {
    color: var(--primary-color);
}

/* Buttons */
.buttons-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.generate-btn, .copy-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn {
    background-color: var(--primary-color);
    color: white;
}

.copy-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.proverb-container {
    min-height: 100px;
    padding: 2rem;
    background: rgba(0,0,0,0.05);
    border-radius: 15px;
}

/* Footer */
.site-footer {
    width: 100%;
    background: var(--nav-bg);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
}

@media (max-width: 600px) {
    .container { padding: 1.5rem; }
    h1 { font-size: 1.8rem; }
    .link-list { grid-template-columns: repeat(2, 1fr); }
}
