body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
    position: relative; /* Added for absolute positioning of child elements */
}

body.dark-mode {
    background-color: #333;
    color: #f4f4f4;
}

.container, .contact-form-container, .pet-face-test-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.dark-mode .container,
body.dark-mode .contact-form-container,
body.dark-mode .pet-face-test-container {
    background-color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h1, h2 {
    text-align: center;
    color: #333;
    transition: color 0.3s;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #f4f4f4;
}

.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.lotto-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

button, .button { /* Added .button to apply general button styles */
    display: block;
    width: 200px;
    padding: 10px;
    margin: 20px auto;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center; /* Ensure text is centered for anchor buttons */
    text-decoration: none; /* Remove underline for anchor buttons */
}

button:hover, .button:hover {
    background-color: #218838;
}

#theme-toggle {
    background-color: #6c757d;
    position: absolute; /* Changed to absolute */
    top: 20px; /* Aligned to top */
    right: 230px; /* Adjusted position to make space for the new button */
    width: auto; /* Allow width to adjust to content */
    margin: 0; /* Remove auto margin */
    padding: 8px 15px; /* Adjust padding */
}

#theme-toggle:hover {
    background-color: #5a6268;
}

#pet-face-test-toggle-btn {
    background-color: #ffc107; /* A distinct color for the new button */
    position: absolute;
    top: 20px;
    right: 20px;
    width: auto;
    margin: 0;
    padding: 8px 15px;
    color: #333;
    font-weight: bold;
}

#pet-face-test-toggle-btn:hover {
    background-color: #e0a800;
}


/* Contact Form Styles */
.contact-form-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form-container label {
    font-weight: bold;
}

.contact-form-container input[type="text"],
.contact-form-container input[type="email"],
.contact-form-container textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box; /* Ensures padding doesn't increase total width */
    background-color: #f8f8f8;
    color: #333;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body.dark-mode .contact-form-container input[type="text"],
body.dark-mode .contact-form-container input[type="email"],
body.dark-mode .contact-form-container textarea {
    background-color: #666;
    color: #f4f4f4;
    border-color: #888;
}

.contact-form-container input[type="text"]:focus,
.contact-form-container input[type="email"]:focus,
.contact-form-container textarea:focus {
    border-color: #007bff;
    outline: none;
}

.contact-form-container button[type="submit"] {
    background-color: #007bff;
    margin: 0 auto;
}

.contact-form-container button[type="submit"]:hover {
    background-color: #0056b3;
}

/* Teachable Machine styles */
.pet-face-test-container {
    text-align: center;
}

/* Removed #webcam-container styles */

#image-upload {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: calc(100% - 22px); /* Adjust for padding and border */
    display: block;
    box-sizing: border-box;
}

#uploaded-image {
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: block; /* Ensure it takes up full width if needed */
    object-fit: contain; /* Ensure image scales nicely */
}

#predict-button {
    background-color: #007bff; /* Blue color for predict button */
}

#predict-button:hover {
    background-color: #0056b3;
}

#label-container {
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: bold;
}

#label-container div {
    padding: 5px 0;
    color: #007bff;
}

.back-button {
    background-color: #6c757d; /* Grey color for back button */
    position: absolute;
    top: 20px;
    left: 20px;
    width: auto;
    margin: 0;
    padding: 8px 15px;
    color: white;
    font-weight: bold;
}

.back-button:hover {
    background-color: #5a6268;
}