/* =====================================================
   MEALOS DESIGN SYSTEM
   Dark Grey / Black / Red Theme
   Prefix: mo-
===================================================== */


/* =====================================================
   1. DESIGN TOKENS
===================================================== */

:root {
    /* COLORS */
    --mo-black: #fdf4ee;
    --mo-white: #ffffff;
    /* PRIMARY (clean neutral, no tinting) */
    --mo-primary: #fdf4ee;
    --mo-primary-dark: #f7e3d6;
    --mo-primary-darker: #eec9b4;
    --mo-light: #ffffff;
    /* neutral gray */
    --mo-gray: #6f7680;
    /* SINGLE ACCENT SYSTEM (INK-SLATE — replaces ALL blue/green/navy conflicts) */
    --mo-accent: #3f556b;
    --mo-accent-dark: #1f2b38;
    --mo-accent-light: #d6e1ec;
    --mo-accent-darker: #121a23;
    /* REMOVE GREEN IDENTITY (replace with neutral fallback) */
    --mo-green: #3f556b;
    --mo-green-glow: rgba(63, 85, 107, 0.25);
    /* BORDERS */
    --mo-border: rgba(15, 17, 21, 0.08);
    --mo-border-strong: rgba(15, 17, 21, 0.16);
    /* SHADOWS */
    --mo-shadow-sm: 0 2px 6px rgba(15, 17, 21, 0.10);
    --mo-shadow-md: 0 6px 16px rgba(15, 17, 21, 0.16);
    --mo-shadow-lg: 0 12px 32px rgba(15, 17, 21, 0.22);
    /* TYPOGRAPHY */
    --mo-font-main: "Sora", sans-serif;
    /* RADII */
    --mo-radius-sm: 6px;
    --mo-radius-md: 10px;
    --mo-radius-lg: 16px;
    /* TRANSITIONS */
    --mo-transition-fast: 0.15s ease;
    --mo-transition: 0.25s ease;
}


/* =====================================================
   2. RESET & BASE
===================================================== */

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body.mo-body {
    margin: 0;
    background: var(--mo-black);
    color: var(--mo-white);
    font-family: var(--mo-font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Prevent layout shift when content height changes */
    overflow-y: scroll;
}

main {
    flex: 1;
}


/* =====================================================
   3. LINKS
===================================================== */

a {
    color: var(--mo-white);
    text-decoration: none;
}

    a:hover {
        color: var(--mo-accent);
    }


/* =====================================================
   4. TYPOGRAPHY
===================================================== */

.mo-h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--mo-accent-dark);
}

.mo-h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: .75rem;
    color: var(--mo-accent-dark);
}

.mo-h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--mo-accent-dark);
}

.mo-text {
    color: var(--mo-accent-dark);
}

.mo-text-muted {
    color: var(--mo-accent-dark);
}

.mo-text-accent {
    color: var(--mo-accent-dark);
    font-weight: 600;
}


/* =====================================================
   5. LAYOUT
===================================================== */

.mo-container.full-width {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.mo-section {
    margin-bottom: 3rem;
}

.mo-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%; /* 🔥 force full container width */
    min-width: 0; /* 🔥 prevents shrink-to-content bugs */
    justify-items: stretch; /* 🔥 forces children to fill column */
    align-items: stretch; /* 🔥 consistent row behavior */
}

    .mo-grid > * {
        min-width: 0;
        overflow: hidden;
    }

.mo-grid-2 {
    grid-template-columns: repeat(2,1fr);
}

.mo-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mo-grid-4 {
    grid-template-columns: repeat(4,1fr);
}

.mo-flex {
    display: flex;
}

.mo-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mo-center {
    text-align: center;
}


/* =====================================================
   6. COMPONENTS
===================================================== */


/* ---------- CARD ---------- */

.mo-card {
    background: var(--mo-primary-dark);
    border: 1px solid var(--mo-border);
    border-radius: var(--mo-radius-md);
    padding: 1.5rem;
    box-shadow: var(--mo-shadow-sm);
    transition: var(--mo-transition);
}

    .mo-card:hover {
        border-color: var(--mo-border-strong);
        transform: translateY(-3px);
        box-shadow: var(--mo-shadow-md);
    }

