:root {
    --bg-color: #f0f2f5;
    --bg-pattern-color: #e0e0e0;
    --container-bg-color: white;
    --text-color: #2c3e50;
    --input-bg-color: white;
    --input-border-color: #ddd;
    --input-text-color: #555;
    --btn-bg-color: #42b983;
    --btn-text-color: white;
    --history-h2-color: #2c3e50;
    --history-li-bg-color: #f9f9f9;
    --history-date-color: #777;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --bg-pattern-color: #444;
    --container-bg-color: #2c2c2c;
    --text-color: #f0f2f5;
    --input-bg-color: #333;
    --input-border-color: #555;
    --input-text-color: #f0f2f5;
    --btn-bg-color: #42b983;
    --btn-text-color: white;
    --history-h2-color: #f0f2f5;
    --history-li-bg-color: #3a3a3a;
    --history-date-color: #aaa;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-12 78c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm51-68c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zM9 52c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm52-41c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zM90 69c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-71 2c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-1-51c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm71 7c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm1 47c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zM23 30c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-2 57c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm59-64c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-3 58c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-15-28c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-44-3c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm81-22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-15 48c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z" fill="var(--bg-pattern-color)" fill-opacity="0.4" fill-rule="evenodd"%3E%3C/path%3E%3C/svg%3E');
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease;
}

.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #42b983;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.container {
    background-color: var(--container-bg-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 500px;
    width: 90%;
    transition: background-color 0.3s ease;
}

h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.input-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--input-text-color);
    margin-bottom: 5px;
}

#mbti, .birthdate-selects select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--input-border-color);
    background-color: var(--input-bg-color);
    color: var(--input-text-color);
    font-size: 1rem;
    box-sizing: border-box;
}

#mbti {
    width: 180px;
}

.birthdate-selects {
    display: flex;
    gap: 10px;
}

.birthdate-selects select {
    width: auto;
}

#numbers-container {
    display: flex;
    flex-direction: column; /* Stack lotto sets vertically */
    align-items: center; /* Center each lotto set */
    gap: 15px; /* Space between different lotto sets */
    margin: 30px 0;
}

.lotto-set {
    display: flex;
    gap: 10px; /* Space between numbers within a set */
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.number {
    width: 60px;
    height: 60px;
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(66, 185, 131, 0.4);
}

#generate-btn {
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    font-size: 1.2rem;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(66, 185, 131, 0.4);
}

#generate-btn:hover {
    background-color: #3aa875;
    box-shadow: 0 8px 20px rgba(66, 185, 131, 0.6);
    transform: translateY(-2px);
}

#generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(66, 185, 131, 0.4);
}

#history-container {
    margin-top: 40px;
    text-align: left;
}

#history-container h2 {
    color: var(--history-h2-color);
    font-size: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

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

#history-list li {
    background-color: var(--history-li-bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-color);
}

.history-date {
    font-size: 0.9rem;
    color: var(--history-date-color);
}

.generate-buttons-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.generate-buttons-group button {
    background-color: var(--btn-bg-color);
    color: var(--btn-text-color);
    font-size: 1.2rem;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(66, 185, 131, 0.4);
}

.generate-buttons-group button:hover {
    background-color: #3aa875;
    box-shadow: 0 8px 20px rgba(66, 185, 131, 0.6);
    transform: translateY(-2px);
}

.generate-buttons-group button:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(66, 185, 131, 0.4);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    h1 {
        font-size: 2rem;
        gap: 10px;
    }

    .input-container {
        flex-direction: column;
        align-items: stretch;
    }

    #mbti, .birthdate-selects select {
        width: 100%;
    }

    .birthdate-selects {
        justify-content: space-between;
    }

    .number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .generate-buttons-group button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
        gap: 10px;
    }

    .number {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    #history-list li {
        font-size: 1rem;
        padding: 10px;
    }

    .history-date {
        font-size: 0.8rem;
    }
}
