/* Global Styles */
:root {
    /* Light Theme (Default) */
    --primary: #2a9d8f;
    --primary-light: #64c2b7;
    --primary-dark: #218478;
    --secondary: #2d6a5f;
    --accent: #e76f51;
    --dark: #2d6a5f;
    --light: #f8f9fa;
    --gray: #e9ecef;
    --success: #52b788;
    --warning: #ffb703;
    --danger: #e63946;
    
    /* Common variables for both themes */
    --background: #ffffff;
    --text-color: #333333;
    --border-color: #e9ecef;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --primary-rgb: 42, 157, 143; /* RGB values for primary color */
    --widget-bg: #f8f9fa;      /* Background for widgets in light mode */
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #1e8a7e;        /* Darker green */
    --primary-light: #4ba89e;  /* Darker teal */
    --primary-dark: #176d63;   /* Even darker green */
    --secondary: #1e5046;      /* Darker secondary */
    --accent: #d15a3c;         /* Darker accent */
    --dark: #1e5046;           /* Darker dark */
    --light: #e9ecef;          /* Slightly darker light */
    --gray: #495057;           /* Darker gray */
    
    /* Dark theme specific variables */
    --background: #1a1a1a;      /* Less harsh dark background */
    --text-color: #e9ecef;     /* Light text for dark background */
    --border-color: #343a40;   /* Darker border */
    --card-bg: #242424;        /* Slightly lighter than background */
    --shadow-color: rgba(0, 0, 0, 0.3); /* Darker shadow */
    --primary-rgb: 30, 138, 126; /* RGB values for primary color in dark mode */
    --widget-bg: #2a2a2a;      /* Background for widgets in dark mode */
    
    /* Uncomment one of these alternative themes if you prefer */
    
    /* Warm Earth Tones Theme */
    /*
    --primary: #606c38;
    --primary-light: #95a88a;
    --secondary: #283618;
    --accent: #bc6c25;
    --dark: #283618;
    --light: #fefae0;
    --gray: #dda15e;
    --success: #606c38;
    --warning: #dda15e;
    --danger: #bc4749;
    */
    
    /* Elegant Purple Theme */
    /*
    --primary: #7b2cbf;
    --primary-light: #c77dff;
    --secondary: #5a189a;
    --accent: #ff9e00;
    --dark: #3c096c;
    --light: #f8f9fa;
    --gray: #e9ecef;
    --success: #38b000;
    --warning: #ffaa00;
    --danger: #d90429;
    */
    
    /* Professional Gray Theme */
    /*
    --primary: #495057;
    --primary-light: #adb5bd;
    --secondary: #343a40;
    --accent: #ff7b00;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #e9ecef;
    --success: #40916c;
    --warning: #ffb703;
    --danger: #d00000;
    */
}

body {
    display: flex;
    flex-direction: column;
    width: 100vw;
    background-color: var(--background);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    overflow-x: hidden;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Theme Toggle */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 20px;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-dark);
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#theme-toggle:hover {
    background-color: rgba(var(--primary-rgb), 0.1);
}

#theme-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.theme-toggle-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.light-icon {
    display: inline;
}

.dark-icon {
    display: none;
}

[data-theme="dark"] .light-icon {
    display: none;
}

[data-theme="dark"] .dark-icon {
    display: inline;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    height: 8vh;
    background-color: var(--primary);
    color: white;
    padding: 0 3vw;
    box-shadow: 0 0.3vh 1vh rgba(0, 0, 0, 0.1);
}

nav h1 {
    font-size: 3.5vmin;
    margin: 0;
    font-weight: 600;
}

nav h1 a {
    color: white;
    text-decoration: none;
    position: relative;
}

nav h1 a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-light);
    transition: width 0.3s ease;
}

nav h1 a:hover:after {
    width: 100%;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2vw;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 2vmin;
    transition: all 0.3s ease;
    padding: 0.8vh 1vw;
    border-radius: 5px;
}

nav ul li a:hover {
    color: white;
    background-color: var(--primary-dark);
}

