:root {
    --background-color-light: #f0f0f0;
    --text-color-light: #333;
    --container-bg-light: #fff;
    --button-bg-light: #4CAF50;
    --button-text-light: white;
    --header-bg-light: #fff;
    --lotto-number-bg-light: #eee;

    --background-color-dark: #333;
    --text-color-dark: #f0f0f0;
    --container-bg-dark: #444;
    --button-bg-dark: #5cb85c;
    --button-text-dark: white;
    --header-bg-dark: #444;
    --lotto-number-bg-dark: #555;
}

body {
    font-family: sans-serif;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}

.container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch-wrapper button {
    background: none;
    border: 1px solid #ccc;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

.lang-switch-wrapper button.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.lotto-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.lotto-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

#generate-btn, .container button {
    display: inline-block;
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 1rem;
}

.history {
    margin-top: 2rem;
}

.history ul {
    list-style-type: none;
    padding: 0;
}

.history li {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.contact-form {
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form label {
    display: flex;
    flex-direction: column;
}

.contact-form input,
.contact-form textarea {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.contact-form button {
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
}

/* Light Mode by default */
body {
    background-color: var(--background-color-light);
    color: var(--text-color-light);
}

.container {
    background-color: var(--container-bg-light);
}

#generate-btn, .container button {
    background-color: var(--button-bg-light);
    color: var(--button-text-light);
}

.lotto-number {
    background-color: var(--lotto-number-bg-light);
}

/* Dark Mode */
body.dark-mode {
    background-color: var(--background-color-dark);
    color: var(--text-color-dark);
}

body.dark-mode .container {
    background-color: var(--container-bg-dark);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

body.dark-mode .header {
    border-bottom: 1px solid #555;
}

body.dark-mode #generate-btn,
body.dark-mode .container button {
    background-color: var(--button-bg-dark);
    color: var(--button-text-dark);
}

body.dark-mode .lotto-number {
    background-color: var(--lotto-number-bg-dark);
}

body.dark-mode .history li {
    border-bottom: 1px solid #555;
}

body.dark-mode .contact-form {
    border-top: 1px solid #555;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
    background-color: #555;
    border-color: #777;
    color: white;
}


/* Theme Switcher */
.theme-switch-wrapper {
    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;
}

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

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

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

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#webcam-container {
    margin-top: 20px;
}

#label-container {
    margin-top: 20px;
    font-size: 1.2em;
}
