:root {
    /* Default (Dark/Vibrant) Theme */
    --bg-gradient: linear-gradient(to right, #6a11cb, #2575fc);
    --text-color: white;
    --number-bg: rgba(255, 255, 255, 0.2);
    --number-shadow: rgba(0, 0, 0, 0.2);
    --btn-bg: #ff4081;
    --btn-hover: #f50057;
    --toggle-bg: rgba(255, 255, 255, 0.3);
    --toggle-circle: white;
    --set-label-color: rgba(255, 255, 255, 0.7);
    --set-border: rgba(255, 255, 255, 0.1);
}

body.light-mode {
    /* Light Theme */
    --bg-gradient: linear-gradient(to right, #f0f2f5, #e1e4e8);
    --text-color: #333;
    --number-bg: rgba(0, 0, 0, 0.1);
    --number-shadow: rgba(0, 0, 0, 0.1);
    --btn-bg: #6200ea;
    --btn-hover: #3700b3;
    --toggle-bg: #ccc;
    --toggle-circle: #fff;
    --set-label-color: #666;
    --set-border: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Changed from height to min-height for scrolling */
    margin: 0;
    transition: background 0.5s, color 0.5s;
    position: relative;
    padding: 20px 0; /* Add padding for vertical spacing */
}

.container {
    text-align: center;
    width: 90%;
    max-width: 800px; /* Increased max-width */
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.numbers-container {
    display: flex;
    flex-direction: column; /* Stack sets vertically */
    gap: 1rem;
    margin-bottom: 2rem;
}

.lotto-set {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid var(--set-border);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.set-label {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--set-label-color);
    margin-right: 10px;
    width: 30px;
}

.number {
    width: 50px; /* Slightly smaller to fit 6 + label */
    height: 50px;
    border-radius: 50%;
    background-color: var(--number-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 10px var(--number-shadow);
    transition: background-color 0.5s, color 0.5s, transform 0.2s;
}

.number:hover {
    transform: scale(1.1);
}

/* Coloring logic based on number ranges (Lotto standard) */
.number[data-range="1"] { border: 2px solid #fbc400; color: #fbc400; background: rgba(251, 196, 0, 0.2); } /* 1-10 */
.number[data-range="2"] { border: 2px solid #69c8f2; color: #69c8f2; background: rgba(105, 200, 242, 0.2); } /* 11-20 */
.number[data-range="3"] { border: 2px solid #ff7272; color: #ff7272; background: rgba(255, 114, 114, 0.2); } /* 21-30 */
.number[data-range="4"] { border: 2px solid #aaaaaa; color: #aaaaaa; background: rgba(170, 170, 170, 0.2); } /* 31-40 */
.number[data-range="5"] { border: 2px solid #b0d840; color: #b0d840; background: rgba(176, 216, 64, 0.2); } /* 41-45 */

/* Light mode overrides for colored numbers for better visibility */
body.light-mode .number[data-range="1"] { color: #d4a500; border-color: #d4a500; }
body.light-mode .number[data-range="2"] { color: #0077c2; border-color: #0077c2; }
body.light-mode .number[data-range="3"] { color: #d32f2f; border-color: #d32f2f; }
body.light-mode .number[data-range="4"] { color: #616161; border-color: #616161; }
body.light-mode .number[data-range="5"] { color: #689f38; border-color: #689f38; }


#generate-btn {
    background-color: var(--btn-bg);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#generate-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
}

/* Toggle Switch Styles */
.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-toggle {
    background-color: var(--toggle-bg);
    border: none;
    border-radius: 30px;
    width: 60px;
    height: 30px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
    padding: 0;
    outline: none;
}

.theme-toggle .toggle-circle {
    background-color: var(--toggle-circle);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.light-mode .theme-toggle .toggle-circle {
    transform: translateX(30px);
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .lotto-set {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .number {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .theme-toggle-container {
        top: 10px;
        right: 10px;
    }
}
