/* ─── Mobile-First Foundation ─────────────────────────────── */

html, body {
    overflow-x: hidden;
    /* Prevent iOS font inflation */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Remove tap flash on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Blazor validation */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

h1:focus { outline: none; }

/* ─── Touch Targets ───────────────────────────────────────── */
/* WCAG 2.5.5: minimum 44×44px interactive target */
.mud-button-root {
    min-height: 44px;
}

.mud-icon-button {
    min-width: 44px !important;
    min-height: 44px !important;
}

/* Nav links in the drawer: generous tap target */
.mud-nav-link {
    min-height: 48px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* ─── App Bar ─────────────────────────────────────────────── */
.mrff-appbar-logo {
    height: clamp(32px, 7vw, 44px);
    width: auto;
}

/* ─── Content Wrapper ─────────────────────────────────────── */
.content {
    padding-top: 12px;
}

/* Mobile: add bottom padding so content clears the bottom nav */
.mrff-content-wrap {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 960px) {
    .mrff-content-wrap {
        padding-bottom: 16px;
    }
}

/* ─── Bottom Navigation Bar (mobile only) ─────────────────── */
.mrff-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background-color: var(--mud-palette-surface);
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1200;
    /* iOS home indicator safe area */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(56px + env(safe-area-inset-bottom, 0px));
}

.mrff-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    color: var(--mud-palette-text-secondary);
    text-decoration: none !important;
    transition: color 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
    user-select: none;
    border-radius: 0;
}

.mrff-bottom-nav__item:active {
    background-color: rgba(39, 93, 56, 0.08);
}

.mrff-bottom-nav__item.active {
    color: var(--mud-palette-primary) !important;
}

.mrff-bottom-nav__icon {
    font-size: 22px !important;
    transition: transform 0.15s ease;
}

.mrff-bottom-nav__item.active .mrff-bottom-nav__icon {
    transform: scale(1.1);
}

.mrff-bottom-nav__label {
    font-size: 0.67rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Hide bottom nav on desktop (drawer takes over) */
@media (min-width: 960px) {
    .mrff-bottom-nav {
        display: none;
    }
}

/* ─── Responsive Content Padding ─────────────────────────── */
@media (max-width: 599px) {
    /* Tighter horizontal padding on phones */
    .px-4 {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* ─── Blazor Error UI ─────────────────────────────────────── */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}
