/* ============================================================================
   WOW1.5 — "Plan my week" dashboard widget.

   Separation here is done with tinted surfaces and spacing only: no top or left
   accent rules anywhere, and no gradients (the app's cards are glass, not gradient).
   Every colour resolves through a Bootstrap theme variable so the widget follows
   light/dark without a second palette.
   ========================================================================== */

.pmw-card {
    overflow: visible;
}

.pmw-card .card-body {
    padding: 1.5rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.pmw-mark {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}

.pmw-mark .mdi {
    font-size: 1.6rem;
    line-height: 1;
}

.pmw-title {
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    margin-bottom: 0.1rem;
}

.pmw-sub {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
}

/* The date range reads as metadata, so it gets a quiet pill rather than a heading. */
.pmw-window {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Idle state ───────────────────────────────────────────────────────────── */

.pmw-cta {
    font-size: 1.02rem;
    font-weight: 600;
    padding: 0.7rem 1.6rem;
    border-radius: 0.85rem;
}

.pmw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pmw-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
}

/* ── Week strip ───────────────────────────────────────────────────────────── */

.pmw-week {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 0.6rem;
}

.pmw-day {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.9rem;
    padding: 0.7rem 0.75rem;
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pmw-day-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.pmw-meal {
    font-size: 0.8rem;
    line-height: 1.25;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pmw-meal-slot {
    display: block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bs-secondary-color);
}

/* ── Stat tiles ───────────────────────────────────────────────────────────── */

.pmw-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.6rem;
}

.pmw-stat {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
}

.pmw-stat-value {
    font-size: 1.35rem;
    font-weight: 680;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--bs-emphasis-color);
}

.pmw-stat-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
}

.pmw-stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-top: 0.2rem;
}

/* The saving is the whole promise of cooking once — it gets the one accent. */
.pmw-stat-accent {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.pmw-stat-accent .pmw-stat-value,
.pmw-stat-accent .pmw-stat-label {
    color: var(--bs-primary);
}

/* ── Dish row ─────────────────────────────────────────────────────────────── */

.pmw-dishes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pmw-dish {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: 999px;
    background-color: var(--bs-secondary-bg);
    font-size: 0.85rem;
    max-width: 100%;
}

.pmw-dish img,
.pmw-dish .pmw-dish-fallback {
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 1.75rem;
    border-radius: 999px;
    object-fit: cover;
}

.pmw-dish .pmw-dish-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

.pmw-dish-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 12rem;
}

.pmw-dish-count {
    color: var(--bs-secondary-color);
    font-variant-numeric: tabular-nums;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.pmw-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
}

.pmw-note-warning {
    background-color: rgba(var(--bs-warning-rgb), 0.14);
    color: var(--bs-warning-text-emphasis);
}

/* ── Loading ──────────────────────────────────────────────────────────────── */

.pmw-skeleton {
    border-radius: 0.9rem;
    background-color: var(--bs-tertiary-bg);
    animation: pmw-pulse 1.4s ease-in-out infinite;
}

@keyframes pmw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .pmw-skeleton {
        animation: none;
    }
}

@media (max-width: 575.98px) {
    .pmw-card .card-body {
        padding: 1.15rem;
    }

    .pmw-cta {
        width: 100%;
        justify-content: center;
    }
}