/* Alert Messages */
.alertDiv {
    width: 100vw;
    padding: 1.5vh 3vw;
    margin-bottom: 2vh;
    text-align: center;
    border-radius: 0;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alertSuccess {
    background-color: var(--success);
    color: white;
}

.alertError {
    background-color: var(--danger);
    color: white;
}

/* Container */
.container {
    width: 95vw;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2vh 0;
}

/* Widget Container */
.widgetHolder {
    display: flex;
    flex-direction: column;
    width: 95vw;
    max-width: 100%;
    margin: 2vh auto;
    gap: 3vh;
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 768px) {
    table {
        font-size: 1vw;
    }
    
    .widgetHolder {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
    
    .main.widget {
        width: 70%;
        /* margin-right: 3%; */
        overflow: hidden;
    }
    
    .secondaryWidget {
        width: 30%;
        display: flex;
        flex-direction: column;
        gap: 3vh;
    }
}

.widget {
    background-color: var(--widget-bg);
    border-radius: 15px;
    width: 100%;
    padding: 2vh 2vw;
    box-shadow: 0 0.5vh 2vh rgba(67, 97, 238, 0.07);
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.widget:hover {
    transform: translateY(-0.5vh);
    box-shadow: 0 1vh 3vh rgba(67, 97, 238, 0.1);
}

.widgetTitle {
    font-size: 2vw;
    font-weight: 600;
    margin-bottom: 2vh;
    margin-top: 2vh;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.widgetTitle:after {
    content: '';
    height: 2px;
    flex-grow: 1;
    background: linear-gradient(to right, var(--primary-light), transparent);
    margin-left: 1vw;
    border-radius: 2px;
}

/* Week Selection Styles */
.weekHolder {
    width: 100%;
}

.weekTitleHolder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
}

.weekSelection {
    display: flex;
    overflow-x: auto;
    gap: 2vw;
    padding-bottom: 1.5vh;
    padding-left: 1vh;
    padding-right: 1vh;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) var(--gray);
    width: calc(100% - 2vh);
    position: relative;
}

.weekHolder {
    position: relative;
}

.weekSelection::before,
.weekSelection::after {
    content: '';
    position: absolute;
    top: 0;
    width: 30px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.weekSelection::before {
    left: 0;
    background: linear-gradient(to right, white, rgba(255, 255, 255, 0));
}

.weekSelection::after {
    right: 0;
    background: linear-gradient(to left, white, rgba(255, 255, 255, 0));
}

.weekSelection::-webkit-scrollbar {
    height: 6px;
}

.weekSelection::-webkit-scrollbar-track {
    background: var(--gray);
    border-radius: 10px;
}

.weekSelection::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 10px;
}

.daySelection {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .daySelection {
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .day {
        height: 6vh;
    }
    .daySelection {
        min-width: 90px;
    }
}

.daySelection p {
    margin: 0 0 1vh 0;
    font-weight: 600;
    color: var(--dark);
    font-size: 2vmin;
    text-transform: capitalize;
}

.day {
    display: block;
    width: 100%;
    height: 10vh;
    border-radius: 10px;
    position: relative;
    margin-bottom: 1vh;
    text-decoration: none;
    transition: all 0.3s ease;
}

.day:hover {
    transform: scale(1.05);
}

.notSelected {
    background-color: var(--gray);
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notSelected:after {
    content: '';
    font-size: 3vmin;
    color: #aaa;
}

.selectedRandomColor {
    border: none;
    cursor: pointer;
    box-shadow: 0 0.3vh 1vh rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dish name styling */
.dish-name {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    padding: 5px;
    margin: 2px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    box-sizing: border-box;
    overflow: hidden;
}

/* Responsive font sizing for smaller screens */
@media (max-width: 768px) {
    .dish-name {
        font-size: 12px;
        padding: 2px;
    }
}

@media (max-width: 480px) {
    .dish-name {
        font-size: 11px;
        padding: 2px;
    }
}

/* Edit dish button styling */
.edit-dish-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary);
    z-index: 5;
}

.edit-dish-btn:hover {
    background: var(--card-bg);
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modal styling */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 15px;
    width: 95%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.3);
    margin: auto;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

/* Make modal even wider on larger screens */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 1200px;
        width: 90%;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2vh 3vw;
    border-bottom: 1px solid var(--gray);
}

.modal-header h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.5em;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

.form-group {
    margin-bottom: 2vh;
    padding: 0 3vw;
}

.form-group label {
    display: block;
    margin-bottom: 0.5vh;
    font-weight: 500;
    color: var(--dark);
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1vw;
    align-items: center;
    margin-bottom: 1vh;
    padding: 1vh;
    background-color: var(--light);
    border-radius: 5px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1vw;
    padding: 2vh 3vw;
    border-top: 1px solid var(--gray);
}

/* Info tooltip */
.info {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 1vh;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 2vh 2vw;
    box-shadow: 0 4px 6px var(--shadow-color);
    flex: 1;
    min-width: 200px;
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ingredientList {
    list-style-type: disc;
    margin: 0.5vh 0 0 0;
    padding-left: 1vw;
}

/* Graph Styles */
.graphHolder {
    width: 100%;
    height: 60vh;
    margin-top: 3vh;
    padding: 1vh;
    border-radius: 10px;
    background-color: var(--card-bg);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.graphHolder canvas {
    max-width: 100%;
}

.widget > * {
    width: 100%;
}

/* Buying List Styles */
.BList > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.buyingList {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.buyingList thead td {
    font-weight: 600;
    padding: 1.2vh 0;
    border-bottom: 2px solid var(--primary-light);
    color: var(--dark);
}

.buyingList tbody td {
    padding: 1.2vh 0;
    border-bottom: 1px solid var(--gray);
    word-break: break-word;
    overflow: hidden;
    padding-left: 0.4vw;
    text-overflow: ellipsis;
}

.buyingList tbody tr:last-child td {
    border-bottom: none;
}

.bordered {
    border-right: 1px solid var(--gray);
    padding-right: 1vw;
}

/* Extra Section */
.third.widget {
    display: flex;
    flex-direction: column;
}

.third.widget > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
}

.extra-buy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.extra-buy-list li {
    padding: 1.2vh 0;
    border-bottom: 1px solid var(--gray);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.extra-buy-list li:before {
    content: '•';
    color: var(--primary);
    margin-right: 1vw;
    font-size: 1.5em;
}

.extra-buy-list li:hover {
    padding-left: 0.5vw;
    color: var(--dark);
}

.extra-buy-list li:last-child {
    border-bottom: none;
}

/* Button Styles */
.buttonImg {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    color: var(--primary);
}

.buttonImg:hover {
    transform: scale(1.1);
    background-color: rgba(67, 97, 238, 0.1);
}

.buttonImg svg {
    width: 3vmin;
    height: 3vmin;
}

/* Standard Button Styles */
button, input[type="submit"], input[type="button"], .btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1.2vh 2vw;
    font-size: 2vmin;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    margin: 0 0.2vw;
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover, .btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active, input[type="submit"]:active, input[type="button"]:active, .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:focus, input[type="submit"]:focus, input[type="button"]:focus, .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.3);
}

button:disabled, input[type="submit"]:disabled, input[type="button"]:disabled, .btn:disabled {
    background-color: var(--gray);
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Form Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 1.2vh 1vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 1vw;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #aaa;
    opacity: 1;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a9d8f' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 2.5vw;
    cursor: pointer;
}

textarea {
    min-height: 10vh;
    resize: vertical;
}

/* Button Variations */
.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: #3cae70;
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: #e05252;
}

.btn-warning {
    background-color: var(--warning);
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.8vh 1.5vw;
    font-size: 1.8vmin;
}

.btn-lg {
    padding: 1.5vh 3vw;
    font-size: 2.2vmin;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotating 0.5s linear;
}





/* Dish View Styles */
.dishes-container {
    display: flex;
    flex-direction: column;
    width: 95vw;
    margin: 2vh auto;
    gap: 3vh;
    box-sizing: border-box;
    overflow: hidden;
}

.dishes-widget {
    background-color: var(--widget-bg);
    border-radius: 15px;
    width: 100%;
    padding: 3vh 3vw;
    box-shadow: 0 0.5vh 2vh rgba(67, 97, 238, 0.07);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.dishes-form {
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.dishes-form label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5vh;
    display: block;
}

.dishes-form input[type="text"],
.dishes-form input[type="number"],
.dishes-form select {
    width: 100%;
    padding: 1.2vh 1vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 1vw;
    transition: all 0.3s ease;
}

.dishes-form input[type="text"]:focus,
.dishes-form input[type="number"]:focus,
.dishes-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

.dishes-form input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1.2vh 2vw;
    font-size: 2vmin;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1vh;
    align-self: flex-start;
}

.dishes-form input[type="submit"]:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
}

#ingredients-container {
    display: flex;
    flex-direction: column;
    gap: 2vh;
    margin-bottom: 1vh;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2vw;
    align-items: end;
    padding: 1vh 0.5vw;
    border-radius: 1vmin;
    border-bottom: 1px solid var(--gray);
}

