:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent-color: #3498db;
    --button-text: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: rgba(30, 30, 30, 0.9);
    --text-primary: #f8f9fa;
    --text-secondary: #bdc3c7;
    --accent-color: #5dade2;
    --button-text: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --input-bg: #2c3e50;
}

* {
    box-sizing: border-box;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', 'Noto Sans KR', sans-serif;
    background-color: var(--bg-primary);
    margin: 0;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Header & Navigation */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: var(--glass-border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

/* Main Layout */
.main-layout {
    max-width: 800px;
    margin: 100px auto 40px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.container {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: var(--glass-border);
    text-align: center;
}

.ad-placeholder {
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed #ccc;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    border-radius: 12px;
}

/* Typography */
h1 { font-size: 2.5rem; margin-bottom: 0.5rem; letter-spacing: -1px; }
.subtitle { color: var(--text-secondary); margin-bottom: 2rem; }
h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }

/* Content Sections */
.content-section {
    text-align: left;
}

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

.tip-card {
    background: var(--input-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: var(--glass-border);
}

.tip-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--accent-color);
}

.tip-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Lotto Elements */
#lotto-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 2rem 0;
    min-height: 60px;
}

.lotto-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* Buttons & Inputs */
#generate-button, #submit-button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#generate-button:hover, #submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

input, textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 1rem;
    border: 1px solid #eee;
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    padding: 3rem 20px;
    border-top: var(--glass-border);
    margin-top: 4rem;
    text-align: center;
}

.footer-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 80px; /* Offset for nav or other items */
    width: 45px;
    height: 45px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow);
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .main-layout { margin-top: 80px; }
    .container { padding: 2rem 1.5rem; }
}
