:root {
    --background-color: #f0f0f0;
    --container-background: #fff;
    --text-color: #333;
    --secondary-text-color: #666;
    --border-color: #ddd;
    --shadow-color: rgba(0,0,0,0.1);
    --button-bg-10: #4CAF50;
    --button-bg-10-hover: #45a049;
    --button-bg-100: #2196F3;
    --button-bg-100-hover: #1e88e5;
    --button-bg-10000: #ff9800;
    --button-bg-10000-hover: #fb8c00;
    --button-bg-reset: #f44336;
    --button-bg-reset-hover: #d32f2f;
}

body.dark-mode {
    --background-color: #121212;
    --container-background: #1e1e1e;
    --text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --border-color: #444;
    --shadow-color: rgba(255,255,255,0.1);
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 2rem;
    transition: background-color 0.3s, color 0.3s;
}

.main-container {
    position: relative;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--container-background);
    color: var(--text-color);
}

.lotto-machine, .history-container {
    background: var(--container-background);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 20px var(--shadow-color);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.lotto-machine {
    text-align: center;
    min-width: 480px;
}

.history-container {
    width: 350px;
}

.lotto-machine h1, .lotto-machine h2, .history-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
}

.lotto-machine hr, .history-container hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

.numbers-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    min-height: 60px; /* Keep space for balls */
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.button-container button {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    border-radius: 0.5rem;
    color: white;
    transition: background-color 0.3s;
}

#generate-button-10 {
    background-color: var(--button-bg-10);
}

#generate-button-10:hover {
    background-color: var(--button-bg-10-hover);
}

#generate-button-100 {
    background-color: var(--button-bg-100);
}

#generate-button-100:hover {
    background-color: var(--button-bg-100-hover);
}

#generate-button-10000 {
    background-color: var(--button-bg-10000);
}

#generate-button-10000:hover {
    background-color: var(--button-bg-10000-hover);
}

#reset-button {
    background-color: var(--button-bg-reset);
}

#reset-button:hover {
    background-color: var(--button-bg-reset-hover);
}


lotto-ball {
    display: inline-block;
    animation: fadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px; /* Adjust height */
    overflow-y: auto;
}

#history-list li {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

#stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 1rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-count {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: bold;
}

#generation-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-bottom: 1rem;
}

#recommendations-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-start;
}

.recommendation-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.recommendation-count {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
}

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