.ingredient-actions {
    display: flex;
    gap: 1vw;
    margin-bottom: 2vh;
}

/* Edit ingredient button styles use admin-button.edit class */

/* Modal styles */
.modal {
    display: none; /* Will be changed to flex when modal is shown */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 25px;
    border: 1px solid var(--gray);
    border-radius: 8px;
    /* width: 90%;
    max-width: 400px; */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    margin: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray);
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.close {
    color: var(--text-color);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray);
    border-radius: 4px;
    font-size: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Using standard button classes for form actions */

.ingredient-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.add-ingredient {
    color: var(--success);
}

.add-ingredient:hover {
    background-color: rgba(74, 222, 128, 0.1);
}

.remove-ingredient {
    color: var(--danger);
}

.remove-ingredient:hover {
    background-color: rgba(248, 113, 113, 0.1);
}

.dishes-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dishes-table th {
    text-align: left;
    padding: 1.5vh 1vw;
    border-bottom: 2px solid var(--primary-light);
    color: var(--dark);
    font-weight: 600;
}

.dishes-table th:first-child {
    width: 15%;
}

.dishes-table td {
    padding: 1.2vh 1vw;
    border-bottom: 1px solid var(--gray);
    word-break: break-word;
}

.dishes-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb, 42, 157, 143), 0.1);
}

