:root {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #1c1e21;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --number-bg: #e4e6eb;
    --history-item-bg: #f0f2f5;
    --border-color: #dddfe2;
}

[data-theme="dark"] {
    --bg-color: #18191a;
    --container-bg: #242526;
    --text-color: #e4e6eb;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --number-bg: #3a3b3c;
    --history-item-bg: #3a3b3c;
    --border-color: #3e4042;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding: 20px 0;
}

.container {
    text-align: center;
    background-color: var(--container-bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s, box-shadow 0.3s;
    max-width: 450px;
    width: 90%;
    margin-bottom: 2rem;
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        width: 95%;
    }
    h1 { font-size: 1.5rem; }
}

#theme-toggle {
    background: var(--number-bg);
    border: none;
    color: var(--text-color);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

h1 {
    margin-top: 0;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.lotto-display {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.lotto-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--number-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    font-weight: bold;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

button:not(#theme-toggle) {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

#generate-btn { background-color: #00a400; }
#auto-generate-btn { background-color: #1877f2; }
#clear-history-btn { background-color: #fa3e3e; padding: 0.6rem 1rem; font-size: 0.9rem; }

.history {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: left;
}

#history-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

#history-list li {
    margin-bottom: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: var(--history-item-bg);
    border-radius: 8px;
    border-left: 4px solid #1877f2;
}

/* Affiliate Form Styles */
.affiliate-section {
    margin-top: 2rem;
    text-align: left;
}

.affiliate-section hr { border: 0; border-top: 1px solid var(--border-color); margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.9rem; margin-bottom: 0.4rem; font-weight: 600; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--number-bg);
    color: var(--text-color);
    font-family: inherit;
    box-sizing: border-box;
}

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

#submit-btn {
    width: 100%;
    background-color: #673ab7;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

#disqus_thread {
    width: 90%;
    max-width: 450px;
    background: var(--container-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}
