/* Toggle Button */
#toggleMode {
    margin-top: 1rem;
    transition: background-color 0.3s ease;
    width: auto;
}

/* Base styles */
body {
    background-color: #f0f8ff; /* Light background */
    font-family: 'Roboto Slab', serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
    overflow-y: auto; /* Enable body scrolling if necessary */
    scroll-behavior: smooth; /* Smooth scrolling */
}

/* Container design */
.container {
    background: linear-gradient(to bottom, #ffffff, #f0f8ff);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    max-height: 80vh; /* Set max height to prevent overflow */
    overflow-y: auto; /* Enable scrolling inside the container */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Title styling */
h1 {
    font-family: "Roboto Slab", serif;
    font-size: 2rem;
    color: #555;
    margin-bottom: 1rem;
}

/* Label styling */
label {
    font-size: 1.1rem;
    color: #666;
    display: block;
    margin-bottom: 0.5rem;
}

/* Input styling */
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 1rem;
    box-sizing: border-box;
    background-color: #fafafa;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #87ceeb;
    box-shadow: 0 0 8px rgba(135, 206, 235, 0.5);
}

/* Submit button styling */
input[type="submit"], 
.commonButton {
    background-color: #87ceeb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

input[type="submit"]:hover, 
.commonButton:hover {
    background-color: #6cb8d9;
    transform: scale(1.05);
}

.back {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.next {
    margin-top: 0.5rem;
}

#backButtonTax {
    margin-top: 1rem;
}

/* Container for the buttons */
.buttonContainer {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
    gap: 10px; /* Space between the buttons */
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Style for individual buttons */
.nameButton {
    padding: 10px 15px;
    background-color: #3498db; /* Change to your preferred color */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.nameButton:hover {
    background-color: #2980b9; /* Darker shade on hover */
    transform: scale(1.05);
}

.nameButton.selected {
    background-color: #2ecc71; /* Green when selected */
}

/* Final Result Page Styling */
#finalResult {
    background-color: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 20px auto;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for night mode */
}

#finalResult h2, #finalResult h3 {
    font-family: 'Roboto Slab', serif;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    transition: color 0.3s ease;
}

#finalResult ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#finalResult li {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd; /* Border only below each person's total */
}

#finalResult li:last-child {
    border-bottom: none;
}

#finalResult li strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
    transition: color 0.3s ease;
}

#finalResult li ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#finalResult li ul li {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #555;
    padding-left: 0;
    text-align: center;
    border-bottom: none; /* Remove the border between food items */
}

#finalResult li ul li:last-child {
    margin-bottom: 0;
}

#finalResult li ul li::before {
    content: '•';
    color: #3498db;
    margin-right: 10px;
    font-size: 1.2rem;
    vertical-align: middle; /* Center bullet point vertically */
}


#finalResult h3 {
    font-size: 1.5rem;
    color: #2980b9;
    text-align: center;
    margin-top: 30px;
    transition: color 0.3s ease;
}

#finalResult .total-amount {
    font-size: 1.3rem;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
    transition: color 0.3s ease;
}

.pdfButton {
    margin-top: 10px;
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
        max-width: 90%;
    }

    h1 {
        font-size: 1.5rem;
    }

    input[type="submit"], 
    .commonButton {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .nameButton {
        padding: 8px 10px;
        font-size: 12px;
    }

    #toggleMode {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    #foodForm {
        grid-template-columns: repeat(2, 1fr); /* Show only 2 buttons per row on small screens */
    }
}

/* Night Mode Styling */
body.night-mode {
    background-color: #2c3e50; /* Dark background */
}

/* Night Mode Styling for the Container */
.container.night-mode {
    background: linear-gradient(to bottom, #34495e, #2c3e50);
    color: #ecf0f1; /* Light text */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Night Mode Styling for Titles and Labels */
.container.night-mode h1, 
.container.night-mode label {
    color: #ecf0f1; /* Inverted font color */
}

/* Night Mode Styling for Input Fields */
.container.night-mode input[type="number"],
.container.night-mode input[type="text"] {
    background-color: #95a5a6; /* Dark input fields */
    color: #ecf0f1; /* Light text in inputs */
}

/* Night Mode Styling for Buttons and Submit */
.container.night-mode button,
.container.night-mode input[type="submit"] {
    background-color: #850f01; /* Dark buttons */
    color: #ecf0f1; /* Light text */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
}

/* Hover Effects in Night Mode */
.container.night-mode button:hover,
.container.night-mode input[type="submit"]:hover {
    background-color: #a23b2f; /* Slightly lighter shade on hover */
}

/* Night Mode Styling for the Toggle Button */
#toggleMode.night-mode {
    background-color: #850f01; /* Red toggle button */
    color: #ecf0f1;
}

#toggleMode.night-mode:hover {
    background-color: #a23b2f;
}

/* Hover over names for night mode */
.container.night-mode .nameButton.selected {
    background-color: #EFBF04;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Toggle Button */
#toggleMode {
    margin-top: 1rem;
    transition: background-color 0.3s ease;
    width: auto;
}

#toggleMode:hover {
    background-color: #6cb8d9;
    transform: scale(1.1);
}

/* Night Mode Styles For Final Result */
body.night-mode #finalResult {
    background-color: #34495e; /* Darker background for night mode */
    border-color: #555; /* Darker border for night mode */
    color: #ecf0f1; /* Light text color */
}

body.night-mode #finalResult h2,
body.night-mode #finalResult h3 {
    color: #ecf0f1; /* Light text color */
}

body.night-mode #finalResult li {
    border-bottom-color: #555; /* Darker border color */
}

body.night-mode #finalResult li strong {
    color: #ecf0f1; /* Light text color */
}

body.night-mode #finalResult li ul li {
    color: #bdc3c7; /* Lighter text for night mode */
}

body.night-mode #finalResult li ul li::before {
    color: #e67e22; /* Orange bullet color in night mode */
}

body.night-mode #finalResult h3 {
    color: #e67e22; /* Orange color for total bill amount in night mode */
}

body.night-mode #finalResult .total-amount {
    color: #e74c3c; /* Light red for total amounts in night mode */
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    width: auto;
    padding: 5px;
    color: #555; /* Adjust text color */
    font-family: 'Roboto Slab', serif;
}

.footer-left {
    left: 5px;
}

.footer-right {
    right: 10px;
}

body.night-mode footer {
    color: #ecf0f1;
}
