/* Set by the script in _head.html while the page loads */
.theme-loading *,
.theme-loading *::before,
.theme-loading *::after {
    transition: none !important;
}

/* Layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 2rem 0;
}

.footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

/* Navigation */
.navbar {
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 500;
}

.nav-link {
    position: relative;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.nav-link.active {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

/* The navigation gets as wide as its links need, but at least as wide as the page content.
   If it doesn't fit the window, the script in base.html switches to the menu button (.navbar-compact). */
.navbar .nav-link,
.navbar-brand,
.user-section {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-expand-lg > .container {
        width: max-content;
        min-width: 960px;
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .navbar-expand-lg > .container {
        min-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .navbar-expand-lg > .container {
        min-width: 1320px;
    }
}

.navbar-toggler:focus {
    box-shadow: none;
}

.theme-toggle {
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle i {
    font-size: 1.2rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem 0;
    }

    .user-section {
        margin-top: 1rem;
        justify-content: space-between;
    }
}

/* Menu button on a wide window, because the links don't fit next to each other */
.navbar-compact .navbar-collapse {
    padding: 1rem 0;
}

.navbar-compact .user-section {
    margin-top: 1rem;
    justify-content: space-between;
}

/* Components */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

.btn-sm {
    padding: 0.4rem 0.7rem;
}

.btn-outline-primary {
    border-width: 2px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-container {
    padding: 1rem;
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.avatar-circle.avatar-sm {
    width: 32px;
    height: 32px;
    background-color: var(--bs-secondary);
}

.color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tables */
.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table .cell-text {
    display: inline-block;
    max-width: 200px;
}

tr[data-href] {
    cursor: pointer;
}

tr[data-href]:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.status-badge {
    border: none;
    transition: all 0.3s ease;
}

button.status-badge:disabled {
    opacity: 0.6;
}

/* Forms */
.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
}

.input-group .form-control,
.input-group .form-select {
    border-radius: 0 0.5rem 0.5rem 0;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.new-project-fields {
    background-color: var(--bs-tertiary-bg);
}

/* Benutzermanagement */
.filter-card {
    border: 2px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.filter-card:hover {
    transform: translateY(-2px);
}

.filter-card.active {
    border-color: var(--bs-primary);
}

.bulk-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-tertiary-bg);
    border: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.bulk-bar.has-selection {
    border-color: var(--bs-primary);
}

.checkbox-cell {
    width: 1%;
}

.praxisbildner-select {
    min-width: 180px;
}

.praxisbildner-select.is-unassigned {
    border-color: var(--bs-danger);
    color: var(--bs-danger);
}

/* Dashboard: button in the top right corner of the card, above the title on small screens */
@media (min-width: 768px) {
    .card-corner-action {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin: 0 !important;
    }
}

/* Task overview */
.overview-results {
    transition: opacity 0.15s ease;
}

.overview-results.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sort-link i {
    font-size: 0.75em;
    opacity: 0.4;
}

.sort-link:hover i,
.sort-link.active i {
    opacity: 1;
}

.sort-link.active {
    color: var(--bs-primary);
}

.multiselect-menu {
    min-width: max(100%, 15rem);
}

.multiselect-options {
    max-height: 280px;
    overflow-y: auto;
}

.multiselect-options .dropdown-item {
    cursor: pointer;
    padding: 0.4rem 0.5rem;
}

/* The button of a multiselect with a selection is highlighted, like an active filter */
.multiselect.has-selection > .form-select {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

/* Heading of a day in the task overview, with a clear line above every day but the first */
.overview-table > tbody > tr.group-row > td {
    --bs-table-bg-state: transparent;
    background-color: var(--bs-tertiary-bg);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.overview-table > tbody > tr.group-row:not(:first-child) > td {
    border-top: 2px solid rgba(var(--bs-primary-rgb), 0.6);
}

.overview-table .goal-cell {
    min-width: 240px;
    max-width: 420px;
}

/* Logs */
.log-content {
    font-family: monospace;
    font-size: 0.9em;
    background-color: var(--bs-tertiary-bg);
    padding: 1rem;
    border-radius: 0.375rem;
    max-height: 500px;
    overflow-y: auto;
    word-break: break-word;
}

/* Changed fields of an edit, highlighted in both themes */
.log-changes tr.is-changed > * {
    background-color: var(--bs-warning-bg-subtle);
}

.log-changes th[scope="row"] {
    width: 1%;
}
