/* Tillägg ovanpå site.css (som är kopierad från Aberwyn). Nya stilar läggs här
   tills site.css städas upp område för område. */

/* Remsa som visar att man inte är på den skarpa sidan (Site:Banner). */
.env-banner {
    background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 12px, #fbbf24 12px, #fbbf24 24px);
    color: #1F2C3C;
    font-weight: 700;
    text-align: center;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 2px 8px;
}

.family-header-link {
    text-decoration: none;
}

.nav-list-horizontal li a.active {
    font-weight: 600;
}

.auth-user {
    display: block;
    padding: 8px 12px 4px;
    font-size: 13px;
    color: #64748b;
}

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}

    .auth-login-form input[type=text],
    .auth-login-form input[type=password] {
        padding: 6px;
        font-size: 14px;
    }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1F2C3C;
}

.dropdown-logout-button {
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
}

.access-denied {
    padding: 16px;
}

/* Inloggningssidan */
.login-page {
    max-width: 360px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

    .login-page h1 {
        margin-top: 0;
        font-size: 1.4em;
    }

    .login-page .auth-login-form {
        padding: 0;
    }

.login-error {
    color: #b91c1c;
    margin: 0 0 8px;
}

/* På mobil placeras dropdown-menyer fast under menyraden (ersätter JS-flytten i Aberwyn). */
@media (max-width: 768px) {
    .dropdown-menu {
        top: 100px;
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    color: #1F2C3C;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 100000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Adminsidan Logg (/admin/logs) */
.log-page {
    max-width: 1400px;
    margin: 16px auto;
    padding: 0 12px;
}

.log-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .log-header h1 {
        margin: 0;
        font-size: 1.4em;
    }

.log-debug,
.log-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.log-debug {
    padding: 6px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #1F2C3C;
}

    .log-debug.on {
        background: #fef3c7;
        color: #92400e;
        font-weight: 600;
    }

.log-filters {
    margin: 12px 0;
}

    .log-filters select,
    .log-filters input[type=search] {
        padding: 6px;
        font-size: 14px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
    }

    .log-filters input[type=search] {
        flex: 1 1 240px;
    }

.log-btn {
    padding: 5px 10px;
    font: inherit;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

    .log-btn:hover {
        background: #e2e8f0;
    }

.log-check {
    display: flex;
    align-items: center;
    gap: 4px;
}

.log-count,
.log-empty {
    color: #64748b;
    font-size: 13px;
}

.log-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .log-table th {
        text-align: left;
        padding: 6px 8px;
        background: #1F2C3C;
        color: #fff;
        font-weight: 600;
        position: sticky;
        top: 0;
    }

    .log-table td {
        padding: 4px 8px;
        border-top: 1px solid #e2e8f0;
        vertical-align: top;
    }

.log-row {
    cursor: pointer;
}

    .log-row:hover {
        background: #f8fafc;
    }

.log-time,
.log-cat {
    white-space: nowrap;
    color: #64748b;
}

.log-time {
    font-variant-numeric: tabular-nums;
}

.log-msg {
    word-break: break-word;
}

.log-level {
    display: inline-block;
    min-width: 52px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    background: #e2e8f0;
    color: #334155;
}

.lvl-trace .log-level,
.lvl-debug .log-level { background: #f1f5f9; color: #64748b; }
.lvl-information .log-level { background: #dbeafe; color: #1e40af; }
.lvl-warning .log-level { background: #fef3c7; color: #92400e; }
.lvl-error .log-level,
.lvl-critical .log-level { background: #fee2e2; color: #b91c1c; }
.lvl-error,
.lvl-critical { background: #fff7f7; }
.lvl-debug .log-msg,
.lvl-trace .log-msg { color: #64748b; }

.log-msg .fa-triangle-exclamation {
    color: #b91c1c;
    margin-right: 4px;
}

.log-details td {
    background: #f8fafc;
    padding: 10px 12px;
}

.log-details dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 2px 12px;
    margin: 0 0 8px;
}

.log-details dt {
    color: #64748b;
}

.log-details dd {
    margin: 0;
    word-break: break-all;
}

.log-details pre {
    margin: 6px 0 0;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
}

    .log-details pre.log-exception {
        color: #b91c1c;
    }

@media (max-width: 768px) {
    .log-col-user,
    .log-col-page,
    .log-cat {
        display: none;
    }
}

/* ==========================================================================
   Veckomeny (/menu), efter Aberwyns menu.css
   ========================================================================== */

/* Platshållare medan data hämtas. */
.skeleton {
    background-color: rgba(113, 128, 150, 0.25);
    border-radius: 6px;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    50% { opacity: 0.45; }
}

.menu-error {
    color: #E53E3E;
}

.menu-page {
    /* Tema: följer systemet tills användaren väljer med knappen (data-theme). */
    color-scheme: light dark;
    --menu-bg: light-dark(#F9FAFB, #1F2C3C);
    --menu-bg-mid: light-dark(#EDF2F7, #2E3C4F);
    --menu-text: light-dark(#2D3748, #E0E6ED);
    --menu-accent: #3182CE;
    --menu-heading: light-dark(#3182CE, #cef8fe);
    --menu-card: light-dark(#ffffff, #2A3A48);
    --menu-faint: light-dark(#718096, #A0AAB5);
    --menu-subtle: light-dark(#4A5568, #D0DCE4);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    color: var(--menu-text);
    background: radial-gradient(circle at center, var(--menu-bg-mid), var(--menu-bg) 80%);
    border-radius: 0 0 10px 10px;
}

.menu-page[data-theme="light"] { color-scheme: light; }
.menu-page[data-theme="dark"] { color-scheme: dark; }

.menu-page > :not(.wish-button, .wish-flyout) {
    width: 100%;
    max-width: 960px;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

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

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

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

.menu-week-picker {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--menu-subtle);
}

.menu-week-picker button {
    background: var(--menu-accent);
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    font-size: 0.9rem;
}

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

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

.menu-day-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--menu-heading);
    margin-bottom: 10px;
}

.menu-day-header::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    margin: 1px auto 0;
    background: var(--menu-accent);
    border-radius: 2px;
}

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

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

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

.skeleton-line {
    display: inline-block;
    width: 40%;
    height: 1em;
}

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

.menu-cards {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1024px) {
    .menu-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .menu-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.menu-card,
.school-card {
    position: relative;
    height: 160px;
    color: #fff;
    background-color: #4A5568;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.menu-card {
    display: flex;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.menu-card[href]:hover {
    transform: scale(1.02);
    color: #fff;
}

.menu-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card-content {
    position: relative;
    width: 100%;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    overflow: hidden;
}

.menu-card-day {
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 0 1px 7px #000;
    margin-bottom: 6px;
    white-space: nowrap;
}

.menu-card-meal {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 2px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.7), 0 1px 10px #000;
    overflow-wrap: anywhere;
}

/* Skolmat */
.school-meals {
    margin-top: 16px;
}

.school-meal-title {
    display: block;
    width: 100%;
    margin: 4px 0 8px;
    padding: 4px 0;
    background: none;
    border: none;
    color: var(--menu-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.school-chevron {
    display: inline-block;
    transition: transform 0.3s ease;
    transform: rotate(-90deg);
}

.school-chevron.open {
    transform: rotate(0deg);
}

.school-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    text-align: center;
    overflow-y: auto;
}

.school-card-day {
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.school-card-dish {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

/* Önska mat */
.wish-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--menu-accent);
    color: #fff;
    font-size: 28px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.wish-button:hover {
    background-color: #2B6CB0;
}

.wish-flyout {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
    background-color: var(--menu-card);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 12px;
    z-index: 1001;
}

.wish-flyout form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wish-flyout h3 {
    margin: 0;
}

.wish-flyout label {
    font-weight: bold;
}

.wish-flyout input,
.wish-flyout textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font: inherit;
    font-size: 0.9rem;
}

.wish-flyout textarea {
    resize: vertical;
    min-height: 60px;
}

.wish-submit {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--menu-accent);
    color: #fff;
    cursor: pointer;
}

.wish-matches {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.wish-matches button {
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wish-matches button:hover {
    background-color: var(--menu-accent);
    color: #fff;
}

.wish-message {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   Planera veckomeny (/menu/plan), efter Aberwyns Veckomeny.css
   ========================================================================== */
.plan-page {
    padding: 12px 16px;
    color: #2D3748;
}

.plan-page h1 {
    font-size: 1.5rem;
}

.plan-page h2 {
    font-size: 1.2rem;
}

.plan-columns {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.plan-editor {
    flex: 2;
    min-width: 0;
}

.plan-wishes {
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}

.plan-week-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.plan-week-nav a {
    color: #3182CE;
    font-weight: bold;
    text-decoration: none;
}

.plan-week-nav a:hover {
    text-decoration: underline;
}

.plan-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 0.9rem;
}

.plan-table th {
    background: #EDF2F7;
    padding: 8px 12px;
    text-align: left;
}

.plan-table td {
    background: #fff;
    padding: 8px 12px;
    vertical-align: top;
}

.plan-table .plan-day {
    width: 1%;
    white-space: nowrap;
    font-weight: bold;
}

.plan-table .plan-cook {
    width: 25%;
}

.plan-expand {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-right: 6px;
}

.plan-expand i {
    transition: transform 0.2s ease;
}

.plan-expand.open i {
    transform: rotate(90deg);
}

.plan-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-extra .plan-input-group + .plan-input-group {
    margin-top: 8px;
}

.plan-extra label {
    min-width: 60px;
    font-size: 0.85rem;
    color: #718096;
}

.plan-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #F7FAFC;
    border: 1px solid #CBD5E0;
    color: #2D3748;
    border-radius: 8px;
    padding: 6px;
    font-size: 0.85rem;
}

.plan-clear {
    background: none;
    border: none;
    color: #E53E3E;
    cursor: pointer;
    padding: 0 4px;
    font-size: 1rem;
}

.plan-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-save {
    background: #3182CE;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
}

.plan-save:hover {
    background: #2B6CB0;
}

.plan-save:disabled {
    opacity: 0.6;
    cursor: default;
}

.plan-saved {
    color: #38A169;
}

.plan-skeleton-row {
    height: 44px;
    margin-bottom: 6px;
}

.plan-skeleton-card {
    height: 110px;
}

.wish-card {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wish-card strong {
    display: block;
    font-size: 1.05rem;
}

.wish-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #444;
    overflow-wrap: anywhere;
}

.wish-meta {
    display: block;
    font-size: 0.85rem;
    color: #666;
}

.wish-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wish-actions button {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #fff;
}

.wish-actions .wish-import { background: #22c55e; }
.wish-actions .wish-import:hover { background: #16a34a; }
.wish-actions .wish-archive { background: #f87171; }
.wish-actions .wish-archive:hover { background: #dc2626; }

.plan-history {
    margin-top: 24px;
}

.plan-history-wrap {
    overflow-x: auto;
}

.plan-history table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.plan-history th,
.plan-history td {
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #CBD5E0;
    background: #fff;
}

.plan-history th {
    background: #EDF2F7;
}

.plan-highlight {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    color: #fff;
    background: linear-gradient(270deg, #ff6ec4, #7873f5, #4ade80, #facc15, #f87171);
    background-size: 1000% 1000%;
    animation: plan-rainbow 6s linear infinite;
}

@keyframes plan-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
    .plan-page { padding: 8px; }
    .plan-columns { flex-direction: column; gap: 1rem; }
    .plan-editor, .plan-wishes { width: 100%; max-width: none; }
    .plan-table th, .plan-table td { padding: 6px; font-size: 0.8rem; }
    .plan-extra label { min-width: 50px; }
}
