/* ---------- Base typography + smoothing ----------
   The MudTheme already declares Inter as the typography font family for MudText
   components, but plain HTML elements (h1/p/etc on the login page or in scoped
   inline styles) fall through to body, so we set it here too. */
html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    font-feature-settings: "cv11", "ss01", "ss03";
}

code, pre, kbd, samp {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .8125em;
}

/* Custom thin scrollbars — kanban columns + drawer feel less chunky. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .25);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .4);
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* ---------- MudBlazor input refinements ----------
   The default outlined input radius is 4px; bumping to 8px to match the rest
   of the app's rounded corners. */
.mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px;
}
.mud-button-root,
.mud-icon-button {
    border-radius: 8px;
}

/* Selection color follows brand instead of MudBlazor purple. */
::selection {
    background-color: rgba(28, 155, 216, .25);
    color: inherit;
}

/* ---------- AppBar / drawer chrome ----------
   Lives global (not scoped) because these rules target MudBlazor child
   components (MudAppBar, MudDrawer, MudLink) and Blazor's `::deep`
   selector doesn't reliably penetrate into those component subtrees. */
.atlas-appbar.mud-appbar {
    background-color: var(--mud-palette-appbar-background) !important;
    color: var(--mud-palette-appbar-text-primary) !important;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    backdrop-filter: saturate(180%) blur(8px);
    /* iOS safe-area: extend chrome under the notch / status bar so the
       PWA standalone display doesn't show a strip of system colour. */
    padding-top: env(safe-area-inset-top);
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
}

.atlas-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 4px;
    margin-right: 16px;
    color: inherit;
    user-select: none;
    flex-shrink: 0;
}
.atlas-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--mud-palette-primary);
}
.atlas-brand-mark svg {
    width: 28px;
    height: 28px;
    display: block;
    transition: transform .2s ease;
}
.atlas-brand:hover .atlas-brand-mark svg {
    transform: rotate(-4deg) scale(1.04);
}
.atlas-brand-wordmark {
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}
.atlas-brand-name {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--mud-palette-text-primary);
}
.atlas-brand-tag {
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    margin-top: 3px;
    white-space: nowrap;
}

.atlas-drawer.mud-drawer {
    background-color: var(--mud-palette-drawer-background) !important;
    border-right: 1px solid var(--mud-palette-lines-default);
    /* Match the safe-area pad so drawer content doesn't slip under the notch. */
    padding-top: env(safe-area-inset-top);
}

.atlas-main {
    background-color: var(--mud-palette-background) !important;
}
.atlas-page {
    max-width: 1440px;
    padding: 24px !important;
    padding-left: max(24px, env(safe-area-inset-left)) !important;
    padding-right: max(24px, env(safe-area-inset-right)) !important;
}

/* Inline search lives in the AppBar on tablet+; mobile uses the icon
   button to expand a search row. */
.atlas-search-inline {
    flex: 1 1 auto;
    max-width: 480px;
    display: flex;
    justify-content: center;
}
.atlas-search-toggle { display: none !important; }

.atlas-mobile-search {
    background: var(--mud-palette-appbar-background);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    padding: 8px 12px;
    position: sticky;
    top: 56px;
    z-index: 1099;
}

/* ---------- Mobile breakpoints (≤960px = MudBreakpoint.Md) ----------
   Below md the drawer is overlay (Variant.Responsive handles that), the
   tagline drops, the inline search collapses to an icon, page padding
   tightens, and we honour iOS safe-area on every gutter. */
@media (max-width: 959px) {
    .atlas-brand-tag { display: none; }
    .atlas-brand-name { font-size: 1rem; }
    .atlas-brand { margin-right: 8px; gap: 10px; }

    .atlas-search-inline { display: none; }
    .atlas-search-toggle { display: inline-flex !important; }

    .atlas-page {
        padding: 16px !important;
        padding-left: max(16px, env(safe-area-inset-left)) !important;
        padding-right: max(16px, env(safe-area-inset-right)) !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 480px) {
    /* Phones: hide wordmark too — only the mark survives. Saves room
       for the search/theme/logout buttons. */
    .atlas-brand-wordmark { display: none; }
    .atlas-brand { margin-right: 4px; }
    .atlas-page { padding: 12px !important; }
}

/* ---------- Default Blazor error styling ---------- */
h1:focus { outline: none; }

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLj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zYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}