.mo-card-header {
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Profile Card (static) */

.mo-card-profile {
    background: var(--mo-primary);
    border: 1px solid var(--mo-border);
    border-radius: var(--mo-radius-md);
    padding: 1.5rem;
    box-shadow: var(--mo-shadow-sm);
    transition: none;
}

    .mo-card-profile:hover {
        border-color: var(--mo-border);
        box-shadow: var(--mo-shadow-sm);
        transform: none;
    }

/* =====================================================
   GROCERIES - LIST CARDS
===================================================== */

.mo-grocery-list {
    width: 90vw;
    max-width: 1100px;
    margin: 0 auto;
}

.mo-grocery-card {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: var(--mo-radius-md);
    background: var(--mo-accent-dark);
    border: 1px solid var(--mo-border);
    box-shadow: var(--mo-shadow-sm);
    transition: var(--mo-transition-fast);
    cursor: pointer; /* 🔥 THIS is the key */
}

    .mo-grocery-card:hover {
        border-color: var(--mo-border-strong);
        background: var(--mo-accent);
    }

    .mo-grocery-card:active {
        transform: scale(0.995);
    }

    .mo-grocery-card:has(input[type="checkbox"]:checked) .mo-grocery-name {
        text-decoration: line-through;
        color: var(--mo-gray);
        opacity: 0.7;
    }

.mo-grocery-checkbox {
    cursor: pointer;
}

/* LEFT SIDE */
.mo-grocery-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* MIDDLE (ingredient) */
.mo-grocery-name {
    flex: 1;
    padding: 0 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* RIGHT (quantity) */
.mo-grocery-qty {
    min-width: 140px;
    text-align: right;
    font-weight: 600;
    color: var(--mo-light);
}

.mo-grocery-card input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: var(--mo-primary);
    cursor: pointer;
}

.mo-grocery-pref-card {
    width: 90vw;
    max-width: 1100px;
    margin: 1rem auto 2rem auto;
}


/* ---------- BUTTONS ---------- */

.mo-btn {
    display: inline-block;
    padding: .6rem 1.2rem;
    border-radius: var(--mo-radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: var(--mo-transition-fast);
}

    .mo-btn,
    .mo-btn:link,
    .mo-btn:visited,
    .mo-btn:hover,
    .mo-btn:active {
        text-decoration: none;
    }


/* =====================================================
   BUTTON HOVER FIX (PRIMARY OVERRIDE)
   Prevent global <a>:hover red text override
===================================================== */

.mo-btn-primary:hover,
a.mo-btn-primary:hover,
a.mo-btn-primary:visited:hover {
}

/* PRIMARY */

.mo-btn-primary {
    background: var(--mo-accent);
    color: var(--mo-white);
}

    .mo-btn-primary:hover {
        background: var(--mo-primary-darker);
        color: var(--mo-accent-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    }


/* SECONDARY */

.mo-btn-secondary {
    background: var(--mo-primary-darker);
    color: var(--mo-white);
}

    .mo-btn-secondary:hover {
        background: var(--mo-primary);
    }


/* OUTLINE */

.mo-btn-outline {
    border: 1px solid var(--mo-accent);
    color: var(--mo-accent);
    background: transparent;
}

    .mo-btn-outline:hover {
        background: var(--mo-accent);
        color: var(--mo-white);
    }


/* ---------- INPUTS ---------- */

.mo-input {
    width: 100%;
    padding: .6rem .8rem;
    background: var(--mo-accent-dark);
    border: 1px solid var(--mo-accent-darker);
    border-radius: var(--mo-radius-sm);
    color: var(--mo-white);
}

    .mo-input:focus {
        outline: none;
        border-color: var(--mo-accent);
        box-shadow: 0 0 0 1px var(--mo-accent);
    }

/* =====================================================
   DATE INPUT - DARK THEME FIX
===================================================== */

input[type="date"].mo-input {
    color-scheme: dark; /* 🔥 tells browser to use dark UI */
    position: relative;
}

    /* Fix text + background consistency */
    input[type="date"].mo-input::-webkit-datetime-edit {
        color: var(--mo-white);
    }

    /* Calendar icon */
    input[type="date"].mo-input::-webkit-calendar-picker-indicator {
        filter: invert(1) brightness(0.8) sepia(1) saturate(5) hue-rotate(-10deg);
        opacity: 0.8;
        cursor: pointer;
        transition: var(--mo-transition-fast);
    }

        /* Hover effect on icon */
        input[type="date"].mo-input::-webkit-calendar-picker-indicator:hover {
            opacity: 1;
        }

    /* Remove ugly inner spin buttons / padding issues */
    input[type="date"].mo-input::-webkit-inner-spin-button {
        display: none;
    }

/* Firefox support */
input[type="date"].mo-input {
    background-color: var(--mo-primary-dark);
    color: var(--mo-white);
}

/* Force font consistency inside date inputs */
input[type="date"].mo-input {
    font-family: var(--mo-font-main);
    font-size: 0.95rem;
}

    /* Chrome/Safari internal text */
    input[type="date"].mo-input::-webkit-datetime-edit {
        font-family: var(--mo-font-main);
        color: var(--mo-white);
    }

    /* Individual segments (month/day/year) */
    input[type="date"].mo-input::-webkit-datetime-edit-text,
    input[type="date"].mo-input::-webkit-datetime-edit-month-field,
    input[type="date"].mo-input::-webkit-datetime-edit-day-field,
    input[type="date"].mo-input::-webkit-datetime-edit-year-field {
        color: var(--mo-white);
        font-family: var(--mo-font-main);
    }

/* Hide default text when empty */
input[type="date"].mo-date:invalid::-webkit-datetime-edit {
    color: transparent;
}

/* Show text when user selects a date */
input[type="date"].mo-date:valid::-webkit-datetime-edit {
    color: var(--mo-white);
}

/* Fake placeholder */
input[type="date"].mo-date:invalid::before {
    content: "Select date";
    color: var(--mo-gray);
    position: absolute;
    left: 0.8rem;
}

/* Remove fake placeholder when value exists */
input[type="date"].mo-date:valid::before {
    content: "";
}


/* =====================================================
   RECIPE CATEGORY ICON (MODERN GLYPH BADGE)
===================================================== */

.mo-category-icon {
    width: 150px;
    height: 150px;
    display: block;
    flex-shrink: 0;
    color: var(--mo-accent);
}

.mo-main-logo-icon {
    display: block;
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

/* =====================================================
   7. NAVIGATION
===================================================== */

.mo-navbar {
    position: sticky;
    top: 10px;
    z-index: 1000;
    margin: 0 auto;
    border-bottom: 4px solid var(--mo-accent-darker);
    background: var(--mo-accent-dark);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

/* GRID LAYOUT */
.mo-nav-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1rem;
    min-height: 40px;
}

/* CENTER LINKS */
.mo-nav-links {
    display: flex;
    gap: 1.25rem;
    justify-self: center;
    align-items: center;
}

/* LINKS */
.mo-nav-link {
    color: var(--mo-gray);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, transform 0.15s ease;
}

    .mo-nav-link:hover {
        color: var(--mo-white);
        transform: translateY(-1px);
    }

/* LEFT / RIGHT */
.mo-nav-left {
    justify-self: start;
    display: flex;
    align-items: center;
}

.mo-nav-right {
    justify-self: end;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* =====================================================
  7a. PROFILE DROPDOWN
===================================================== */

.mo-profile-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: var(--mo-accent);
    color: var(--mo-white);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}

    .mo-profile-btn:hover {
        background: var(--mo-primary-dark);
        transform: translateY(-2px);
    }

.mo-profile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--mo-primary-dark);
    border: 1px solid var(--mo-border);
    border-radius: var(--mo-radius-sm);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    box-shadow: var(--mo-shadow-md);
}

    .mo-profile-menu .mo-profile-email {
        padding: .6rem 1rem;
        border-bottom: 1px solid var(--mo-border);
        font-size: .95rem;
        font-weight: 600;
        color: var(--mo-accent-light);
        overflow-wrap: break-word;
    }

    .mo-profile-menu a,
    .mo-profile-menu button {
        display: flex;
        align-items: center;
        width: 100%;
        padding: .6rem 1rem;
        text-align: left;
        background: transparent;
        border: none;
        color: var(--mo-white);
        font-weight: 500;
        font-size: .95rem;
        font-family: inherit;
        cursor: pointer;
        transition: all .15s ease;
    }

        .mo-profile-menu a:hover,
        .mo-profile-menu button:hover {
            background: var(--mo-primary-darker);
        }

    .mo-profile-menu button {
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }

.mo-profile-avatar {
    /* legacy/internal fallback only */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--mo-accent);
    color: var(--mo-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.08);
}

.mo-profile-value {
    color: var(--mo-accent-dark);
}

.mo-label {
    color: var(--mo-accent-dark);
}


/* =====================================================
   8. HERO
===================================================== */

.mo-hero,
footer.mo-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 4rem 1rem;
}

