/* Meal Logs Calendar Styles - Month View Only */

/* Base calendar container */
#logs-calendar-container {
    font-family: var(--bs-body-font-family);
    color: var(--bs-body-color);
    overflow-x: hidden;
}

/* Month view container */
.logs-month-view {
    padding: 1rem;
    background-color: var(--bs-body-bg);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    width: 100%;
    overflow-x: hidden;
}

/* Month header */
.logs-month-header {
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1), rgba(var(--bs-primary-rgb), 0.05));
    border-radius: 0.5rem;
    padding: 1rem;
}

.logs-month-header h5 {
    font-weight: 600;
    color: var(--bs-primary);
    margin: 0;
}

/* Weekday headers */
.logs-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 0.5rem;
    gap: 0.125rem;
}

.logs-weekday-header {
    font-weight: 600;
    color: var(--bs-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0.25rem;
    background: rgba(var(--bs-light-rgb), 0.5);
    border-radius: 0.375rem;
}

/* Calendar days grid */
.logs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 0.25rem;
    width: 100%;
}

/* Calendar day cell - improved layout */
.logs-calendar-day {
    min-height: 75px;
    max-height: 95px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
    overflow: hidden;
}

.logs-calendar-day:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0.25rem 0.5rem rgba(var(--bs-primary-rgb), 0.15);
    transform: translateY(-2px);
    z-index: 5;
}

/* Day button - improved layout */
.logs-day-button {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border-radius: 0.5rem;
    border: none;
    background: none;
    position: relative;
    padding: 0.4rem;
    transition: all 0.2s ease;
    text-align: left;
    cursor: pointer;
    gap: 0.3rem;
}

.logs-day-button:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Day number - positioned at top */
.day-number {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bs-body-color);
    line-height: 1;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.logs-day-button.has-events .day-number {
    font-weight: 700;
    color: var(--bs-primary);
    border-bottom-color: rgba(var(--bs-primary-rgb), 0.2);
}

/* Today styling - enhanced */
.logs-calendar-day.today {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.12), rgba(var(--bs-primary-rgb), 0.06));
    border-color: var(--bs-primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.logs-calendar-day.today .day-number {
    color: white;
    background: var(--bs-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    display: inline-block;
    width: fit-content;
    border-bottom: none;
    font-size: 0.9rem;
}

/* Other month styling */
.logs-calendar-day.other-month {
    opacity: 0.5;
}

.logs-calendar-day.other-month .day-number {
    color: var(--bs-secondary);
}

/* Badge container - default desktop/tablet layout */
.logs-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: auto;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}

/* Individual badges - desktop/tablet default */
.logs-badge {
    position: relative;
    min-width: 26px;
    height: 24px;
    border-radius: 0.375rem;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 0.4rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.logs-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.logs-badge i {
    font-size: 0.6rem;
    margin-right: 0.2rem;
}

/* Badge type colors - original colors preserved */
.log-recipe-badge {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    border: 0.1rem solid var(--bs-primary-border-subtle);
}

.log-snack-badge {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
    border: 0.1rem solid var(--bs-warning-border-subtle);
}

.log-quick-badge {
    background-color: var(--bs-lime-bg-subtle);
    color: var(--bs-lime);
    border: 0.1rem solid var(--bs-lime-border-subtle);
}

.log-drink-badge {
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info-text-emphasis);
    border: 0.1rem solid var(--bs-info-border-subtle);
}

.log-water-badge {
    background-color: var(--bs-sky-bg-subtle);
    color: var(--bs-sky-text-emphasis);
    border: 0.1rem solid var(--bs-sky-border-subtle);
}

/* Statistics container */
.stats-container {
    border-radius: 0.5rem;
    background: rgba(var(--bs-light-rgb), 0.3);
    padding: 0.75rem;
}

.stat-item {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(var(--bs-border-color-rgb), 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

/* Nutrition summary */
.nutrition-summary-month {
    background: rgba(var(--bs-light-rgb), 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

/* Modal styles */
#dayLogsModal .modal-content {
    border-radius: 10px;
    overflow: hidden;
}

#dayLogsModal .modal-header {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    border-bottom: none;
}

#dayLogsModal .modal-footer {
    border-top: none;
}

/* Day log cards in modal */
.day-log-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.1);
}

.day-log-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1) !important;
}

