/* Custom styles for TravelRequest app */
/* These extend the Enabel Bootstrap Theme */

:root {
    --font-size-small: 0.875rem;

    /* Top offset so the fixed Enabel:Ux navbar doesn't hide the content.
       Enabel:Ux:ImpersonateBanner bumps this to 108px on its own. */
    --app-navbar-offset: 80px;
}

/* ==========================================================================
   Navbar — two-line Enabel brand, aligned with Impala / Mandate / Owl
   ========================================================================== */

body {
    padding-top: var(--app-navbar-offset);
}

html {
    scroll-padding-top: var(--app-navbar-offset);
}

/* Drop the offset on pages without a fixed navbar (e.g. login, error pages). */
body:not(:has(.navbar.fixed-top)) {
    padding-top: 0;
}

/* The Enabel Bootstrap theme pads main > .container* to compensate for a fixed
   navbar. We already pad the body via --app-navbar-offset, so neutralise the
   theme's padding to avoid stacking the two. */
main > .container,
main > .container-fluid,
main > .container-sm,
main > .container-md,
main > .container-lg,
main > .container-xl,
main > .container-xxl {
    padding-top: 0;
}

/* Vertical breathing room that lets the two-line brand and the menu items
   align nicely. */
.navbar.fixed-top {
    padding: 0.75rem 0;
}

.navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* Drop Bootstrap's vertical padding: the UserMenu avatar (56px) then sets
       the navbar height, landing on exactly the 80px --app-navbar-offset that
       Enabel:Ux:ImpersonateBanner also assumes. */
    padding-top: 0;
    padding-bottom: 0;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s ease-in-out;
}

.navbar .navbar-brand:hover {
    color: #fff;
    opacity: 0.9;
}

.navbar .brand-icon {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    object-fit: contain;
}

.navbar .brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.navbar .brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.navbar .brand-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .navbar .brand-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .navbar .brand-title {
        font-size: 1.125rem;
    }
}

/* Missing SAFER certificate blocks travel requests, so it gets a full pill in
   the navbar rather than a dot on the avatar — the dot was too easy to miss
   against the dark navbar. */
.navbar .safer-alert > .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--bs-border-radius-pill);
    background-color: var(--bs-danger);
    color: #fff;
    font-size: var(--font-size-small);
    font-weight: 600;
    animation: safer-alert-pulse 2.4s ease-in-out infinite;
}

.navbar .safer-alert > .nav-link:hover,
.navbar .safer-alert > .nav-link:focus {
    background-color: #a51212;
    color: #fff;
}

@keyframes safer-alert-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--bs-danger-rgb), 0.6); }
    50%      { box-shadow: 0 0 0 0.4rem rgba(var(--bs-danger-rgb), 0); }
}

@media (prefers-reduced-motion: reduce) {
    .navbar .safer-alert > .nav-link {
        animation: none;
    }
}

/* Indented block with left border */
.indent {
    padding-left: var(--bs-spacer-3, 1rem);
    border-left: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
}

/* Timeline component */
.timeline {
    list-style: none;
    margin-bottom: 0;
    counter-reset: timeline-step;
}

.timeline > * {
    position: relative;
    border-left: var(--bs-border-width) dotted var(--bs-tertiary-color);
    padding: 0 0 1rem 2rem;
    counter-increment: timeline-step;
    color: var(--bs-tertiary-color);
}

.timeline > *:first-child {
    padding-top: 1rem;
}

.timeline > .complete {
    border-left: var(--bs-border-width) solid var(--bs-dark);
    color: var(--bs-dark);
}

.timeline > .halted {
    border-left: var(--bs-border-width) dotted var(--bs-tertiary-color);
    color: var(--bs-dark);
}

.timeline > .active {
    border-left: var(--bs-border-width) dotted var(--bs-tertiary-color);
    color: var(--bs-dark);
}

.timeline > *::before {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    border: var(--bs-border-width) dotted var(--bs-tertiary-color);
    background: var(--bs-white);
    border-radius: 50%;
    transform: translateX(calc(-50% - var(--bs-border-width) / 2));
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--bs-tertiary-color);
    content: counter(timeline-step);
}

.timeline > .active::before {
    border-color: var(--bs-secondary);
    background: var(--bs-secondary);
    color: var(--bs-white);
    border-style: solid;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    font-family: var(--fa-style-family-classic, "Font Awesome 7 Free");
    font-weight: var(--fa-style, 900);
    content: "\f252";
}

.timeline > .halted::before {
    border-color: var(--bs-danger);
    background: var(--bs-danger);
    color: var(--bs-white);
    border-style: solid;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    font-family: var(--fa-style-family-classic, "Font Awesome 7 Free");
    font-weight: var(--fa-style, 900);
    content: "\f023";
}

.timeline > .complete::before {
    border-color: var(--bs-dark);
    background: var(--bs-dark);
    color: var(--bs-white);
}

/* Clickable table rows */
table[data-controller="clickable-row"] tr:has(a[data-clickable-row-anchor]):hover {
    cursor: pointer;
}

/* Extra-small button — one step below btn-sm */
.btn-xs {
    --bs-btn-padding-y: 0.125rem;
    --bs-btn-padding-x: 0.375rem;
    --bs-btn-font-size: 0.75rem;
}

/* Section headers */
.section-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary);
    margin-bottom: 0.5rem;
}

.section-header-count {
    color: var(--bs-tertiary-color);
    margin-left: 0.25rem;
}

/* Compact definition lists inside cards */
.dl-list {
    display: grid;
    grid-template-columns: auto 1fr;
    margin: 0;
}

.dl-list > dt {
    padding: 0.35rem 0.75rem 0.35rem 0.75rem;
    margin-bottom: 0;
    text-align: right;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: var(--font-size-small);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    border-right: 1px solid var(--bs-border-color-translucent);
}

.dl-list > dd {
    padding: 0.35rem 0.5rem 0.35rem 0.5rem;
    margin-bottom: 0;
    font-size: var(--font-size-small);
    transition: background-color 0.15s ease;
}

.dl-list > dd:hover {
    background-color: var(--bs-tertiary-bg);
}

.dl-list > dt:last-of-type {
    border-bottom: 0;
}

/* Dropzone styling */
.dropzone-container {
    border: 2px dashed var(--bs-card-border-color);
    border-radius: var(--bs-border-radius);
    min-height: 10em;
}

/* We render selected files as badges, never as image thumbnails. */
.dropzone-preview-image {
    display: none !important;
}

/* Compact dropdown menu — hugs its items, for small action menus */
.dropdown-menu-compact {
    --bs-dropdown-min-width: max-content;
    --bs-dropdown-padding-y: 0.25rem;
    --bs-dropdown-item-padding-y: 0.25rem;
    --bs-dropdown-item-padding-x: 0.75rem;
    --bs-dropdown-font-size: var(--font-size-small);
}

/* Clickable card */
a.card {
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease-in-out;
}

a.card:hover {
    background: var(--bs-tertiary-bg);
}

/* Widget card — smaller base font size */
.card-widget {
    font-size: var(--font-size-small);
}

/* Leader dots — fills horizontal space between a label and a value */
.leader-dots {
    flex: 1;
    border-bottom: var(--bs-border-width) dotted var(--bs-border-color);
    min-width: 1rem;
}

.align-items-last-baseline {
    align-items: last baseline;
}