.mo-hero-title {
    color: var(--mo-black);
    font-size: 3rem;
    font-weight: 700;
}

.mo-hero-subtitle {
    color: var(--mo-accent-dark);
    margin-top: 1rem;
}


/* =====================================================
   9. BADGES
===================================================== */

.mo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem .85rem;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 800;
    background: var(--mo-accent);
    border: 1px solid var(--mo-primary-darker);
    min-width: 70px;
}

    .mo-badge:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

.mo-badge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

.mo-badge-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--mo-accent-dark);
    text-transform: uppercase;
}

.mo-calories,
.mo-protein,
.mo-carbs,
.mo-fat {
    color: var(--mo-accent-light);
    background: var(--mo-accent);
    border-color: var(--mo-accent-dark);
}

/* =====================================================
   9a. CALENDAR BADGES (STATIC - NO HOVER)
===================================================== */

.mo-badge-calendar-static {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.25rem; /* matches weekday tiles */
    border-radius: var(--mo-radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--mo-primary-darker);
    border: 1px solid var(--mo-accent-dark);
    color: var(--mo-light);
    text-align: center;
    /* kill all interaction feel */
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: default;
}

    /* meal-specific styling */
    .mo-badge-calendar-static.meals {
        background: var(--mo-accent-dark);
        border: none;
        color: var(--mo-light);
    }