@media (min-width: 768px) {
    .dishes-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .dishes-widget {
        flex: 1;
        min-width: 45%;
    }
    
    .dishes-widget:first-child {
        margin-right: 3%;
    }
}

/* Ingredients Page Styles */
.ingredients-container {
    display: flex;
    flex-direction: column;
    width: 95vw;
    margin: 2vh auto;
    gap: 3vh;
    box-sizing: border-box;
    overflow: hidden;
}

.ingredients-widget {
    background-color: var(--widget-bg);
    border-radius: 15px;
    width: 100%;
    padding: 3vh 3vw;
    box-shadow: 0 0.5vh 2vh rgba(67, 97, 238, 0.07);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.ingredients-form {
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.ingredients-form label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5vh;
    display: block;
}

.ingredients-form input[type="text"] {
    width: 100%;
    padding: 1.2vh 1vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 2vmin;
    transition: all 0.3s ease;
}

.ingredients-form input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

.ingredients-form input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1.2vh 2vw;
    font-size: 2vmin;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1vh;
    align-self: flex-start;
}

.ingredients-form input[type="submit"]:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
}

.ingredients-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ingredients-table th {
    text-align: left;
    padding: 1.5vh 1vw;
    border-bottom: 2px solid var(--primary-light);
    color: var(--dark);
    font-weight: 600;
}

.ingredients-table th:first-child {
    width: 15%;
}

.ingredients-table td {
    padding: 1.2vh 1vw;
    border-bottom: 1px solid var(--gray);
    word-break: break-word;
}

.ingredients-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb, 42, 157, 143), 0.1);
}

@media (min-width: 768px) {
    .ingredients-container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .ingredients-widget {
        flex: 1;
        min-width: 45%;
    }
    
    .ingredients-widget:first-child {
        margin-right: 3%;
    }
}

/* Preferences Page Styles */
/* Preferences Widget Styles */
.preferences-widget {
    margin-bottom: 3vh;
}

.preferences-form {
    display: flex;
    flex-direction: column;
    gap: 3vh;
}

.preferences-form .weekSelection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2vw;
    margin-bottom: 2vh;
    padding-bottom: 2vh;
    overflow-x: visible;
}

.preferences-form .daySelection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vh;
    min-width: 0;
}

.preferences-form .daySelection p {
    font-weight: 600;
    color: var(--dark);
    font-size: 2.2vmin;
    margin-bottom: 1vh;
    text-transform: capitalize;
    position: relative;
}

.preferences-form .daySelection p:after {
    content: '';
    position: absolute;
    bottom: -0.5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: var(--primary-light);
    border-radius: 2px;
}

/* Custom Checkbox Styles for Preferences */
.day-label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 1vh;
}

.day-label:first-of-type:before {
    content: 'Matin';
    font-size: 1.6vmin;
    color: var(--dark);
    opacity: 0.7;
    margin-bottom: 0.5vh;
}

.day-label:last-of-type:before {
    content: 'Soir';
    font-size: 1.6vmin;
    color: var(--dark);
    opacity: 0.7;
    margin-bottom: 0.5vh;
}

.preferences-form .custom-checkbox {
    height: 8vh;
    min-width: 60px;
    border-radius: 10px;
    background-color: var(--gray);
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
    position: relative;
}

.preferences-form input[type="checkbox"]:checked + .custom-checkbox {
    background-color: var(--primary-light);
    border: none;
    box-shadow: 0 4px 8px rgba(42, 157, 143, 0.2);
}

