/* Daily Log Styles */
.log-sticky {
    position: sticky;
    top: 48px;
    z-index: 10;
    background: var(--bg);
    padding-top: 4px;
    padding-bottom: 2px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.log-header .btn-icon { font-size: 18px; padding: 4px; }

#log-date {
    width: auto;
    flex-shrink: 0;
    padding: 4px 6px;
    font-size: 13px;
}

#log-date-label {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    color: var(--text);
}

/* Progress bar */
.progress-container {
    background: var(--bg-input);
    border-radius: 8px;
    height: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 8px;
    background: #10b981;
    transition: width 0.5s ease;
}

.progress-fill.near { background: #f59e0b; }
.progress-fill.over { background: #ef4444; }

/* Total calories */
.log-total {
    text-align: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-dim);
}

.total-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.log-total.over .total-num { color: #ef4444; }
.log-total.near .total-num { color: #f59e0b; }

.total-goal { color: var(--text-dim); }
.total-pct { font-weight: 600; }

/* Meal group headers */
.meal-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 2px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.meal-group-header:first-child {
    margin-top: 0;
}

.meal-group-cal {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: none;
    letter-spacing: 0;
}

/* Log entries */
.log-entry {
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 8px 10px 4px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}

.entry-main {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.entry-source { font-size: 16px; }

.entry-name {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
    color: var(--text);
}

.entry-time {
    color: var(--text-dim);
    font-size: 12px;
    flex-shrink: 0;
}

.entry-details-spacer {
    flex: 1;
}

.btn-save-fav {
    font-size: 22px !important;
    opacity: 0.4;
}

.btn-save-fav:hover {
    opacity: 1;
}

.btn-save-fav.is-fav {
    opacity: 1;
    color: #f59e0b;
}

.entry-details {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 22px;
    font-size: 12px;
}

.entry-calories {
    font-weight: 600;
    color: var(--accent);
}

.entry-macro { color: var(--text-dim); }

/* Make log entries tappable */
.log-entry { cursor: pointer; transition: border-color 0.2s; }
.log-entry:active { border-color: var(--border-strong); }

/* Entry Detail Modal */
.detail-cal-section {
    text-align: center;
    padding: 16px 0;
}

.detail-cal-big {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.detail-cal-label {
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Macro bars */
.macro-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.macro-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.macro-label {
    width: 60px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.macro-bar {
    flex: 1;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
    min-width: 0;
}

.macro-fill-protein { background: #3b82f6; }
.macro-fill-carbs { background: #f59e0b; }
.macro-fill-fat { background: #ef4444; }

.macro-val {
    width: 42px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* Detail meta */
.detail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}

.detail-meal-select {
    margin-left: auto;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
}

/* Detail items breakdown */
.detail-items-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.detail-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.detail-item-cal {
    color: var(--text-dim);
}

/* Detail actions */
.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Combo favorites */
.fav-combo-badge {
    font-size: 11px;
    background: var(--btn-bg);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 400;
}

.fav-combo-items {
    padding: 4px 0 4px 8px;
    border-left: 2px solid var(--border-strong);
    margin: 4px 0 4px 4px;
}

.fav-combo-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding: 2px 0;
}

.fav-combo-item-cal {
    color: var(--text-dim);
    flex-shrink: 0;
    margin-left: 8px;
}

/* Combo creation modal */
.combo-item-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: var(--bg-elevated);
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}

.combo-item-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}

.combo-item-info {
    font-size: 12px;
    color: var(--text-dim);
    margin-right: 8px;
}

.combo-item-remove {
    font-size: 14px !important;
    opacity: 0.4;
    padding: 0 4px;
}

.combo-item-remove:hover {
    opacity: 1;
    color: #ef4444;
}