.meal-toggle-btn {
    width: 140px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--mo-border);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    background: var(--mo-primary);
    padding: 0;
}

.meal-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    border-radius: 999px;
    background: var(--mo-primary-dark);
    transition: all 0.25s ease;
    z-index: 1;
}

.meal-toggle-left,
.meal-toggle-right {
    flex: 1;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 2;
    transition: color 0.2s ease;
}


/* =====================================================
   10. TABLES
===================================================== */

.mo-table-wrapper {
    border: 1px solid var(--mo-primary-darker);
    border-radius: 12px;
    overflow: hidden;
    background: var(--mo-primary);
}

.mo-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .mo-modern-table thead {
        background: var(--mo-primary-dark);
    }

        .mo-modern-table thead th {
            text-align: left;
            padding: 1rem;
            font-size: .75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .05em;
            color: #888;
            border-bottom: 1px solid var(--mo-primary-darker);
        }

    .mo-modern-table tbody td {
        padding: 1rem;
        border-bottom: 1px solid var(--mo-primary-darker);
        vertical-align: middle;
    }

    .mo-modern-table tbody tr:hover {
        background: rgba(255,255,255,.04);
    }

    .mo-modern-table td:not(:first-child),
    .mo-modern-table th:not(:first-child) {
        text-align: right;
    }

    .mo-modern-table td:first-child {
        text-align: left;
    }


/* =====================================================
   11. RECIPE CARDS
===================================================== */

.mo-recipe-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    min-height: 120px;
    cursor: pointer;
    position: relative;
    /* 🔥 CRITICAL FIX */
    width: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* prevents flex bleed */
    background: var(--mo-primary-dark);
}


.mo-recipe-left {
    flex: 1 1 0; /* 🔥 KEY DIFFERENCE */
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
    text-align: left;
}

    .mo-recipe-left h2,
    .mo-recipe-left p {
        margin: 0;
        max-width: 100%;
        min-width: 0;
        white-space: normal; /* 🔥 overrides hidden nowrap cases */
        overflow-wrap: anywhere; /* strongest wrapping behavior */
        word-break: break-word;
        color: var(--mo-accent-dark)
    }

.mo-recipe-macros {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.mo-favorite-star {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 25px;
    color: var(--mo-gray);
    cursor: pointer;
    transition: 0.2s;
}

    .mo-favorite-star.favorited {
        color: darkgoldenrod;
    }


/* =====================================================
   12. MODALS
===================================================== */

.mo-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.mo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
}

