
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #ff3cac;
    --secondary-color: #784ba0;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --glow-color: rgba(255, 60, 172, 0.8);
    --container-bg: rgba(0, 0, 0, 0.5);
    --container-shadow-1: rgba(0,0,0,0.5);
    --container-shadow-2: var(--primary-color);
    --container-shadow-3: var(--secondary-color);
    --container-border: rgba(255, 255, 255, 0.1);
    --lotto-ball-shadow-1: rgba(0,0,0,0.3);
    --lotto-ball-shadow-2: rgba(255,255,255,0.2);
}

body.light-mode {
    --primary-color: #4a148c; /* Darker purple for better contrast */
    --secondary-color: #1e88e5; /* A vibrant, but not overwhelming blue */
    --background-color: #f8f9fa; /* Softer, slightly warmer white background */
    --text-color: #212529; /* Very dark grey for maximum text readability */
    --glow-color: rgba(74, 20, 140, 0.3); /* Adjusted glow color */
    --container-bg: rgba(255, 255, 255, 0.95); /* Slightly more opaque container background */
    --container-shadow-1: rgba(0,0,0,0.15); /* Slightly stronger shadow for definition */
    --container-shadow-2: rgba(74, 20, 140, 0.2); /* Adjusted glow shadow */
    --container-shadow-3: rgba(30, 136, 229, 0.2); /* Adjusted glow shadow */
    --container-border: rgba(0, 0, 0, 0.15); /* Clearer border */
    --lotto-ball-shadow-1: rgba(0,0,0,0.15);
    --lotto-ball-shadow-2: rgba(0,0,0,0.08); /* Softer inner shadow */
}

/* Light mode specific text color adjustments for buttons and lotto balls */
body.light-mode .generate-btn,
body.light-mode .theme-toggle,
body.light-mode .lotto-ball {
    color: #ffffff; /* White text for better contrast on colored buttons/balls in light mode */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center content horizontally */
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll from button positioning */
    position: relative;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Header for buttons */
.main-header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px; /* Space between buttons */
    z-index: 100; /* Ensure header is above other content */
}

.header-btn {
    background: var(--primary-color);
    color: var(--text-color); /* Will be overridden to white in light mode */
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    /* Removed margin-bottom */
    transition: all 0.3s ease;
}

.header-btn:hover {
    opacity: 0.8;
}

/* Light mode specific text color adjustment for header buttons */
body.light-mode .header-btn {
    color: #ffffff;
}

.message-output {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
    min-height: 25px; /* To prevent layout shift */
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Main Content Sections Layout */
.main-content-sections {
    display: flex;
    justify-content: center; /* Center the entire block */
    align-items: flex-start; /* Align items to the top if they have different heights */
    gap: 40px; /* Space between lotto and dinner sections */
    margin-top: 100px; /* Space from the header */
    margin-bottom: 50px; /* Space below content sections */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    max-width: 1200px; /* Limit overall width */
}


/* Responsive adjustments */
@media (max-width: 600px) {
    .main-header {
        top: 10px;
        right: 10px;
        gap: 10px;
    }
    .header-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .main-content-sections {
        flex-direction: column; /* Stack vertically on small screens */
        align-items: center; /* Center stacked items */
        gap: 50px; /* Space between stacked items */
        margin-top: 80px;
    }
}

/* Contact Form Styles */
.contact-form-container {
    max-width: 500px;
    margin-top: 50px; /* Space between lotto and form */
    margin-bottom: 50px; /* Space below the form */
    padding: 40px; /* Increased padding for more breathing room */
    border-radius: 20px;
    background: var(--container-bg);
    box-shadow: 0 0 30px var(--container-shadow-1), 0 0 60px var(--container-shadow-2), 0 0 90px var(--container-shadow-3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--container-border);
    transition: background 0.5s ease, box-shadow 0.5s ease, border 0.5s ease;
}

.contact-form-container h2 {
    font-size: 2.5rem; /* Slightly larger heading */
    font-weight: 700; /* Bolder */
    margin-bottom: 30px; /* More space below heading */
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px var(--glow-color);
    transition: background 0.5s ease, text-shadow 0.5s ease;
}

.form-group {
    margin-bottom: 25px; /* Increased space between form groups */
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 10px; /* More space below label */
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: calc(100% - 24px); /* Adjusted width for padding */
    padding: 12px;
    border: 1px solid var(--container-border);
    border-radius: 10px; /* Slightly more rounded corners */
    background-color: var(--container-bg); /* Use container bg for inputs */
    color: var(--text-color);
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); /* Subtle inner shadow */
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.2), inset 0 2px 4px rgba(0,0,0,0.1); /* Clearer focus ring */
    outline: none;
    background-color: var(--container-bg); /* Maintain background on focus */
}

