/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #ffffff;
    color: #222222;
    min-height: 100vh;
}

/* =========================
   COLOR VARIABLES
========================= */

:root {
    --primary: #12e193;
    --primary-dark: #0bb879;
    --primary-light: #e9fff6;
    --text-dark: #222222;
    --text-gray: #666666;
    --border: #e5e5e5;
    --white: #ffffff;
}

/* =========================
   NAVIGATION BAR
========================= */

.navbar {
    width: 100%;
    height: 70px;
    padding: 0 50px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #00ff7f;
    border-bottom: 1px solid var(--border);
}

/* Logo */

.navbar h1 {
    color: var(--primary) !important;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Navigation */

.navbar ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.navbar a {
    text-decoration: none;
    color: #333333;
    font-weight: 500;
    transition: 0.2s ease;
}

.navbar a:hover {
    color: var(--primary);
}

/* Logout button */

.navbar a[href*="index.html"] {
    background: var(--primary);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
}

.navbar a[href*="index.html"]:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 20px;
}

/* =========================
   ALERTS
========================= */

.alert-success,
.alert-error {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.alert-success {
    background: #e9fff6;
    color: #08784e;
    border-left: 4px solid var(--primary);
}

.alert-error {
    background: #fff1f1;
    color: #c62828;
    border-left: 4px solid #e53935;
}

/* =========================
   CARDS
========================= */

.card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 24px;
}

.card h2 {
    color: var(--text-dark);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.card p {
    color: var(--text-gray);
}

/* =========================
   SEARCH INPUT
========================= */

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 14px 16px;

    background: #ffffff;
    color: #222222;

    border: 1px solid #cccccc;
    border-radius: 6px;

    font-size: 1rem;
    outline: none;

    transition: 0.2s ease;
}

.search-input::placeholder {
    color: #999999;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 225, 147, 0.15);
}

/* =========================
   AUTOCOMPLETE DROPDOWN
========================= */

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;

    display: none;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;

    max-height: 300px;
    overflow-y: auto;

    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eeeeee;
    color: #222222;
}

.autocomplete-item:hover {
    background: var(--primary-light);
}

.autocomplete-item strong {
    display: block;
    color: #222222;
}

.autocomplete-item small {
    display: block;
    margin-top: 5px;
    color: #777777;
}

/* =========================
   MEAL TYPE BUTTONS
========================= */

.meal-type-selector {
    margin: 22px 0;
}

.meal-type-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333333;
    font-weight: 600;
}

.meal-type-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meal-type-btn {
    padding: 10px 18px;

    background: #ffffff;
    color: #333333;

    border: 1px solid #cccccc;
    border-radius: 6px;

    cursor: pointer;
    font-weight: 500;

    transition: 0.2s ease;
}

.meal-type-btn:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.meal-type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* =========================
   PRIMARY BUTTON
========================= */

.btn-primary {
    width: 100%;
    padding: 13px 20px;

    background: var(--primary);
    color: #ffffff;

    border: none;
    border-radius: 6px;

    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   TABLE
========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

th,
td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid #eeeeee;
}

th {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

tbody tr:hover {
    background: var(--primary-light);
}

tfoot td {
    background: #f8f8f8;
    font-weight: 700;
}

/* =========================
   RECOMMENDATIONS
========================= */

#recommendations {
    list-style: none;
    padding: 0;
}

.recommendation-item {
    padding: 14px 16px;
    margin-bottom: 10px;

    background: var(--primary-light);
    color: #333333;

    border-left: 4px solid var(--primary);
    border-radius: 5px;
}

/* =========================
   CHART
========================= */

canvas {
    margin-top: 20px;
    max-width: 100%;
    background: #ffffff;
}

/* =========================
   FOOTER
========================= */

footer {
    text-align: center;
    padding: 25px 10px;
    color: #777777;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 768px) {

    .navbar {
        height: auto;
        padding: 18px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .navbar ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 25px 15px;
    }

    .card {
        padding: 20px;
    }

    .meal-type-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .meal-type-btn {
        width: 100%;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 10px 6px;
    }
}