.preferences-form input[type="checkbox"]:checked + .custom-checkbox:after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2.5vmin;
    font-weight: bold;
}

.preferences-form input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1.5vh 3vw;
    font-size: 2vmin;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    margin-top: 1vh;
    box-shadow: 0 4px 6px rgba(42, 157, 143, 0.2);
}

.preferences-form input[type="submit"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(42, 157, 143, 0.3);
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2vh;
}

.form-actions .btn {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1.5vh 3vw;
    font-size: 2vmin;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(42, 157, 143, 0.2);
}

.form-actions .btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(42, 157, 143, 0.3);
}

/* Custom Checkbox Styles */
input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    position: relative;
    display: block;
    width: 100%;
    min-width: 50px;
    height: 10vh;
    border-radius: 10px;
    background-color: var(--gray);
    border: 2px dashed #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked + .custom-checkbox {
    background-color: var(--primary-light);
    border: none;
}

input[type="checkbox"]:focus + .custom-checkbox {
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.2);
}

/* Week Dish Page Styles */
.dish-header {
    margin-bottom: 3vh;
}

.dish-title {
    display: flex;
    align-items: center;
    gap: 1vw;
    margin: 2vh 0;
}

.dish-title h3 {
    margin: 0;
    font-size: 3vmin;
    color: var(--dark);
    font-weight: 600;
}

.edit-options {
    display: flex;
    align-items: center;
    gap: 1vw;
    margin-top: 2vh;
    padding: 2vh 2vw;
    background-color: var(--light);
    border-radius: 10px;
    border: 1px solid var(--gray);
}

.search-container {
    position: relative;
    flex-grow: 1;
}

#searchInput {
    width: 100%;
    padding: 1.2vh 1vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 2vmin;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--gray);
    border-radius: 0 0 5px 5px;
    max-height: 30vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0.5vh 1vh rgba(0, 0, 0, 0.1);
}

.search-results div {
    padding: 1vh 1vw;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-results div:hover {
    background-color: rgba(42, 157, 143, 0.05);
}

.search-results div.error-message {
    cursor: default;
    padding: 2vh 1vw;
    color: var(--danger);
    text-align: center;
}

.ingredients-table {
    background-color: var(--light);
    border-radius: 10px;
    padding: 2vh 2vw;
}

.submit-button {
    padding: 1vh 2vw;
    border: none;
    border-radius: 5px;
    background-color: var(--success);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:disabled {
    background-color: var(--gray);
    cursor: not-allowed;
}

.submit-button:not(:disabled):hover {
    background-color: #3cae70;
    transform: translateY(-2px);
}

.selected-dish {
    background-color: rgba(42, 157, 143, 0.1) !important;
    font-weight: 500;
}

/* Authentication Pages Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    width: 100vw;
    background-color: var(--light);
}

.logWidget {
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
}

.logForm {
    display: flex;
    flex-direction: column;
    gap: 3vh;
}

.logForm > div {
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.logForm label {
    font-weight: 500;
    color: var(--dark);
}

.inputHolder {
    position: relative;
    display: flex;
    align-items: center;
}

.inputHolder svg {
    position: absolute;
    left: 1vw;
    color: var(--primary);
}

.inputHolder input {
    width: 100%;
    padding: 1vh 1vw 1vh 3vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 1.5vmin;
    transition: all 0.3s ease;
}

.inputHolder input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

.logForm input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1.2vh 2vw;
    font-size: 2vmin;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1vh;
}

.logForm input[type="submit"]:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
}

.logSecondary {
    display: flex;
    justify-content: center;
    gap: 2vw;
    margin: 3vh 0;
}

.logSecondaryLink {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4vw;
    height: 4vw;
    border-radius: 50%;
    background-color: var(--light);
    color: var(--background);
    transition: all 0.3s ease;
}

.logSecondaryLink:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.goToInscriptionOrLog {
    text-align: center;
    margin-top: 3vh;
    color: var(--dark);
}

.goToInscriptionOrLog a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.goToInscriptionOrLog a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Extra Page Styles */
.extra-container {
    width: 95vw;
    margin: 2vh auto;
    box-sizing: border-box;
    overflow: hidden;
}

.extra-widget {
    background-color: var(--widget-bg);
    border-radius: 15px;
    width: 100%;
    padding: 3vh 3vw;
    box-shadow: 0 0.5vh 2vh rgba(67, 97, 238, 0.07);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.extra-form {
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

.extra-form label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5vh;
    display: block;
}

.extra-form input[type="text"],
.extra-form input[type="number"] {
    width: 100%;
    padding: 1.2vh 1vw;
    border: 1px solid var(--gray);
    border-radius: 5px;
    font-size: 2vmin;
    transition: all 0.3s ease;
}

.extra-form input[type="text"]:focus,
.extra-form input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
    outline: none;
}

.extra-form input[type="submit"] {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 1.2vh 2vw;
    font-size: 2vmin;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1vh;
    align-self: flex-start;
}

.extra-form input[type="submit"]:hover {
    background-color: var(--dark);
    transform: translateY(-2px);
}

.extra-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 3vh;
}

.extra-table th {
    text-align: left;
    padding: 1.5vh 1vw;
    border-bottom: 2px solid var(--primary-light);
    color: var(--dark);
    font-weight: 600;
}

.extra-table td {
    padding: 1.2vh 1vw;
    border-bottom: 1px solid var(--gray);
    word-break: break-word;
}

.extra-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb, 42, 157, 143), 0.1);
}

