
:root {
    --background-color-light: #f4f4f4;
    --text-color-light: #333;
    --button-bg-light: #fff;
    --button-text-light: #333;
    --button-border-light: #ccc;

    --background-color-dark: #333;
    --text-color-dark: #f4f4f4;
    --button-bg-dark: #555;
    --button-text-dark: #f4f4f4;
    --button-border-dark: #777;
}

body {
    font-family: sans-serif;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding: 0;
}

body.light {
    background-color: var(--background-color-light);
    color: var(--text-color-light);
}

body.dark {
    background-color: var(--background-color-dark);
    color: var(--text-color-dark);
}

.app-container {
    max-width: 800px; /* Increased max-width for new layout */
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.main-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.main-header h1 {
    font-size: 2.5em;
    margin: 0; /* Reset margin */
    flex-grow: 1; /* Allow title to take available space */
    text-align: left;
}

.header-controls {
    display: flex;
    align-items: center;
}

.language-buttons button {
    padding: 8px 12px;
    border: 1px solid;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
    transition: background-color 0.3s, border-color 0.3s;
}

body.light .language-buttons button {
    background-color: var(--button-bg-light);
    color: var(--button-text-light);
    border-color: var(--button-border-light);
}

body.dark .language-buttons button {
    background-color: var(--button-bg-dark);
    color: var(--button-text-dark);
    border-color: var(--button-border-dark);
}

.ad-container {
    width: 100%; /* Take full width below title and controls */
    margin-top: 15px;
    background-color: #f0f0f0;
    min-height: 100px; /* Placeholder height */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #ccc;
    color: #888;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* New styles for calorie and history sections */
#calorie-display {
    font-size: 1.2em;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

body.dark #calorie-display {
    border: 1px solid #555;
    background-color: #444;
}

#history-section {
    margin-top: 30px;
    text-align: left;
}

#history-section h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: center;
}

#history-list {
    list-style: none;
    padding: 0;
    max-height: 200px; /* Limit height for scroll */
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #fff;
}

body.dark #history-list {
    border: 1px solid #555;
    background-color: #333;
}

#history-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.menu-image {
    width: 100%;
    max-width: 500px;
    height: 400px;
    border: 1px solid;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#find-food-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
}


.menu-image {
    width: 100%;
    max-width: 500px;
    height: 400px;
    border: 1px solid;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#find-food-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
}
