:root {
    --bg: #F9FAFB;
    --bg-mid: #EDF2F7;
    --text: #2D3748;
    --accent: #3182CE;
    --card-bg: #ffffff;
    --border-radius: 6px;
    --spacing: 12px;
    --font-size: 0.9rem;
    --faint-text: #718096;
    --subtle-text: #4A5568;
}

[data-theme="dark"] {
    --bg: #1F2C3C;
    --bg-mid: #2E3C4F;
    --text: #E0E6ED;
    --accent: #3182CE;
    --card-bg: #2A3A48;
    --faint-text: #A0AAB5;
    --subtle-text: #D0DCE4;
}
    [data-theme="dark"] h1,
    [data-theme="dark"] .day-header {
        color: #cef8fe; /* Ljusare blå för bättre kontrast */
        font-weight: 700;
    }
    [data-theme="dark"] .menu-header h1 {
        color: #cef8fe; /* ljuslila i mörkt läge */
    }
body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.meal-menu-page {
    position: relative;
    padding: var(--spacing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at center, var(--bg-mid), var(--bg) 80%);
}

    .meal-menu-page > * {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 960px;
    }

h1 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing);
    text-align: center;
    color: var(--accent);
}

.date-picker {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing);
    font-size: var(--font-size);
    color: var(--subtle-text);
}

    .date-picker button {
        background: var(--accent);
        border: none;
        padding: 0.3rem 0.8rem;
        border-radius: var(--border-radius);
        cursor: pointer;
        font-weight: bold;
        color: #ffffff;
        transition: background 0.2s ease;
        font-size: 0.9rem;
    }

        .date-picker button:hover {
            background: #2B6CB0;
        }

.view-selector {
    position: absolute;
    top: var(--spacing);
    right: var(--spacing);
    display: flex;
    align-items: center;
    gap: 4px;
}

    .view-selector select {
        display: none;
    }

    .view-selector .toggle-view-btn,
    .view-selector .theme-toggle-btn {
        background: none;
        border: none;
        color: var(--text);
        font-size: 1rem;
        padding: 4px;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.2s;
    }

        .view-selector .toggle-view-btn:hover,
        .view-selector .theme-toggle-btn:hover {
            background-color: rgba(0, 0, 0, 0.1);
        }

.list-view .day-item {
    background: var(--card-bg);
    margin-bottom: 10px;
    padding: 10px;
    border-radius: var(--border-radius);
    text-align: center;
}

.day-header {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 4px;
    position: relative;
    text-align: center;
}

    .day-header::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: var(--accent);
        border-radius: 2px;
    }

.meal-selection {
    margin: 2px 0;
    font-size: 0.9rem;
}

    .meal-selection a {
        color: var(--text);
        text-decoration: none;
    }

        .meal-selection a:hover {
            text-decoration: underline;
        }

.not-assigned {
    color: var(--faint-text);
    font-style: italic;
    font-size: 0.85rem;
}

.card-view .card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--spacing);
    width: 100%;
}

.meal-card {
    position: relative;
    height: 160px;
    width: 100%;
    color: #fff;
    max-height: 200px;
    background-color: #4A5568; /* fallback-bakgrund */
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: stretch;
}

    .meal-card:hover {
        transform: scale(1.02);
    }

    .meal-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(49, 130, 206, 0.3), rgba(0, 0, 0, 0.7), transparent);
        pointer-events: none;
        transition: opacity 0.3s ease;
        opacity: 1;
    }

    .meal-card[data-has-image="true"]::before {
        opacity: 0;
    }

.card-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    text-align: center;
    box-sizing: border-box;
}

    .card-content .day {
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-content .meal {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 2px;
        word-break: break-word;
    }
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 960px;
    margin-bottom: var(--spacing);
}

    .menu-header h1 {
        font-size: 1.5rem;
        color: var(--accent);
        margin: 0;
    }

.top-buttons {
    display: flex;
    gap: 8px;
}

    .top-buttons button {
        background: none;
        border: none;
        color: var(--text);
        font-size: 1.2rem;
        padding: 6px;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.2s;
    }

        .top-buttons button:hover {
            background-color: rgba(0, 0, 0, 0.1);
        }