/* Admin Pages Styles */
.admin-container {
    width: 95vw;
    margin: 2vh auto;
    box-sizing: border-box;
    overflow: hidden;
}

.admin-widget {
    background-color: var(--widget-bg);
    border-radius: 15px;
    width: 100%;
    padding: 3vh 3vw;
    box-shadow: 0 0.5vh 2vh rgba(67, 97, 238, 0.07);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 3vh;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.admin-table th {
    text-align: left;
    padding: 1.5vh 1vw;
    border-bottom: 2px solid var(--primary-light);
    color: var(--dark);
    font-weight: 600;
}

.admin-table td {
    padding: 1.2vh 1vw;
    border-bottom: 1px solid var(--gray);
    word-break: break-word;
}

.admin-table tbody tr:hover {
    background-color: rgba(var(--primary-rgb, 42, 157, 143), 0.1);
}

.admin-actions {
    display: flex;
    gap: 1vw;
}

.admin-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.admin-button.edit {
    color: var(--primary);
}

.admin-button.edit:hover {
    background-color: rgba(42, 157, 143, 0.1);
}

.admin-button.delete {
    color: var(--danger);
}

.admin-button.delete:hover {
    background-color: rgba(248, 113, 113, 0.1);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2vw;
    margin-bottom: 3vh;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 2vh 2vw;
    box-shadow: 0 0.3vh 1vh rgba(67, 97, 238, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-card h3 {
    margin: 0;
    color: var(--dark);
    font-size: 2.5vmin;
    font-weight: 600;
}

.stat-card p {
    font-size: 5vmin;
    font-weight: 700;
    margin: 1vh 0;
    color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 95vw;
    }
    
    nav {
        padding: 0 4vw;
    }
    
    nav h1 {
        font-size: 4vmin;
    }
    
    nav ul {
        gap: 4vw;
    }
    
    nav ul li a {
        font-size: 3vmin;
    }
    
    .widget {
        padding: 2.5vh 3vw;
    }
    
    .widgetTitle {
        font-size: 5vw;
    }
    
    .buttonImg svg {
        width: 4vmin;
        height: 4vmin;
    }
    
    .ingredient-row {
        grid-template-columns: 1fr;
        gap: 1vh;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        height: auto;
        padding: 2vh 4vw;
    }
    
    nav ul {
        margin-top: 2vh;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .widget {
        padding: 3vh 4vw;
    }
    
    .graphHolder {
        height: 40vh;
    }

    .inputHolder input {
        width: 100%;
        padding: 1vh 1vw 1vh 8vw;
        border: 1px solid var(--gray);
        border-radius: 5px;
        font-size: 3vmin;
        transition: all 0.3s ease;
    }
    
    .buttonImg svg {
        width: 5vmin;
        height: 5vmin;
    }

    .BList {
        margin-bottom: 3vh;
    }

    .logSecondary {
        display: flex;
        justify-content: center;
        gap: 7vw;
        margin: 3vh 0;
    }
    
    .logSecondaryLink {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 16vw;
        height: 16vw;
        border-radius: 50%;
        background-color: var(--light);
        color: var(--dark);
        transition: all 0.3s ease;
    }
    
    .logSecondaryLink:hover {
        background-color: var(--primary);
        color: white;
        transform: translateY(-3px);
    }
    
    .logSecondaryLink > svg {
        width: 6vmin;
        height: 6vmin;
    }

    .logForm input[type="submit"] {
        font-size: 3vmin;
    }
}
