:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5a623;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #ddd;
    --set-bg: #f8f9fa;
    --transition-speed: 0.3s;
    --max-width: 800px;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333;
    --set-bg: #2a2a2a;
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Header & Navigation */
.header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
}

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

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

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

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

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

/* Main Content Layout */
.main-content {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.container {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
    transition: background-color var(--transition-speed);
}

/* AdSense Containers */
.ad-container {
    width: 100%;
    min-height: 100px;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    overflow: hidden;
}

/* Generator Styles */
h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

[data-theme="dark"] .subtitle {
    color: #aaa;
}

.lotto-sets {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.lotto-set-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: var(--set-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    position: relative;
}

.lotto-set {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0;
    background: none;
    border: none;
}

.set-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.action-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    transition: all 0.2s;
}

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

.action-btn.save-btn {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.action-btn.save-btn:hover {
    background: var(--secondary-color);
    color: white;
}

.ball {
    width: 45px;
    height: 45px;
    line-height: 45px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.2);
}

.ball.range-1 { background: linear-gradient(135deg, #fbc02d, #f9a825); }
.ball.range-2 { background: linear-gradient(135deg, #1976d2, #1565c0); }
.ball.range-3 { background: linear-gradient(135deg, #d32f2f, #c62828); }
.ball.range-4 { background: linear-gradient(135deg, #7b1fa2, #6a1b9a); }
.ball.range-5 { background: linear-gradient(135deg, #388e3c, #2e7d32); }

.analysis-info {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

[data-theme="dark"] .analysis-info {
    color: #999;
}

.analysis-item b {
    color: var(--text-color);
}

.generate-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 300px;
}

.generate-btn:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

/* Saved Section */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--set-bg);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.saved-nums {
    display: flex;
    gap: 5px;
}

.saved-ball {
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
}

.empty-msg {
    color: #888;
    font-style: italic;
}

/* Info & FAQ Sections */
.info-section, .faq-section {
    text-align: left;
}

.info-section h2, .faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.content-block, .faq-item {
    margin-bottom: 2rem;
}

.content-block h3, .faq-item h4 {
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.faq-item p {
    background-color: var(--set-bg);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Contact Form */
.contact-form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
}

.submit-btn {
    width: 100%;
    padding: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 600px) {
    .nav-links {
        display: none;
    }
    .container {
        padding: 1.5rem;
    }
    .ball {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 0.85rem;
    }
    .analysis-info {
        flex-direction: column;
        gap: 0.2rem;
        align-items: center;
    }
}
