﻿/* ==========================================================================
   1. GLOBAL WRAPPER & SCROLL VIEWPORT ENGINE
   ========================================================================== */
.rendeles-dashboard-container {
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   2. UNIFIED GRID ENGINE (THE 5-DAY VS 7-DAY SWEET SPOT)
   ========================================================================== */
/*.rendeles-unified-grid {
    display: grid;
    grid-auto-rows: max-content;
    gap: 12px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: 44px minmax(180px, 220px) repeat(var(--days-count), minmax(190px, 1fr));
}*/
.rendeles-sticky-scroll-wrapper {
    position: sticky;
    bottom: 0;
    max-height: calc(100vh - 300px); /* Sets vertical window frame so scrollbar stays visible */
    overflow-x: auto;
    overflow-y: auto;
    background-color: #ffffff; /* Prevents background content from showing through */
    z-index: 10;
}

/*.rendeles-unified-grid {
    display: grid;
    grid-auto-rows: max-content;
    gap: 12px;
    padding: 0;
    width: max-content;*/ /* Critical: forces horizontal overflow */
    /*min-width: 100%;
    box-sizing: border-box;*/
    /*grid-template-columns: 44px minmax(180px, 220px) repeat(var(--days-count), minmax(180px, 1fr));*/
    /*grid-template-columns: 44px minmax(180px, 220px) repeat(var(--days-count), 180px);
}*/

.rendeles-unified-grid {
    display: grid;
    grid-auto-rows: max-content;
    gap: 12px;
    padding: 0;
    width: 100%; /* max-content helyett 100%, hogy a grid tudja, mihez képest töltsön ki teret */
    min-width: 100%; /* Így megmarad a vízszintes scroll, ha túl kicsi a képernyő */
    box-sizing: border-box;
    grid-template-columns: 44px minmax(180px, 220px) repeat(var(--days-count), minmax(230px, 250px));
}

/* ==========================================================================
   3. STICKY DATE HEADERS
   ========================================================================== */
.canvas-header-corner-spacer {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 25;
}

.canvas-date-header {
    text-align: center;
    padding: 10px 6px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.canvas-day-name {
    font-weight: 700;
    color: #0f172a;
    text-transform: capitalize;
    font-size: 0.9rem;
}

.canvas-day-sub {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

/* ==========================================================================
   4. MEAL SECTIONS (ACCORDIONS) - HORIZONTAL SCROLL STICKY FIX
   ========================================================================== */
.meal-accordion-trigger-row {
    grid-column: 1 / -1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 12px;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s;
    position: sticky;
    left: 0;
    z-index: 10;
}

    .meal-accordion-trigger-row:hover {
        background: #f1f5f9;
        border-color: #cbd5e1;
    }

.accordion-sticky-content-wrapper {
    position: sticky;
    left: 0;
    z-index: 10;
    width: 99cqw;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

    .accordion-sticky-content-wrapper > h6 {
        position: sticky;
        left: 0;
    }

.collapsed-group-spacer {
    grid-column: 1 / -1;
    height: 4px;
}

/* ==========================================================================
   5. FIXED POSITIONING CHANNELS (STICKIES & PLACEMENT WRAPPERS)
   ========================================================================== */
.canvas-vagy-rail {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 5;
    box-sizing: border-box;
}

.client-diet-cell-target {
    position: sticky;
    left: 60px;
    z-index: 5;
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
    box-shadow: -20px 0 0 0 #ffffff;
}

.client-food-cell-target {
    width: 100%;
    box-sizing: border-box;
}

    /*Imre: This would make the cells the same height, but it looks goofy with the takeout visible*/
    .client-food-cell-target > div:first-of-type {
        height: 100%;
    }

.canvas-card-placement {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
    align-items: stretch;
}

.horizontal-stack {
    gap: 8px;
}
/* ==========================================================================
   6. UNIFORM CARDS DESIGN WITH ENFORCED LIMITS (PRODUCTION ENHANCED)
   ========================================================================== */
/* Left-Side Diet Profile Card Badge */
.rendeles-diet-card {
    flex-grow: 1;
    background-color: var(--diet-theme-color, #0f172a);
    color: var(--diet-theme-text, #ffffff);
    border-radius: 12px;
    padding: 14px 12px;
    /*min-height: 115px;*/
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    width: 100%;
}

    .rendeles-diet-card .diet-title {
        font-size: 0.95rem;
        font-weight: 800;
        margin: 0;
        line-height: 1.3;
        white-space: pre-line;
    }

/* Standard Food Option Choice Card */
.rendeles-food-card {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    /*min-height: 115px;*/
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    padding: 12px;
}

/* Big Accessible Click Zone Wrapper */
.food-card-click-zone {
    margin: -12px -12px 0 -12px; /* Flushed with card boundaries */
    padding: 12px 12px 4px 12px;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transition: background-color 0.12s ease;
}

    .food-card-click-zone.clickable {
        cursor: pointer;
    }
        .food-card-click-zone.clickable:hover {
            background-color: #f8fafc; /* Gentle feedback highlight */
        }

.food-card-top {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.food-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.35;
    margin: 0;
}

/* Static Structural Middle Row */
.food-card-middle {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.rating-value {
    font-size: 0.85rem;
}

.text-amber-500 {
    color: #f59e0b;
}

.food-price-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-top: 2px dashed #e2e8f0;
}

.food-price {
    text-wrap: nowrap;
    font-weight: 800;
    font-size: 0.85rem;
    color: #0f172a;
}
.food-price-discont {
    font-weight: 700;
    color: #999;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: #777;
}
/* Active Selections Theme States (MudBlazor Tokens Mapping) */
.rendeles-food-card.has-items {
    border-color: var(--diet-theme-color, #2563eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

    .rendeles-food-card.has-items .food-card-bottom {
        border-top-style: solid;
        border-top-color: var(--diet-theme-color, #2563eb);
    }
/* ==========================================================================
   7. NATIVE MUDBLAZOR CONTROL PILL & CIRCLE CONFIGURATIONS
   ========================================================================== */
/* Standalone Dynamic Plus Button */
.btn-circle-plus-mud {
    width: 30px !important;
    height: 30px !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background-color: var(--diet-theme-color, #2563eb) !important;
    color: var(--diet-theme-text, #ffffff) !important;
}

    .btn-circle-plus-mud:hover {
        filter: brightness(0.9);
    }
    /* Grayed out styling state for disabled maximum item thresholds */
    .btn-circle-plus-mud.mud-button-disabled {
        background-color: #e2e8f0 !important;
        color: #94a3b8 !important;
        opacity: 0.7;
    }
/* Container positioning */
.pill-wrapper {
    flex-grow: 1;
    position: relative;
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
}

/* Front interactive pill */
.quantity-pill-mud {
    position: relative;
    z-index: 2;
    align-self: center;
    width: fit-content;
    display: flex;
    align-items: center;
    border: 2px solid var(--diet-theme-color, #2563eb);
    border-radius: 20px;
    background: #ffffff;
    height: 36px;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Sliding context badge behind the pill */
.pill-badge {
    position: relative;
    z-index: 1;
    margin-right: -18px; /* Overlaps behind the pill's right curve */
    padding: 2px 22px 2px 8px;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1.1;
    font-weight: 600;
    white-space: nowrap;
}

    .pill-badge.added {
        background-color: #e6f4ea;
        color: #137333;
    }

    .pill-badge.removed {
        background-color: #fce8e6;
        color: #c5221f;
    }

.pill-badge-sub {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Action button resets */
.pill-action-btn-mud {
    padding: 2px !important;
    color: var(--diet-theme-color, #2563eb) !important;
}

    .pill-action-btn-mud:hover {
        background-color: #f1f5f9 !important;
    }

    .pill-action-btn-mud.text-danger {
        color: var(--mud-palette-error, #dc2626) !important;
    }

    .pill-action-btn-mud.mud-button-disabled {
        color: #cbd5e1 !important;
        opacity: 0.5;
    }

/* Central number display */
.pill-count-mud {
    margin: 0 4px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
    min-width: 18px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
    ####### Takeaway #######
*/


.takeaway-sub-row {
    animation: fadeInSlide 0.2s ease-out;
    width: 100%;
}

.border-top-dashed {
    border-top: 1px dashed #e2e8f0;
}

.takeaway-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569; /* slate-600 */
}

.takeaway-price-hint {
    font-size: 0.65rem;
    color: #94a3b8; /* slate-400 */
    margin-top: -2px;
}
/* Micro-pill styling for the takeaway counter */
.takeaway-btn-add {
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    padding: 2px !important;
    border-radius: 6px !important;
}

.takeaway-pill {
    display: flex;
    align-items: center;
    background-color: #f8fafc; /* slate-50 */
    border: 1px solid #e2e8f0; /* slate-200 */
    border-radius: 6px;
    padding: 1px;
}

.takeaway-pill-btn {
    color: #64748b !important;
    padding: 2px !important;
}

.takeaway-pill-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    min-width: 16px;
    text-align: center;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ==========================================================================
   8. OR-BRACKET SYSTEM DESIGN (VAGY SYSTEM RESTORED)
   ========================================================================== */
.canvas-vagy-bracket {
    border-left: 2px solid #64748b;
    border-top: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    height: calc(100% - 12px);
    width: 16px;
    min-width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.vagy-text {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    font-size: 0.75rem;
    font-weight: 800;
    color: #64748b;
    background: #ffffff;
    padding: 6px 0;
    margin-left: -12px;
    letter-spacing: 1px;
    white-space: nowrap;
    user-select: none;
}
/* ==========================================================================
   9. MOBILE STACKING EXTENSION ENGINE (BREAKPOINT: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .dashboard-scroll-container {
        overflow-x: hidden !important;
        padding: 8px !important;
        border: none !important;
    }

    .rendeles-mobile-timeline {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    /* Horizontal day selector track switch */
    .mobile-tabs-scroll-axis {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 4px 2px 10px 2px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

        .mobile-tabs-scroll-axis::-webkit-scrollbar {
            display: none;
        }

    .mobile-tab-pill {
        flex: 1;
        min-width: 68px;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 6px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        cursor: pointer;
        transition: all 0.15s ease;
    }

        .mobile-tab-pill.is-active {
            background: #0f172a;
            border-color: #0f172a;
        }

        .mobile-tab-pill .tab-day-name {
            font-size: 0.8rem;
            font-weight: 800;
            color: #475569;
            text-transform: uppercase;
        }

        .mobile-tab-pill .tab-day-sub {
            font-size: 0.7rem;
            color: #94a3b8;
        }

        .mobile-tab-pill.is-active .tab-day-name {
            color: #ffffff;
        }

        .mobile-tab-pill.is-active .tab-day-sub {
            color: #cbd5e1;
        }

    .mobile-date-section-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    }

    .mobile-date-header-strip {
        background: #f8fafc;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #e2e8f0;
    }

    .mobile-date-content-stack {
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .mobile-meal-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        border-left: 2px dashed #cbd5e1;
        padding-left: 10px;
        margin-left: 4px;
    }

    .mobile-meal-title-badge {
        display: inline-flex;
        align-items: center;
        color: #64748b;
    }

    .mobile-cards-list-wrapper {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    /* The main grouped box containing the diet tag and its items */
    .mobile-diet-group-box {
        display: flex;
        flex-direction: column;
        width: 100%;
        background: #f8fafc;
        border-radius: 12px;
        border-left: 4px solid var(--mobile-diet-color, #2563eb);
        border-top: 1px solid #e2e8f0;
        border-right: 1px solid #e2e8f0;
        border-bottom: 1px solid #e2e8f0;
        overflow: hidden;
        margin-bottom: 4px;
    }
    /* Displays once at the top of the group */
    .mobile-diet-tag {
        font-size: 0.7rem;
        font-weight: 800;
        text-transform: uppercase;
        padding: 6px 10px;
        color: #475569;
        background: rgba(15, 23, 42, 0.03);
        border-bottom: 1px solid #e2e8f0;
        letter-spacing: 0.5px;
    }
    /* Container holding stacked items cleanly */
    .mobile-diet-items-stack {
        display: flex;
        flex-direction: column;
    }
    /* Adds a subtle dashed divider between stacked items of the same diet */
    .mobile-card-inner-render {
        padding: 6px 4px;
    }

        .mobile-card-inner-render + .mobile-card-inner-render {
            border-top: 1px dashed #e2e8f0;
        }
    /* Cards normalization overriding for absolute responsive density */
    .rendeles-food-card {
        max-height: none !important;
        min-height: auto !important;
        border: none !important;
        background: transparent !important;
        padding: 4px !important;
    }

        .rendeles-food-card.has-items {
            border-left: none !important;
        }

    .food-card-bottom {
        background: transparent !important;
        border-top: 1px dashed #e2e8f0 !important;
        padding: 6px 4px 2px 4px !important;
    }

    .food-card-middle {
        margin-bottom: 4px;
    }
}
/* ==========================================================================
   10. MOBILE VAGY INTERSECT DIVIDER BADGES
   ========================================================================== */
.mobile-vagy-divider-line {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 4px 0;
    width: 100%;
}

    .mobile-vagy-divider-line::before,
    .mobile-vagy-divider-line::after {
        content: '';
        flex: 1;
        border-bottom: 2px solid #cbd5e1;
    }

    .mobile-vagy-divider-line:not(:empty)::before {
        margin-right: .5em;
    }

    .mobile-vagy-divider-line:not(:empty)::after {
        margin-left: .5em;
    }

.mobile-vagy-pill-text {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    user-select: none;
}
/* ==========================================================================
   11. Tapanyag es Allergen dialog
   ========================================================================== */
/* Container Scroll Limits & Performance on Mobile */
/* Container Scroll Settings */
.rendeles-details-main-scroll {
    max-height: 72vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
/* Base Responsive Grid Structure */
.rendeles-details-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .rendeles-details-grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.rendeles-details-section-title {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
}
/* Master Overview Card */
.rendeles-details-summary-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
}

.rendeles-details-divider {
    border: 0;
    border-top: 1px dashed #cbd5e1;
}
/* Ingredient Container Panel */
.rendeles-details-ingredient-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
}

.rendeles-details-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.725rem;
    font-weight: 700;
    border-radius: 8px;
    margin-right: 4px;
    margin-bottom: 4px;
}


.rendeles-details-nutri-list {
    display: flex;
    flex-direction: column;
}

.rendeles-details-nutri-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}
/* Allergen Styling Grid Panels */
.rendeles-details-allergen-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.rendeles-details-status-contains {
    background-color: #fef2f2;
    border-color: #fee2e2;
}

.rendeles-details-status-may-contain {
    background-color: #fffbeb;
    border-color: #fef3c7;
}

.rendeles-details-allergen-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}


.rendeles-details-allergen-title {
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.rendeles-details-allergen-subtitle {
    font-size: 0.7rem;
    font-weight: 600;
}
/* Thumbnails */
.rendeles-details-thumb-container {
    position: relative;
    width: 100%;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.rendeles-details-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rendeles-details-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.rendeles-details-thumb-container:hover .rendeles-details-zoom-overlay {
    opacity: 1;
}
/* SPACIOUS & CLEAN RATINGS */
.rendeles-details-ratings-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.rendeles-details-ratings-header {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.075em;
    color: #94a3b8;
}

.rendeles-details-rating-item {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (min-width: 480px) {
    .rendeles-details-rating-item {
        flex-direction: row;
        align-items: center;
    }
}

.rendeles-details-rating-question {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    max-width: 70%;
}
