body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient( 135deg, #080808 0%, #151515 50%, #252525 100% );
    background-size: 200% 200%;
    animation: subtleGradient 20s ease infinite;
    color: #f5f5f5;
}

footer {
    text-align: center;
}

@keyframes subtleGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#app {
    margin: 2em;
}

button,
[type="submit"],
[type="button"] {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #f5f5f5;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    button:hover,
    [type="submit"]:hover,
    [type="button"]:hover {
        background: #383838;
        border-color: #4a4a4a;
    }

    button:focus,
    [type="submit"]:focus,
    [type="button"]:focus {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
    }

.hero-title {
    text-align: center;
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.07em;
    line-height: 1;
    background: linear-gradient( 110deg, #ffffff 0%, #777777 35%, #ffffff 50%, #555555 65%, #ffffff 100% );
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: titleShine 8s ease-in-out infinite;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.12));
}

@keyframes titleShine {
    0% {
        background-position: 100% center;
    }

    50% {
        background-position: 0% center;
    }

    100% {
        background-position: 100% center;
    }
}

.food-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.food-card-container {
    position: relative;
}

.food-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 1rem;
    text-align: left;
    border-radius: 0.75rem;
    margin: 0;
}

    .food-card strong {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .food-card small {
        opacity: 0.7;
    }

.delete-food-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    background: rgba(255, 59, 48, 0.8);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.1;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.food-card-container:hover .delete-food-btn {
    opacity: 1;
}

.delete-food-btn:hover {
    background: rgba(59, 59, 59, 0.8);
}

.delete-food-btn:active {
    transform: scale(0.95);
}

.amount-unit {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 1rem;
}

    .amount-unit label {
        margin-bottom: 0;
    }

.food-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.food-table {
    width: 100%;
    margin: 0;
}

    .food-table th,
    .food-table td {
        vertical-align: middle;
    }

.delete-cell {
    width: 3rem;
    text-align: right;
}

.delete-button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.45;
}

    .delete-button:hover {
        opacity: 1;
    }

/* Mobile portrait - card layout */
@media (max-width: 768px) and (orientation: portrait) {
    .food-table-wrapper {
        overflow-x: visible;
    }

    .food-table {
        display: block;
        border-collapse: collapse;
        font-size: 0.9rem;
    }

        .food-table thead {
            display: none;
        }

        .food-table tbody {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .food-table tbody tr {
            display: flex;
            flex-direction: column;
            border: 1px solid #3a3a3a;
            border-radius: 0.5rem;
            background: #1a1a1a;
        }

        .food-table td {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

            .food-table td::before {
                content: attr(data-label);
                font-weight: 600;
                color: #aaa;
                min-width: 70px;
            }

        .food-table .delete-cell {
            justify-content: flex-end;
            width: auto;
            padding: 0 !important;
        }

            .food-table .delete-cell::before {
                display: none;
            }

        .food-table tfoot {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin-top: 1rem;
            padding: 1rem;
            border: 1px solid #3a3a3a;
            border-radius: 0.5rem;
            background: #1a1a1a;
        }

        .food-table tfoot tr {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0;
            border: none;
            background: none;
            gap: 0;
        }

            .food-table tfoot th {
                display: flex;
                justify-content: space-between;
                font-weight: 600;
                color: #aaa;
                width: 100%;
                padding: 0.5rem 0;
            }

                .food-table tfoot th:first-child {
                    grid-column: 1 / -1;
                }

                .food-table tfoot th:nth-child(2) {
                    margin-left: auto;
                }
}

/* Tablet and mobile landscape - keep table layout */
/*@media (orientation: landscape) and (max-height: 500px) {
    .food-table-wrapper {
        overflow-x: auto;
    }

    .food-table {
        font-size: 0.85rem;
    }

        .food-table thead {
            display: table-header-group;
        }

        .food-table tbody {
            display: table-row-group;
        }

        .food-table tbody tr {
            display: table-row;
            border: none;
            background: none;
            padding: 0;
            gap: 0;
        }

        .food-table td {
            display: table-cell;
            justify-content: initial;
            padding: 0.5rem;
        }

            .food-table td::before {
                display: none;
            }

        .food-table .delete-cell {
            justify-content: initial;
            width: 3rem;
            text-align: right;
            padding: 0.5rem !important;
        }

        .food-table tfoot {
            display: table-footer-group;
            gap: 0;
            margin-top: 0;
            padding: 0;
            border: none;
            background: none;
        }

        .food-table tfoot tr {
            display: table-row;
            justify-content: initial;
            padding: 0.5rem;
            border: none;
            background: none;
            gap: 0;
        }

            .food-table tfoot th {
                display: table-cell;
                justify-content: initial;
                padding: 0.5rem;
                width: auto;
            }
}*/

.add-button-container {
    display: flex;
    justify-content: flex-end;
}