.day-log-card .card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Nutrition summary in cards */
.nutrition-summary {
    font-size: 0.85rem;
    background: rgba(var(--bs-light-rgb), 0.5);
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

/* Meal type headers */
.meal-type-header {
    position: relative;
    padding: 0.75rem;
    border-left: 4px solid var(--bs-primary);
    background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.1), transparent);
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--bs-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Large screens */
@media (min-width: 1200px) {
    .logs-calendar-day {
        min-height: 85px;
        max-height: 105px;
    }

    .logs-day-button {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .day-number {
        font-size: 1.05rem;
        padding-bottom: 0.25rem;
    }

    .logs-calendar-day.today .day-number {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }

    .logs-badge-container {
        gap: 0.3rem;
    }

    .logs-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.7rem;
        padding: 0 0.2rem;
    }

    .logs-badge i {
        font-size: 0.65rem;
        margin-right: 0.25rem;
    }
}

/* Desktop styles */
@media (min-width: 992px) and (max-width: 1199px) {
    .logs-calendar-day {
        min-height: 80px;
        max-height: 95px;
    }

    .logs-day-button {
        padding: 0.5rem;
        gap: 0.35rem;
    }

    .day-number {
        font-size: 1rem;
    }

    .logs-badge-container {
        gap: 0.25rem;
    }

    .logs-badge {
        min-width: 20px;
        height: 20px;
        font-size: 0.65rem;
        padding: 0 0.2rem;
    }

    .logs-badge i {
        font-size: 0.6rem;
    }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991px) {
    .logs-calendar-day {
        min-height: 70px;
        max-height: 88px;
    }

    .logs-day-button {
        padding: 0.4rem;
        gap: 0.3rem;
    }

    .day-number {
        font-size: 0.95rem;
        padding-bottom: 0.2rem;
    }

    .logs-calendar-day.today .day-number {
        padding: 0.22rem 0.45rem;
    }

    .logs-badge-container {
        gap: 0.22rem;
    }

    .logs-badge {
        min-width: 24px;
        height: 22px;
        font-size: 0.6rem;
        padding: 0 0.35rem;
    }

    .logs-badge i {
        font-size: 0.55rem;
        margin-right: 0.18rem;
    }

    .logs-weekday-header {
        font-size: 0.8rem;
        padding: 0.4rem 0.2rem;
    }
}

