/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #12e193;
    --primary-dark: #0bb879;
    --primary-light: #e9fff6;

    --text-dark: #222222;
    --text-gray: #666666;

    --border: #e5e5e5;
    --background: #ffffff;
}

/* =========================
   BASE
========================= */

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #ffffff;
    color: var(--text-dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   NAVBAR
========================= */

.navbar {
    width: 100%;
    min-height: 70px;

    padding: 0 50px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #00ff7f;
    border-bottom: 1px solid var(--border);
}

/* SmartDiet logo */

.navbar h1 {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Navigation links */

.navbar ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.navbar ul li a {
    color: #333333;
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar ul li a:hover {
    color: var(--primary);
}

/* Logout button */

.navbar ul li:last-child a {
    background: var(--primary);
    color: #ffffff;

    padding: 10px 20px;
    border-radius: 6px;

    transition: background 0.2s ease;
}

.navbar ul li:last-child a:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

/* =========================
   MAIN CONTAINER
========================= */

.container {
    width: 100%;
    max-width: 700px;

    margin: 45px auto;
    padding: 0 20px;
}

/* =========================
   PROFILE CARD
========================= */

.card {
    background: #ffffff;

    padding: 35px;

    border: 1px solid var(--border);
    border-radius: 10px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* Card heading */

.card h2 {
    color: var(--text-dark);
    font-size: 1.7rem;
    margin-bottom: 8px;
}

/* Card description */

.card > p {
    color: var(--text-gray);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* =========================
   FORM
========================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: #333333;
    font-weight: 600;
}

/* Inputs and dropdowns */

input,
select {
    width: 100%;

    padding: 12px 14px;

    background: #ffffff;
    color: var(--text-dark);

    border: 1px solid #cccccc;
    border-radius: 6px;

    font-size: 0.95rem;

    outline: none;

    transition: border-color 0.2s ease,
                box-shadow 0.2s ease;
}

/* Placeholder */

input::placeholder {
    color: #999999;
}

/* Focus */

input:focus,
select:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(18, 225, 147, 0.15);
}

/* Dropdown options */

select option {
    color: #222222;
    background: #ffffff;
}

/* =========================
   BUTTON
========================= */

.btn {
    width: 100%;

    padding: 13px 20px;

    border: none;
    border-radius: 6px;

    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;

    transition: background 0.2s ease,
                transform 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* =========================
   FOOTER
========================= */

footer {
    margin-top: 50px;

    padding: 25px 20px;

    text-align: center;

    color: #777777;
    font-size: 0.85rem;

    border-top: 1px solid var(--border);
}

/* =========================
   ALERTS
========================= */

.alert {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.alert-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #856404;
}

.alert-danger {
    background: #fff1f1;
    border: 1px solid #f5b5b5;
    color: #a32121;
}

/* =========================
   OPTIONAL DASHBOARD STYLES
========================= */

.progress {
    height: 18px;

    background: #eeeeee;
    border-radius: 10px;

    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;

    background: var(--primary);

    transition: width 0.6s ease;
}

/* =========================
   CALORIE METER
========================= */

.calorie-meter {
    position: relative;

    width: 100%;
    height: 40px;

    margin-top: 15px;

    background: #eeeeee;
    border-radius: 8px;

    overflow: hidden;
}

.calorie-fill {
    height: 100%;
    width: 0%;

    background: var(--primary);

    transition: width 0.6s ease;
}

.calorie-text {
    position: absolute;

    width: 100%;

    text-align: center;
    line-height: 40px;

    color: #222222;
    font-weight: 600;
}

/* =========================
   MACRO GRID
========================= */

.macro-grid {
    display: flex;

    justify-content: space-around;
    align-items: center;

    gap: 30px;
    flex-wrap: wrap;
}

.macro {
    text-align: center;
}

/* =========================
   CIRCLE METERS
========================= */

.circle {
    position: relative;

    width: 120px;
    height: 120px;
}

.circle svg {
    width: 120px;
    height: 120px;

    transform: rotate(-90deg);
}

.circle circle {
    fill: none;

    stroke-width: 10;
    stroke-linecap: round;
}

.circle circle:first-child {
    stroke: #eeeeee;
}

.circle circle:last-child {
    stroke: var(--primary);

    stroke-dasharray: 314;
    stroke-dashoffset: 314;

    transition: stroke-dashoffset 0.6s ease;
}

.macro-value {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    color: #222222;
    font-weight: 600;
}

/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 768px) {

    .navbar {
        padding: 18px 20px;

        flex-direction: column;
        gap: 15px;
    }

    .navbar ul {
        gap: 15px;

        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        margin: 30px auto;
        padding: 0 15px;
    }

    .card {
        padding: 25px 20px;
    }

    .navbar ul li:last-child a {
        padding: 8px 15px;
    }
}


/* =================================
   PHONE-FRIENDLY RESPONSIVE DESIGN
================================= */

/* Tablets and smaller screens */
@media (max-width: 768px) {

    /* Navbar becomes vertical */
    .navbar {
        min-height: auto;
        padding: 16px 20px;

        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .navbar h1 {
        font-size: 1.5rem;
    }

    .navbar ul {
        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;

        gap: 10px;
        flex-wrap: wrap;
    }

    .navbar ul li a {
        display: block;
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .navbar ul li:last-child a {
        padding: 8px 14px;
    }

    /* Main content */
    .container {
        width: 100%;
        max-width: 100%;

        margin: 25px auto;
        padding: 0 15px;
    }

    /* Profile card */
    .card {
        padding: 25px 20px;
        border-radius: 8px;
    }

    .card h2 {
        font-size: 1.45rem;
    }

    .card > p {
        font-size: 0.9rem;
    }

    /* Inputs */
    input,
    select {
        min-height: 46px;
        font-size: 16px;
    }

    /* Prevents iPhone/Android browsers from zooming in */
    input:focus,
    select:focus {
        font-size: 16px;
    }

    /* Button */
    .btn {
        min-height: 48px;
        font-size: 1rem;
    }

    /* Footer */
    footer {
        padding: 20px 15px;
        font-size: 0.8rem;
    }
}


/* =================================
   SMALL PHONES
   Example: 320px - 480px
================================= */

@media (max-width: 480px) {

    .navbar {
        padding: 15px;
    }

    .navbar h1 {
        font-size: 1.35rem;
    }

    .navbar ul {
        gap: 5px;
    }

    .navbar ul li a {
        font-size: 0.82rem;
        padding: 7px 8px;
    }

    .navbar ul li:last-child a {
        padding: 7px 10px;
    }

    .container {
        margin: 20px auto;
        padding: 0 10px;
    }

    .card {
        padding: 22px 16px;
    }

    .card h2 {
        font-size: 1.3rem;
    }

    .form-group {
        margin-bottom: 17px;
    }

    input,
    select {
        padding: 12px;
    }
}


/* =================================
   VERY SMALL PHONES
   Example: 320px width
================================= */

@media (max-width: 360px) {

    .navbar ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .navbar ul li {
        width: 100%;
        text-align: center;
    }

    .navbar ul li:last-child {
        grid-column: span 2;
    }

    .navbar ul li:last-child a {
        display: block;
    }

    .card {
        padding: 20px 14px;
    }
}


/* =================================
   LANDSCAPE PHONE MODE
================================= */

@media (max-height: 500px) and (orientation: landscape) {

    .navbar {
        min-height: 60px;
        padding: 10px 20px;

        flex-direction: row;
        gap: 15px;
    }

    .navbar h1 {
        font-size: 1.25rem;
    }

    .navbar ul {
        gap: 12px;
    }

    .navbar ul li a {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .container {
        max-width: 650px;
        margin: 20px auto;
    }

    .card {
        padding: 20px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    footer {
        margin-top: 25px;
    }
}


/* =================================
   LANDSCAPE PHONE WITH WIDER FORM
================================= */

@media (min-width: 481px)
       and (max-width: 900px)
       and (orientation: landscape) {

    .container {
        max-width: 700px;
    }

    .card {
        padding: 25px 35px;
    }
}