.mo-modal-panel {
    position: relative;
    background: var(--mo-primary-dark);
    border-radius: var(--mo-radius-lg);
    width: 90%;
    max-width: 750px;
    margin: 6vh auto;
    padding: 2rem;
    box-shadow: var(--mo-shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.mo-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #bbb;
    cursor: pointer;
}

    .mo-modal-close:hover {
        color: white;
    }

/* =====================================================
   12a. RECIPE INFO MODAL (FINAL)
===================================================== */

/* ================================
   RECIPE MODAL - PREMIUM UX DESIGN
================================ */

.mo-recipe-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mo-recipe-title-block h1 {
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mo-recipe-title-block p {
    margin-top: 0.3rem;
    line-height: 1.4;
}

/* Macro Strip (big UX upgrade) */
.mo-recipe-macro-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--mo-radius-md);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.mo-macro {
    text-align: center;
}

    .mo-macro .label {
        display: block;
        font-size: 0.7rem;
        color: var(--mo-accent-dark);
        margin-bottom: 0.2rem;
    }

    .mo-macro .value {
        font-weight: 700;
        color: var(--mo-text);
    }

/* Layout */
.mo-recipe-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Section Card */
.mo-recipe-section {
    background: var(--mo-accent);
    border-radius: var(--mo-radius-md);
    padding: 1.25rem;
    box-shadow: var(--mo-shadow-sm);
}

/* Section header */
.mo-section-header {
    margin-bottom: 1rem;
}

    .mo-section-header .small {
        font-size: 0.85rem;
    }

/* Ingredients (clean list UX) */
.mo-ingredients-v2 {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .mo-ingredients-v2 li {
        display: flex;
        justify-content: space-between;
        padding: 0.35rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    .mo-ingredients-v2 .qty {
        color: var(--mo-accent);
        font-weight: 600;
        min-width: 80px;
    }

    .mo-ingredients-v2 .name {
        flex: 1;
        text-align: right;
    }

/* Steps (modern app style) */
.mo-steps-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.mo-step-v2 {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

    .mo-step-v2 .circle {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        background: var(--mo-accent);
        color: white;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mo-step-v2 .content {
        line-height: 1.5;
    }


/* =====================================================
   13. UTILITIES
===================================================== */

.mo-mt-1 {
    margin-top: .5rem;
}

.mo-mt-2 {
    margin-top: 1rem;
}

.mo-mt-3 {
    margin-top: 2rem;
}

.mo-mb-1 {
    margin-bottom: .5rem;
}

.mo-mb-2 {
    margin-bottom: 1rem;
}

.mo-mb-3 {
    margin-bottom: 2rem;
}


/* =====================================================
   14. SCROLLBAR
===================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--mo-black);
}

::-webkit-scrollbar-thumb {
    background: var(--mo-primary-darker);
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--mo-accent);
    }


/* =====================================================
   15. CALENDAR - FULL WIDTH FIX
===================================================== */

/* Calendar container */
.mo-section.mo-container.full-width {
    max-width: 1200px; /* let it grow on fullscreen but limit it */
    margin: 0 auto; /* center on large screens */
    padding: 2rem 1rem;
}

/* Calendar grid */
.mo-grid.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 columns for the week */
    gap: 1rem; /* spacing between cards */
}

/* Calendar weekday headers */
.mo-calendar-weekday {
    background: var(--mo-accent-dark);
    border: none;
    padding: 1rem 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 1vw, 1.5rem);
    color: var(--mo-light);
    text-align: center;
    border-radius: var(--mo-radius-sm);
    /* CRITICAL FIX */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Calendar day cards */
.mo-day-card {
    min-height: 160px; /* taller cards */
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: var(--mo-accent);
    border: 1px solid var(--mo-accent);
    border-radius: var(--mo-radius-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Day number styling */
.mo-day-number {
    font-weight: 800;
    font-size: 2.5rem; /* bigger number */
    margin-bottom: 0.5rem;
}

/* Meals/Badge container inside day */
.mo-day-meals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    /* THIS FIXES CENTERING */
    align-items: center;
    justify-content: center;
}

/* Highlight today */
.mo-day-today {
    border: 3px solid var(--mo-accent);
}

/* Weekend styling */
.mo-day-weekend {
    background: var(--mo-primary-dark);
}

/* =====================================================
   15b. MYPLAN CALENDAR (FEATURE SCOPED OVERRIDES)
   ONLY applies inside .mo-myplan
===================================================== */

/* Tabs (MyPlan only override of global mo-tabs behavior if needed) */
.mo-myplan .mo-tabs {
    width: 100%;
    max-width: 900px;
    margin: 1rem auto 2rem auto;
}

/* Calendar grid spacing tweak (MyPlan only) */
.mo-myplan .mo-grid.calendar-grid {
    gap: 1.25rem;
}

/* Day cards (MyPlan refinement layer) */
.mo-myplan .mo-day-card {
    min-height: 170px;
    padding: 1.5rem;
    background: var(--mo-primary);
    color: var(--mo-accent-darker);
}

/* Day number emphasis only in MyPlan */
.mo-myplan .mo-day-number {
    font-size: 2.75rem;
    color: var(--mo-accent-dark);
}

/* Weekday header override ONLY for MyPlan */
.mo-myplan .mo-calendar-weekday {
    font-size: 1.25rem;
    padding: 1rem;
}

/* Edit plan tab content spacing fix (if needed later) */
.mo-myplan .mo-tab-content {
    padding-top: 1rem;
}

input[type="checkbox"] {
    accent-color: var(--mo-accent-dark);
}

/* =====================================================
   16. TABS - MEALOS STYLE
===================================================== */

/* Tabs container */
.mo-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    /* centered wide container */
    width: 50vw;
    margin-left: calc(50% - 25vw);
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 0.4rem;
    background: var(--mo-primary-dark);
    border: 1px solid var(--mo-border);
    border-radius: var(--mo-radius-md);
    box-shadow: var(--mo-shadow-sm);
    overflow-x: auto;
}

/* =====================================================
   PROFILE PAGE TAB FIX (prevents overflow inside card)
===================================================== */

.mo-card-profile .mo-tabs {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    /* override viewport centering behavior */
    transform: none;
    background: var(--mo-accent);
}

/* Individual tab */
.mo-tab {
    appearance: none;
    border: 1px solid transparent; /* prevents layout shift */

    background: transparent;
    color: var(--mo-gray);
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--mo-radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--mo-transition-fast);
}

    /* Hover */
    .mo-tab:hover {
        background: var(--mo-primary-darker);
        color: var(--mo-white);
    }

    /* Active tab */
    .mo-tab.active {
        background: var(--mo-primary);
        color: var(--mo-accent);
        border-color: var(--mo-border-strong);
        box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    }

/* Tab content panels */
.mo-tab-content {
    display: none;
}

    .mo-tab-content.active {
        display: block;
        animation: mo-tab-fade 0.25s ease;
    }

/* Animation */
@keyframes mo-tab-fade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile adjustments */
@media (max-width: 700px) {

    .mo-tabs {
        width: 90vw;
        margin-left: calc(50% - 45vw);
    }

    .mo-tab {
        flex: 1;
        text-align: center;
    }
}

/* =====================================================
   MOBILE FIXES (SAFE - DOES NOT AFFECT DESKTOP)
===================================================== */

@media (max-width: 768px) {

    /* Prevent horizontal scrolling issues */
    body {
        overflow-x: hidden;
    }

    /* FIX FLEX OVERFLOWS */
    .mo-flex,
    .mo-flex-between,
    .mo-recipe-card {
        flex-wrap: wrap;
    }

    /* FIX GRID COLLAPSE */
    .mo-grid-2,
    .mo-grid-3,
    .mo-grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* FIX TABS (REMOVE VW CENTERING ON MOBILE ONLY) */
    .mo-tabs {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    /* FIX GROCERY LIST */
    .mo-grocery-list {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }

    /* FIX RECIPE CARDS STACKING */
    .mo-recipe-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* FIX NAVBAR OVERFLOW */
    .mo-navbar {
        width: 100%;
        border-radius: 0;
    }

    .mo-nav-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .mo-nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* TEXT SCALING */
    .mo-h1 {
        font-size: 1.8rem;
    }

    .mo-h2 {
        font-size: 1.4rem;
    }

    .mo-h3 {
        font-size: 1.2rem;
    }
}

/* NAV CONTAINER */
.mo-nav-pill {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* PILL BASE */
.mo-pill-link {
    background: var(--mo-primary-dark);
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, background 0.2s ease;
}

    /* ICON */
    .mo-pill-link img {
        width: 22px;
        height: 22px;
        object-fit: contain;
        flex-shrink: 0;
    }

/* TEXT ALWAYS VISIBLE (small + clean) */
.mo-pill-text {
    color: var(--mo-accent-dark);
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* HOVER POLISH */
.mo-pill-link:hover {
    transform: translateY(-1px);
}

    .mo-pill-link:hover .mo-pill-text {
        opacity: 1;
    }

@media (max-width: 1100px) {
    .meal-modal-body {
        grid-template-columns: 1fr !important;
    }
}