.form-group textarea {
    resize: vertical;
    min-height: 100px; /* Minimum height for textarea */
}

.submit-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #ffffff; /* Always white text for submit button for consistency */
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--glow-color);
    width: 100%;
    margin-top: 20px; /* More space above the button */
}

.submit-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 30px var(--glow-color), 0 0 40px var(--secondary-color);
}

.submit-btn:active {
    transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
    .container {
        padding: 30px;
    }
    h1 {
        font-size: 2.5rem;
    }
    .lotto-ball {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    .lotto-numbers {
        gap: 10px;
    }

    /* Responsive adjustments for Contact Form */
    .contact-form-container {
        padding: 25px;
        margin-top: 40px;
        margin-bottom: 40px;
    }
    .contact-form-container h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    .form-group {
        margin-bottom: 20px;
    }
    .form-group label {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group textarea {
        padding: 10px;
        font-size: 0.95rem;
        width: calc(100% - 20px);
    }
    .submit-btn {
        padding: 12px 25px;
        font-size: 1.1rem;
        margin-top: 15px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto; /* Allow scrolling if modal content is too long */
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal .contact-form-container {
    position: relative; /* For positioning the close button */
    transform: translateY(-50px); /* Initial offset for animation */
    transition: transform 0.3s ease-out;
    max-width: 90%; /* Adjust max-width for modal content */
    margin: 50px auto; /* Center the modal content vertically and horizontally */
}

.modal.show .contact-form-container {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001; /* Ensure it's above the form content */
}

.close-modal-btn:hover {
    color: var(--primary-color);
}

body.modal-open {
    overflow: hidden; /* Prevent scrolling on the body when modal is open */
}

/* Responsive adjustments for Modal */
@media (max-width: 600px) {
    .modal .contact-form-container {
        margin: 20px auto;
        padding: 20px;
    }
    .close-modal-btn {
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
    }
}

/* Dinner Recommendation Styles */
.dinner-recommendation-container {
    max-width: 500px;
    margin-top: 50px;
    margin-bottom: 50px;
    padding: 40px;
    border-radius: 20px;
    background: var(--container-bg);
    box-shadow: 0 0 30px var(--container-shadow-1), 0 0 60px var(--container-shadow-2), 0 0 90px var(--container-shadow-3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--container-border);
    text-align: center;
    transition: background 0.5s ease, box-shadow 0.5s ease, border 0.5s ease;
}

.dinner-recommendation-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    text-shadow: 0 0 10px var(--glow-color);
    transition: background 0.5s ease, text-shadow 0.5s ease;
}

.recommended-menu {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 30px;
    min-height: 2.5em; /* Ensure some height for text */
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 0 0 5px rgba(0,0,0,0.3);
    transition: color 0.5s ease, text-shadow 0.5s ease;
}

.recommend-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--text-color); /* Will be overridden to white in light mode */
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--glow-color);
}

.recommend-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 30px var(--glow-color), 0 0 40px var(--secondary-color);
}

.recommend-btn:active {
    transform: translateY(0) scale(1);
}

/* Light mode specific text color adjustment for recommend button */
body.light-mode .recommend-btn {
    color: #ffffff;
}

@media (max-width: 600px) {
    .dinner-recommendation-container {
        padding: 30px;
        margin-top: 40px;
        margin-bottom: 40px;
    }
    .dinner-recommendation-container h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    .recommended-menu {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    .recommend-btn {
        padding: 12px 25px;
        font-size: 1.1rem;
    }
}
