@import "https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css";
@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css";

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

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

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

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxN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error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
/* Reserved space for the validation message of a field (see Components/FieldError.razor). */
.field-error {
    min-height: 1.5rem;
    font-size: 0.85rem;
}

/* A disabled brand button (e.g. "Confirm booking" before accepting the terms) stays visible, only faded. */
.button.brand-bg[disabled] {
    background-color: #c87a55 !important;
    color: #fff !important;
    opacity: 0.5;
}

/* Small grey texts of the booking forms (home page and room page) were too light to read. */
.booking-bar .has-text-grey,
.booking-widget .has-text-grey {
    color: #4a4a4a !important;
}

.booking-widget input::placeholder {
    color: #6b6b6b;
}

/* Printing (admin booking list and details): only the content, without menu, footer and buttons. */
/* Only on paper (e.g. the heading of the printed booking matrix). */
.print-only {
    display: none;
}

/* The printed booking matrix (wall planning): A4 landscape, so a month of rooms by days fits the width of the sheet.
   A named page, so the other printouts (bill, booking) stay portrait. The rest of its print styles: Calendar.razor.css. */
@page planning {
    size: A4 landscape;
    margin: 8mm;
}

@media print {
    header, footer, .no-print, .admin-sidebar, #blazor-error-ui {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .calendar-print, #print-heading {
        page: planning;
    }

    .calendar-print {
        overflow: visible !important;
    }

    .section {
        padding: 0;
    }

    /* Keep the colours of the status tags, so "Cancelled" stays visible on paper. */
    .tag, .notification {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---------- Brand colour (also used outside the pages that define it) ---------- */
.brand-text {
    color: #c87a55;
}

.button.brand-bg,
.button.brand-bg:hover {
    background-color: #c87a55;
    border-color: transparent;
    color: #fff;
}

/* ---------- Preferences of the visitor (gear menu: Layout/SettingsMenu.razor, js/displayPreference.js) ---------- */
/* Text size: Bulma sizes everything in rem, so a bigger root scales the whole page. */
html[data-text-size="large"] {
    font-size: 112.5%;
}

html[data-text-size="larger"] {
    font-size: 125%;
}

.site-settings-slot {
    display: flex;
    align-items: center;
    padding-inline: 0.5rem;
}

.button.is-ghost.site-settings-toggle,
.button.is-ghost.site-settings-toggle:hover {
    color: #c87a55;
    text-decoration: none;
}

.site-settings .dropdown-trigger {
    position: relative;
    z-index: 21; /* above the backdrop, so the gear also closes the menu */
}

.site-settings-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
}

.site-settings-panel {
    min-width: 16rem;
}

.site-settings-languages .button {
    background: transparent;
    border-color: transparent;
}

.site-settings-languages .button:hover,
.site-settings-languages .button.is-selected {
    background-color: var(--bulma-background);
}

.site-settings-languages li + li {
    margin-top: 0.125rem;
}

.text-size-sample {
    line-height: 1;
}

.text-size-sample-normal {
    font-size: 0.85em;
}

.text-size-sample-large {
    font-size: 1.1em;
}

.text-size-sample-larger {
    font-size: 1.35em;
}

/* On a phone the gear stays next to the burger, outside the menu that folds open. */
@media screen and (max-width: 1023px) {
    .site-navbar {
        position: relative;
    }

    .site-settings-slot {
        position: absolute;
        top: 0;
        right: 3.25rem;
        height: 4.25rem;
        padding: 0;
    }
}

/* The logo has a white background: blended with the light bar, on a small white card in dark mode. */
.site-logo {
    mix-blend-mode: multiply;
}

[data-theme="dark"] .site-logo {
    mix-blend-mode: normal;
    background-color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
}

/* Dark mode: Bulma switches its own colours, but keeps "light" light (the bar, light buttons and notices) and "dark" dark.
   Swapping them makes those dark with light text too. */
[data-theme="dark"] {
    --bulma-light-l: 18%;
    --bulma-light-invert-l: 92%;
    --bulma-dark-l: 92%;
    --bulma-dark-invert-l: 14%;
    color-scheme: dark; /* light icons in date fields and scroll bars */
}

[data-theme="dark"] .has-text-black {
    color: var(--bulma-text-strong) !important;
}

[data-theme="dark"] .dark-placeholder::placeholder {
    color: var(--bulma-text-weak) !important;
}

/* These are the fixed light colours of the pages. */
[data-theme="dark"] .booking-bar,
[data-theme="dark"] .booking-widget,
[data-theme="dark"] .section-bg,
[data-theme="dark"] [style*="background-color: #f7f4f0"],
[data-theme="dark"] [style*="background-color: #fdfaf7"] {
    background-color: var(--bulma-scheme-main-bis) !important;
}

[data-theme="dark"] .summary-box,
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color: #e0d8cf"] {
    background-color: var(--bulma-scheme-main-ter) !important;
}

[data-theme="dark"] .summary-box,
[data-theme="dark"] [style*="#e0d8cf"],
[data-theme="dark"] [style*="#dbdbdb"] {
    border-color: var(--bulma-border) !important;
}

