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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border-color: rgba(229, 231, 235, 0.5);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    --card-bg: rgba(31, 41, 55, 0.8);
    --text-main: #f9fafb;
    --text-muted: #d1d5db;
    --border-color: rgba(75, 85, 99, 0.5);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
    line-height: 1.6;
}

header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -1px;
}

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

nav ul a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s;
}

nav ul a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
}

.hero-img {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: var(--primary-color);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    animation: morph 8s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro {
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

#fortune {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    font-size: 1.3rem;
    font-weight: 500;
    min-height: 120px;
    display: flex;
    align-items: center;    justify-content: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.fortune-active {
    animation: fadeInScale 0.5s ease-out;
    border-color: var(--primary-color) !important;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

button:active {
    transform: translateY(0);
}

.form-section {
    margin-top: 4rem;
    text-align: left;
}

input, textarea {
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
}

footer {
    margin-top: auto;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    width: 44px;
    height: 24px;
    position: relative;
    cursor: pointer;
}

.theme-switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }
