@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

/* === GENERAL === */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #eeeeee;
}

/* === HEADER === */
.header {
    background-color: #50e94b;
    padding: 30px 40px;
    position: relative;
    font-family: 'Inter', sans-serif;
}

.header h1 {
    padding: 0;
    margin: 0 0 10px 0;
    font-size: 40px;
}

.header p {
    padding: 0;
    margin: 0;
    font-size: 24px;
}

/* === MAIN CONTENT AREA === */
.content {
    justify-content: space-between;
    padding: 40px 40px 20px 80px;
}

.content h2 {
    font-size: 32px;
    font-weight: 600;
    color: black;
}

.content p {
    font-size: 18px;
    color: #101111;
}

/* === AUTH SECTION === */
.auth-section {
    margin: 40px 0 120px 20px;
}

.input-field {
    padding: 8px 12px;
    width: 220px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* === FOOD DETAILS LAYOUT === */
.food-details-layout {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
    margin-top: 20px;
}

.nutrient-section {
    flex: 0 0 60%;
    min-width: 500px;
}

.nutrient-section .table-container {
    margin: 0;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nutrient-section .nutrient-table table {
    min-width: 600px;
    width: 100%;
}

.food-details-layout .actions-section {
    flex: 0 0 40%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.actions-section {
    flex: 0 0 40%;
    max-width: 380px;
}

.actions-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.actions-section form {
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.actions-section input[type="number"] {
    margin-bottom: 12px;
}

.actions-section input[type="submit"],
.actions-section .button {
    width: fit-content;
}

/* === BUTTONS === */
button,
input[type="submit"],
.button {
    padding: 6px 12px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:active,
input[type="submit"]:active,
.button:active {
    background-color: #45a049;
}

/* === TEXT INPUTS === */
input[type="text"],
input[type="number"],
select {
    padding: 4px 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background-color: #fff;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    background-color: #fff;
}

input::placeholder {
    color: #999;
    font-weight: 400;
    font-style: italic;
}

/* === CHECKBOXES === */
input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #c0c0c0;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

/* === SELECT === */
select {
    min-width: 300px;
    width: auto;
}

/* === LABELS === */
label {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 400;
    color: #333;
}

/* === TABLES === */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 0 40px 20px 0;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-size: 14px;
}

th {
    background-color: #a7f4a5;
    color: black;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.nutrient-table table {
    width: 100%;
}

.nutrient-table th {
    text-align: center;
}

.nutrient-table td {
    text-align: left
}

.nutrient-table td:first-child,
.nutrient-table th:first-child {
    position: static;
}

.nutrient-table th:first-child {
    background-color: #4CAF50;
    color: white;
}

.nutrient-table td:nth-child(2) {
    text-align: right;
}

.favourites-table th {
    text-align: center;
}

.favourites-table th:first-child,
.favourites-table td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    font-weight: 500;
    z-index: 5;
    min-width: 180px;
}

.favourites-table th:first-child {
    background-color: #4CAF50;
    color: white;
    z-index: 15;
}

.favourites-table th:nth-child(2),
.favourites-table td:nth-child(2) {
    position: sticky;
    left: 180px;
    min-width: 130px;
    background-color: white;
    z-index: 5;
}

.favourites-table th:nth-child(2) {
    background-color: #4CAF50;
    color: white;
    z-index: 15;
}

.favourites-table th:nth-child(3),
.favourites-table td:nth-child(3) {
    position: sticky;
    left: 310px;
    min-width: 100px;
    background-color: white;
    box-shadow: 4px 0 6px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.favourites-table th:nth-child(3) {
    background-color: #4CAF50;
    color: white;
    z-index: 15;
}

.favourites-table td:not(:first-child) {
    text-align: center;
}

/* === FLASH MESSAGES === */
.flash-messages {
    margin: 20px 0;
}

.flash-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px;
    max-width: 600px;
}

.flash-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.flash-success {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #3c3;
}

.flash-info {
    background-color: #eef;
    border: 1px solid #ccf;
    color: #33c;
}