[data-theme="dark"] [style*="color: #363636"],
[data-theme="dark"] [style*="color: #4a4a4a"] {
    color: var(--bulma-text-strong) !important;
}

[data-theme="dark"] .booking-bar .has-text-grey,
[data-theme="dark"] .booking-widget .has-text-grey {
    color: var(--bulma-text) !important;
}

[data-theme="dark"] .booking-widget input::placeholder {
    color: var(--bulma-text-weak);
}

/* ---------- Admin: side menu (Layout/AdminSidebar.razor) and panel (Layout/AdminPanel.razor) ---------- */
.admin-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.admin-sidebar {
    width: 15rem;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid var(--bulma-border-weak);
}

.admin-sidebar.is-collapsed {
    width: 4rem;
    padding-right: 0.5rem;
}

.admin-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.admin-sidebar.is-collapsed .admin-sidebar-top {
    flex-direction: column;
}

.admin-sidebar .button.is-ghost {
    color: #c87a55;
    text-decoration: none;
}

.admin-sidebar-panel,
.admin-sidebar .menu-list a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-sidebar-panel {
    padding: 0.5em 0.75em;
    border-radius: var(--bulma-radius);
    color: var(--bulma-text-strong);
    font-weight: 600;
}

.admin-sidebar-panel:hover {
    background-color: var(--bulma-background);
}

.admin-sidebar-panel.is-active,
.admin-sidebar .menu-list a.is-active {
    background-color: #c87a55;
    color: #fff;
}

/* Folded: only the icons; the names stay for screen readers and appear as a tooltip. */
.admin-sidebar.is-collapsed .admin-sidebar-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Accordion: one open group at a time. */
.admin-sidebar-group + .admin-sidebar-group {
    margin-top: 0.25rem;
}

.admin-sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5em 0.75em;
    border: 0;
    border-radius: var(--bulma-radius);
    background: transparent;
    color: var(--bulma-text-strong);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.admin-sidebar-group-header:hover {
    background-color: var(--bulma-background);
}

.admin-sidebar-group-header.is-current {
    color: #b56c4a;
}

.admin-sidebar-chevron {
    margin-left: auto;
    transition: transform 0.15s ease;
}

.admin-sidebar-group.is-open .admin-sidebar-chevron {
    transform: rotate(180deg);
}

.admin-sidebar-group .menu-list {
    margin: 0.25rem 0 0.5rem 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--bulma-border-weak);
}

.admin-sidebar.is-collapsed .menu-list a,
.admin-sidebar.is-collapsed .admin-sidebar-panel,
.admin-sidebar.is-collapsed .admin-sidebar-group-header {
    justify-content: center;
}

/* On a phone: a button above the page opens the list. */
@media screen and (max-width: 1023px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar,
    .admin-sidebar.is-collapsed {
        width: auto;
        position: static;
        max-height: none;
        padding: 0 0 1rem;
        margin-bottom: 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--bulma-border-weak);
    }

    .admin-sidebar .admin-sidebar-panel,
    .admin-sidebar .menu {
        display: none;
    }

    .admin-sidebar .menu.is-open {
        display: block;
    }

    .admin-sidebar.is-collapsed .admin-sidebar-text {
        position: static;
        width: auto;
        height: auto;
        clip-path: none;
    }
}

.admin-panel-search {
    width: min(100%, 24rem);
}

/* Tabs of the admin panel: one per group, the functions appear right under them. */
.admin-group-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-group-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--bulma-border-weak);
    border-radius: var(--bulma-radius-large);
    background-color: var(--bulma-scheme-main);
    color: var(--bulma-text-strong);
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.admin-group-tab:hover {
    border-color: #c87a55;
    color: var(--bulma-text-strong);
}

.admin-group-tab .icon {
    color: #c87a55;
}

.admin-group-tab.is-active {
    background-color: #c87a55;
    border-color: #c87a55;
    color: #fff;
}

.admin-group-tab.is-active .icon {
    color: #fff;
}

.admin-group-tab-count {
    margin-left: auto;
}

/* On a phone: the 4 tabs in 2 x 2 and the functions in 2 columns, so they are visible without scrolling. */
@media screen and (max-width: 768px) {
    .admin-group-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .admin-group-tab {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    .admin-group-tab-count {
        display: none;
    }

    .admin-panel-group .admin-tiles {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .admin-panel-group .admin-tile {
        gap: 0.4rem;
        padding: 0.9rem;
        font-size: 0.9rem;
    }
}

.admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 1rem;
}

.admin-tile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    margin-bottom: 0 !important;
    border: 1px solid var(--bulma-border-weak);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-tile:hover,
.admin-tile:focus-visible {
    transform: translateY(-2px);
    border-color: #c87a55;
    box-shadow: 0 0.5em 1em -0.25em rgba(0, 0, 0, 0.15);
}

.admin-tile-label {
    color: var(--bulma-text-strong);
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .admin-tile {
        transition: none;
    }

    .admin-tile:hover,
    .admin-tile:focus-visible {
        transform: none;
    }
}