/* Mobile styles - NOTIFICATION BADGE DESIGN */
@media (max-width: 767px) {
    .logs-month-view {
        padding: 0.5rem;
        border-radius: 0.5rem;
        margin: 0.5rem 0;
    }

    .logs-weekdays,
    .logs-calendar-days {
        gap: 0.15rem;
    }

    .logs-calendar-day {
        min-height: 60px;
        max-height: auto;
    }

    .logs-day-button {
        padding: 0.35rem;
        gap: 0.25rem;
    }

    .day-number {
        font-size: 0.85rem;
        padding-bottom: 0.15rem;
    }

    .logs-calendar-day.today .day-number {
        padding: 0.18rem 0.38rem;
        font-size: 0.82rem;
    }

    .logs-weekday-header {
        font-size: 0.7rem;
        padding: 0.3rem 0.15rem;
    }

    /* Mobile badge container - allow wrapping on both sides */
    .logs-badge-container {
        gap: 0.2rem;
        justify-content: flex-start;
    }

    /* Mobile badge - icon with notification circle */
    .logs-badge {
        min-width: 26px;
        width: 26px;
        height: 26px;
        padding: 0;
        border-radius: 0.35rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .logs-badge i {
        font-size: 0.7rem;
        margin-right: 0;
    }

    /* Hide the text number on mobile, show only in notification badge */
    .logs-badge::after {
        content: attr(data-count);
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 14px;
        height: 14px;
        background: var(--bs-danger-bg-subtle);
        color: var(--bs-danger-text-emphasis);
        border-radius: 50%;
        font-size: 0.5rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        border: 1.5px solid var(--bs-body-bg);
    }

    .logs-month-header {
        padding: 0.5rem;
    }

    .logs-month-header h5 {
        font-size: 1.1rem;
    }

    .stats-container,
    .nutrition-summary-month {
        padding: 0.5rem;
    }

    .day-log-card .card-body {
        padding: 0.75rem;
    }

    .meal-type-header {
        padding: 0.5rem;
        font-size: 0.95rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .logs-month-view {
        padding: 0.35rem;
    }

    .logs-weekdays,
    .logs-calendar-days {
        gap: 0.12rem;
    }

    .logs-calendar-day {
        min-height: 55px;
    }

    .logs-day-button {
        padding: 0.3rem;
        gap: 0.22rem;
    }

    .day-number {
        font-size: 0.8rem;
        padding-bottom: 0.12rem;
    }

    .logs-calendar-day.today .day-number {
        padding: 0.15rem 0.32rem;
        font-size: 0.78rem;
    }

    .logs-weekday-header {
        font-size: 0.65rem;
        padding: 0.25rem 0.1rem;
    }

    .logs-badge-container {
        gap: 0.18rem;
    }

    /* Smaller notification badges for extra small screens */
    .logs-badge {
        min-width: 16px;
        width: 16px;
        height: 16px;
    }

    .logs-badge i {
        font-size: 0.65rem;
    }

    .logs-badge::after {
        min-width: 7px;
        height: 7px;
        font-size: 6px;
    }
}

/* Very small devices */
@media (max-width: 375px) {
    .logs-calendar-day {
        min-height: 50px;
    }

    .logs-day-button {
        padding: 0.28rem;
        gap: 0.2rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .logs-calendar-day.today .day-number {
        padding: 0.12rem 0.28rem;
        font-size: 0.72rem;
    }

    .logs-badge-container {
        gap: 0.15rem;
    }

    .logs-badge {
        min-width: 14px;
        width: 14px;
        height: 14px;
    }

    .logs-badge i {
        font-size: 0.45rem;
    }

    .logs-badge::after {
        min-width: 6px;
        height: 7px;
        font-size: 6px;
        border-width: 0.1px;
        padding: 0.1rem 0.15rem;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */

[data-bs-theme="dark"] .logs-month-view {
    background-color: var(--bs-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .logs-calendar-day {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .logs-calendar-day:hover {
    border-color: var(--bs-primary);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .logs-day-button:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
}

[data-bs-theme="dark"] .logs-weekday-header {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .day-log-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .day-log-card:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--bs-primary-rgb), 0.4);
}

[data-bs-theme="dark"] .nutrition-summary {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .stats-container,
[data-bs-theme="dark"] .nutrition-summary-month {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .logs-calendar-day.today {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.2), rgba(var(--bs-primary-rgb), 0.1));
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .logs-badge {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.day-log-card {
    animation: fadeInUp 0.3s ease-out;
}

.logs-calendar-day {
    animation: fadeInUp 0.2s ease-out;
}

/* Stagger animation for multiple items */
.day-log-card:nth-child(1) {
    animation-delay: 0.05s;
}

.day-log-card:nth-child(2) {
    animation-delay: 0.1s;
}

.day-log-card:nth-child(3) {
    animation-delay: 0.15s;
}

.day-log-card:nth-child(4) {
    animation-delay: 0.2s;
}

/* Accessibility improvements */
.logs-calendar-day:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    z-index: 10;
}

.day-log-card:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .day-log-card,
    .logs-calendar-day,
    .logs-badge {
        animation: none;
    }

    .day-log-card:hover,
    .logs-calendar-day:hover,
    .logs-badge:hover {
        transform: none;
    }
}

/* Smooth transitions for month view changes */
.logs-month-view {
    transition: all 0.2s ease-in-out;
}

/* Animation states */
.logs-month-view.fade-in {
    animation: fadeInUp 0.2s ease-in-out forwards;
}

.logs-month-view.fade-out {
    animation: fadeOutDown 0.2s ease-in-out forwards;
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Ensure smooth transitions don't interfere with other animations */
.logs-calendar-day {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* Disable transitions during month changes to prevent conflicts */
.logs-month-view.transitioning .logs-calendar-day {
    transition: none;
}

/* Loading state for smoother perceived performance */
.logs-calendar-container.loading {
    position: relative;
}

.logs-calendar-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bs-body-bg-rgb), 0.8);
    z-index: 10;
    pointer-events: none;
}

/* Badge subtle animation on calendar load */
@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logs-badge {
    animation: badgeFadeIn 0.3s ease-out backwards;
}

.logs-badge:nth-child(1) {
    animation-delay: 0.05s;
}

.logs-badge:nth-child(2) {
    animation-delay: 0.1s;
}

.logs-badge:nth-child(3) {
    animation-delay: 0.15s;
}

.logs-badge:nth-child(4) {
    animation-delay: 0.2s;
}

.logs-badge:nth-child(5) {
    animation-delay: 0.25s;
}

/* Mobile Slide-up Panel */
.mobile-day-logs-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-day-logs-panel.show {
    pointer-events: auto;
    opacity: 1;
}

.mobile-panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

[data-bs-theme="dark"] .mobile-panel-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.mobile-panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-height: 70vh;
    background: var(--bs-body-bg);
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-day-logs-panel.show .mobile-panel-content {
    transform: translateY(0);
}

.mobile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.mobile-panel-header h6 {
    font-weight: 600;
    color: var(--bs-body-color);
}

.mobile-panel-body {
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

/* Desktop Popover Styles */
.day-logs-popover {
    max-width: 500px;
    z-index: 10000 !important;
}

.day-logs-popover .popover-header {
    background-color: var(--bs-primary);
    color: white;
    font-weight: 600;
    border-bottom: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .day-logs-popover .popover-header {
    background-color: var(--bs-primary);
}

.day-logs-popover .popover-body {
    padding: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Common Content Styles */
.day-logs-content {
    width: 100%;
    padding: 0.5rem;
}

/* Compact Daily Summary */
.daily-summary-compact {
    padding: 0;
    flex-shrink: 0;
}

.summary-item {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.25rem;
    border-radius: 0.375rem;
    min-width: 0;
}

.summary-value {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.summary-label {
    font-size: 0.65rem;
    line-height: 1;
    opacity: 0.9;
}

/* Compact Logs List */
.logs-list-compact {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* For mobile panel, allow more space */
.mobile-panel-body .logs-list-compact {
    max-height: none;
}

.meal-section-compact {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0.5rem;
}

.meal-section-compact:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meal-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-item-compact {
    background: transparent;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.log-item-compact:last-child {
    margin-bottom: 0;
}

.log-title-compact {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-body-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.log-title-compact>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Log Icon Badge */
.log-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    flex-shrink: 0;
    border: 0.15px solid;
}

.badge-icon-primary-subtle {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.badge-icon-warning-subtle {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
}

.badge-icon-lime-subtle {
    background-color: #d4f4dd;
    color: #198754;
}

[data-bs-theme="dark"] .badge-icon-lime-subtle {
    background-color: rgba(25, 135, 84, 0.2);
    color: #75b798;
}

.badge-icon-info-subtle {
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info);
}

.log-time-badge {
    font-size: 0.7rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.log-notes-compact,
.log-amount-compact,
.log-serving-compact {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    line-height: 1.3;
}

.nutrition-badges-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Glass-style nutrition badges */
.nutri-badge-glass {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    white-space: nowrap;
    background: rgba(var(--bs-body-color-rgb), 0.05);
    border: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
    backdrop-filter: blur(10px);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .nutri-badge-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Color Classes */
.bg-calories {
    background-color: #f5a244 !important;
    color: #212529 !important;
}

.bg-protein {
    background-color: #7e80e5 !important;
    color: white !important;
}

.bg-carbs {
    background-color: #2aa6cf !important;
    color: white !important;
}

.bg-fat {
    background-color: #ffb907 !important;
    color: #212529 !important;
}

/* Popover z-index */
.popover {
    z-index: 10000 !important;
}

/* Scrollbar styling */
.logs-list-compact::-webkit-scrollbar,
.mobile-panel-body::-webkit-scrollbar {
    width: 4px;
}

.logs-list-compact::-webkit-scrollbar-track,
.mobile-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.logs-list-compact::-webkit-scrollbar-thumb,
.mobile-panel-body::-webkit-scrollbar-thumb {
    background: var(--bs-secondary-bg);
    border-radius: 2px;
}

.logs-list-compact::-webkit-scrollbar-thumb:hover,
.mobile-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color);
}

/* Mobile specific adjustments */
@media (max-width: 576px) {
    .mobile-panel-content {
        max-height: 80vh;
    }

    .summary-item {
        padding: 0.35rem 0.2rem;
    }

    .summary-value {
        font-size: 0.8rem;
    }

    .summary-label {
        font-size: 0.6rem;
    }

    .log-title-compact {
        font-size: 0.8rem;
    }

    .log-icon-badge {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 0.65rem;
    }

    .log-time-badge {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }

    .nutri-badge-glass {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
}

@media (max-width: 375px) {
    .summary-value {
        font-size: 0.75rem;
    }

    .summary-label {
        font-size: 0.55rem;
    }

    .log-title-compact {
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .log-icon-badge {
        width: 1.3rem;
        height: 1.3rem;
        font-size: 0.6rem;
    }

    .nutri-badge-glass {
        font-size: 0.6rem;
        padding: 0.12rem 0.35rem;
    }
}

/* Water Timeline Styles - More Natural Integration */
.water-summary-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .water-summary-section {
    background: transparent;
    border: none;
}

.water-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.water-summary-header h6 {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    margin: 0;
}

.water-summary-header h6 i {
    color: var(--bs-sky);
    font-size: 0.9rem;
}

.water-summary-header .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    background: var(--bs-sky-bg-subtle);
    color: var(--bs-sky-text-emphasis);
    border: 1px solid var(--bs-sky-border-subtle);
}

.water-timeline {
    position: relative;
    padding-left: 2rem;
    padding-top: 0.25rem;
}

/* Only show line when there are multiple items */
.water-timeline-item+.water-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.35rem;
    top: -6.5rem;
    width: 2px;
    height: calc(100% + 1rem);
    background: rgba(var(--bs-sky-rgb), 0.25);
    border-radius: 2px;
    z-index: 0;
}

.water-timeline-item {
    position: relative;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
}

.water-timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 2px;
    width: 20px;
    height: 20px;
    background: var(--bs-sky);
    border: 2px solid var(--bs-body-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(var(--bs-sky-rgb), 0.15);
}

.timeline-content {
    background: transparent;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 0.6rem;
    transition: all 0.2s ease;
}

.timeline-content:hover {
    border-color: rgba(var(--bs-sky-rgb), 0.4);
    background: var(--bs-sky-bg-subtle);
}

[data-bs-theme="dark"] .timeline-content:hover {
    background: rgba(var(--bs-sky-rgb), 0.08);
}

.timeline-header {
    margin-bottom: 0.6rem;
    padding-bottom: 0;
    border-bottom: none;
}

.water-amount-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    background: var(--bs-sky-bg-subtle);
    color: var(--bs-sky-text-emphasis);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--bs-sky-border-subtle);
}

.water-prop-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid var(--bs-border-color);
}

.temp-badge {
    background: var(--bs-amber-bg-subtle);
    color: var(--bs-amber-text-emphasis);
    border-color: var(--bs-amber-border-subtle);
}

.source-badge {
    background: var(--bs-sky-bg-subtle);
    color: var(--bs-sky-text-emphasis);
    border-color: var(--bs-sky-border-subtle);
}

.water-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--bs-emerald-bg-subtle);
    color: var(--bs-emerald-text-emphasis);
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--bs-emerald-border-subtle);
}

.timeline-times {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px dashed rgba(var(--bs-border-color-rgb), 0.4);
}

.timeline-times::before {
    display: none;
}

.time-point {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: none;
}

.time-point::before,
.time-point::after {
    display: none;
}

.time-point:hover {
    background: var(--bs-sky-bg-subtle);
    color: var(--bs-sky-text-emphasis);
    border-color: var(--bs-sky-border-subtle);
    transform: translateY(-2px);
}

.time-point i {
    font-size: 0.65rem;
    margin-right: 0.25rem;
    opacity: 0.7;
}

/* Mobile specific adjustments for water timeline */
@media (max-width: 576px) {
    .water-timeline {
        padding-left: 1.75rem;
    }

    .timeline-marker {
        left: -1.75rem;
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .water-timeline-item+.water-timeline-item::before {
        left: -1.25rem;
        top: -5.75rem;
    }

    .water-amount-badge {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .water-prop-badge,
    .water-count-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .time-point {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .timeline-content {
        padding: 0.5rem;
    }

    .timeline-header {
        margin-bottom: 0.5rem;
    }

    .timeline-times {
        gap: 0.35rem;
        padding-top: 0.4rem;
        margin-top: 0.4rem;
    }
}

@media (max-width: 375px) {
    .water-amount-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.45rem;
    }

    .water-prop-badge,
    .water-count-badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.35rem;
    }

    .time-point {
        padding: 0.2rem 0.45rem;
        font-size: 0.68rem;
    }

    .time-point i {
        font-size: 0.6rem;
    }
}