/* ══════════════════════════════════════════════════ */
/* ══  APP.CSS - Globale basis-styles              ══ */
/* ══  Layout, navigation, sidebar og delte        ══ */
/* ══  UI-elementer på tværs af applikationen      ══ */
/* ══                                              ══ */
/* ══  Se wwwroot/css/ for:                        ══ */
/* ══    tokens.css             - CSS-variabler    ══ */
/* ══    mudblazor-overrides.css - .mud-* regler   ══ */
/* ══    utilities.css          - hjælpeklasser    ══ */
/* ══════════════════════════════════════════════════ */

/* ── Home Brand Font ── */
@font-face {
    font-family: 'Home';
    src: url('/assets/Home_woff_230303/Home-Thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home';
    src: url('/assets/Home_woff_230303/Home-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home';
    src: url('/assets/Home_woff_230303/Home-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home';
    src: url('/assets/Home_woff_230303/Home-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home';
    src: url('/assets/Home_woff_230303/Home-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home Condensed';
    src: url('/assets/Home_woff_230303/Home-LightCondensed.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home Condensed';
    src: url('/assets/Home_woff_230303/Home-RegularCondensed.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Home Condensed';
    src: url('/assets/Home_woff_230303/Home-BoldCondensed.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Page transition ── */
/* Opacity-only on purpose — NO transform. This wrapper wraps all page @Body content
   in MainLayout, and ANY transform on it (even a filled translateY(0) via
   animation-fill-mode:both, or a transform still filling/animating) makes it a
   containing block for position:fixed descendants. That trapped every fixed dropdown
   backdrop/overlay (pill-select butik-vælger, agent picker, …) inside the content box
   instead of the viewport, so clicking the empty area outside the content failed to
   close them. Keeping the fade purely opacity-based avoids the containing block
   entirely. */
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fade-in {
    animation: fade-in 200ms ease-out both;
}

/* ── Base layout ── */
.main-content {
    padding: 0;
    background-color: #FAFAFA;
    min-height: 100vh;
}




/* ── Activity feed item ── */
.activity-item {
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.activity-item:hover {
    background-color: var(--mud-palette-surface);
}

.activity-item:last-child {
    border-bottom: none !important;
}


.quick-action-item {
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 16px !important;
}

.quick-action-item:hover {
    background-color: var(--mud-palette-surface);
}


/* ══════════════════════════════════════════════════ */
/* ══  LAYOUT (fra layout/main-layout.css)         ══ */
/* ══  Samlet her for at reducere antal CSS-filer  ══ */
/* ══════════════════════════════════════════════════ */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    background: var(--mud-palette-background-grey);
}

.inline-toolbar {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 12px;
    background: #FAFAFA;
}

/* The module create button is a MudButton, so its root has no scope attribute and
   AppTopbar.razor.css cannot reach it; the rules that used to sit there (dead) live here instead. */
.inline-toolbar .topbar-primary-btn {
    flex-shrink: 0;
    margin-left: 8px;
    white-space: nowrap;
}

@media (max-width: 599px) {
    .inline-toolbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .inline-toolbar .topbar-primary-btn {
        min-height: 44px;
        /* !important: MudBlazor sets the size-small padding with higher specificity. */
        padding: 6px 12px !important;
        margin-left: 0;
        border-radius: var(--radius-md);
    }
}

@media (min-width: 960px) {
    .topbar-hamburger {
        display: none !important;
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu .avatar {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-menu .avatar:hover {
    transform: scale(1.1);
}

.sidebar-logo {
    height: 25px;
    width: auto;
}

.topbar-dropdown-scroll {
    max-height: 320px;
    overflow-y: auto;
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--mud-palette-error-lighten);
    border-top: 3px solid var(--mud-palette-primary-lighten);
    bottom: 0;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    font-size: var(--mud-typography-h3-size);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

/* MudBlazor dialog portals render outside component scope: sizing must be global */
.mud-dialog.ba-dialog {
    max-width: 99vw !important;
    width: 99vw !important;
    max-height: 97vh !important;
    height: 97vh !important;
}

.mud-dialog.ba-dialog .mud-dialog-content {    
    overflow: hidden !important;
    flex: 1;
}

/* Phones stack the three columns (BookAftalDialog.razor.css), so the content must scroll. */
@media (max-width: 599px) {
    .mud-dialog.ba-dialog .mud-dialog-content {
        overflow-y: auto !important;
    }
}

.mud-dialog.ba-dialog .mud-dialog-actions {
    padding: 10px 24px 16px !important;
    gap: 8px;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-root {
    text-transform: none !important;
    font-size: var(--mud-typography-body1-size) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    border-radius: 10px !important;
    min-height: 38px !important;
    padding: 0 20px !important;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-outlined.mud-button-default {
    border-color: var(--color-border-card) !important;
    color: var(--color-text-body) !important;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-outlined.mud-button-default:hover {
    border-color: var(--color-text-primary) !important;
    background: var(--color-bg-subtle) !important;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-outlined.mud-button-error {
    border-color: var(--color-border-card) !important;
    color: var(--color-text-secondary) !important;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-outlined.mud-button-error:hover {
    border-color: var(--mud-palette-error) !important;
    color: var(--mud-palette-error) !important;
    background: var(--mud-palette-error-lighten) !important;
}

.mud-dialog.ba-dialog .mud-dialog-actions .mud-button-filled.mud-button-primary {
    border-radius: 10px !important;
    font-size: var(--mud-typography-body1-size) !important;
    font-weight: 700 !important;
}

.mud-dialog.ba-dialog .mud-dialog-content {
    padding-top: 0 !important;
    padding-bottom: 8px !important;
}

@media (max-width: 599px) {
    /* Up to six action buttons: a two-column grid instead of one squeezed row. The primary button
       spans both columns at the bottom; an odd trailing secondary button spans them too. Placed after the
       desktop rules above so equal-specificity declarations here win. */
    .mud-dialog.ba-dialog .mud-dialog-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px 16px 16px !important;
    }

    .mud-dialog.ba-dialog .mud-dialog-actions .mud-button-root {
        width: 100%;
        min-height: 44px !important;
        padding: 0 12px !important;
        white-space: nowrap;
    }

    .mud-dialog.ba-dialog .mud-dialog-actions .mud-button-filled-primary {
        grid-column: 1 / -1;
    }

    .mud-dialog.ba-dialog .mud-dialog-actions .mud-button-root:nth-last-child(2):nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.ba-status-popover .mud-list,
.ba-kunde-popover .mud-list {
    border: 1px solid var(--mud-palette-divider) !important;
    border-radius: 8px !important;
    background-color: var(--mud-palette-background) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* ── DAWA address autocomplete popover ──────────────────── */
.address-input-popover {
    border: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    border-radius: 6px;
    background-color: var(--mud-palette-background, #ffffff) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.address-input-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-background, #ffffff);
}

.address-input-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default, #f0f0f0);
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.address-input-item:last-child {
    border-bottom: 0;
}

.address-input-item:hover,
.address-input-item:focus {
    background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.04));
    outline: none;
}

.address-input-item-main {
    font-size: var(--mud-typography-body1-size);
    color: var(--mud-palette-text-primary, inherit);
}

.address-input-item-meta {
    font-size: var(--mud-typography-caption-size);
    color: var(--mud-palette-text-secondary, #64748b);
    margin-top: 2px;
}


/* ── Print: hide app chrome so component-level @media print can flow ── */
/* Used by MarkedsIntelligens (Boligsiden card) - window.print() renders
   only the card itself, no sidebar, topbar, banner or action buttons. */
@media print {
    .mud-drawer,
    .mud-appbar,
    .announcement-banner,
    .inline-toolbar,
    #blazor-error-ui,
    .mud-snackbar-provider {
        display: none !important;
    }

    .mud-main-content,
    .main-content {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    body {
        background: white !important;
    }
}



/* ── Leads: sortable column headers ── */
.leads-th-sortable {
    cursor: pointer !important;
    user-select: none;
    white-space: nowrap;
}

.leads-th-sortable:hover {
    color: var(--mud-palette-text-primary) !important;
}

.leads-sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    font-size: 14px;
    vertical-align: middle;
    line-height: 1;
    color: var(--mud-palette-text-disabled);
}

.leads-sort-icon .mud-icon-root {
    font-size: 13px !important;
    width: 13px !important;
    height: 13px !important;
}

.leads-sort-icon--active {
    color: var(--color-brand) !important;
}
