/* Terminkreuz application styles. Bootstrap 5 provides the base; only app-specific rules live here. */

:root {
    --tk-brand: #2a6f97;
}

.navbar-brand img {
    display: inline-block;
}

/* Color swatch in master data lists */
.color-swatch {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: .25rem;
    border: 1px solid rgba(0, 0, 0, .15);
    vertical-align: middle;
}

/* Help page (rendered Markdown) */
.help-content h1 { font-size: 1.75rem; }
.help-content h2 { font-size: 1.4rem; margin-top: 1.75rem; }
.help-content h3 { font-size: 1.15rem; margin-top: 1.25rem; }
.help-content img { max-width: 100%; height: auto; border: 1px solid var(--bs-border-color); border-radius: .375rem; }
.help-content .heading-permalink { margin-left: .4rem; font-size: .8em; opacity: .4; text-decoration: none; }
.help-content .heading-permalink:hover { opacity: 1; }
.help-content .table-of-contents { background: var(--bs-tertiary-bg); padding: 1rem 1rem 1rem 2rem; border-radius: .375rem; }
.help-content table { width: auto; }
.help-content table th, .help-content table td { padding: .3rem .6rem; border: 1px solid var(--bs-border-color); }

/* htmx request indicator */
.htmx-indicator { opacity: 0; transition: opacity .2s ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

@media print {
    nav, footer, .btn, .no-print { display: none !important; }
    main { padding: 0 !important; }
    .card { border: 0 !important; }
}

/* Month grid */
.tk-month { table-layout: fixed; font-size: .8rem; }
.tk-month th.tk-week-col, .tk-month td.tk-week-col { width: 2.2rem; }
.tk-month td.tk-day { height: 6.5rem; padding: .25rem; }
.tk-month td.tk-outside { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.tk-month td.tk-outside .tk-event { opacity: .7; }
.tk-month .tk-weekend { background: rgba(var(--bs-primary-rgb), .03); }
.tk-month td.tk-today { box-shadow: inset 0 0 0 2px var(--bs-primary); }
.tk-day-head { margin-bottom: .2rem; min-height: 1.3rem; }
.tk-day-number { font-weight: 600; }
.tk-day-add { opacity: 0; line-height: 1; }
.tk-day:hover .tk-day-add, .tk-day-add:focus { opacity: 1; }
.tk-absence { font-size: .6rem; padding: .15em .35em; }
.tk-event {
    display: block;
    margin-bottom: .2rem;
    padding: .15rem .3rem;
    border-left: 3px solid var(--tk-color, var(--bs-secondary-color));
    border-radius: .25rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    line-height: 1.25;
    overflow: hidden;
}
.tk-event:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.tk-event-meta { display: block; font-size: .7rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-event-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-event-person { display: block; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-event.tk-colored .tk-event-person { background: var(--tk-color); color: var(--tk-color-text); border-radius: .2rem; padding: 0 .25rem; }
.tk-event.tk-unassigned { background: var(--bs-warning-bg-subtle); border-left-color: var(--bs-warning); }
.tk-event.tk-unassigned .tk-event-person { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.tk-cancelled .tk-event-title, .tk-cancelled .tk-event-meta, tr.tk-cancelled td { text-decoration: line-through; color: var(--bs-secondary-color); }
.tk-list .tk-row { cursor: pointer; }
.tk-list td { vertical-align: middle; }

/* Sidebar editor */
.tk-editor .form-label { font-size: .85rem; }
#sidebar { max-height: calc(100vh - 5rem); overflow-y: auto; }

/* Print view */
body.tk-print .tk-print-table th, body.tk-print .tk-print-table td { border: 1px solid #ccc; padding: .25rem .5rem; }

/* Person page: click sheet for days off */
.tk-sheet { table-layout: fixed; }
.tk-sheet td.tk-sheet-outside { background: var(--bs-tertiary-bg); }
.tk-sheet td.tk-sheet-outside .tk-sheet-day { opacity: .5; }
.tk-sheet-day {
    display: block;
    width: 100%;
    padding: .35rem 0;
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    font-size: .9rem;
}
button.tk-sheet-day:hover { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
.tk-sheet-today { font-weight: 700; text-decoration: underline; }
.tk-sheet-regular { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.tk-sheet-single { background: var(--bs-success); color: #fff; }
.tk-sheet-work { background: repeating-linear-gradient(45deg, var(--bs-success-bg-subtle) 0 4px, var(--bs-body-bg) 4px 8px); color: var(--bs-secondary-color); text-decoration: line-through; }
.tk-sheet-range { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); }
.tk-sheet-legend { display: inline-block; width: 1rem; height: 1rem; vertical-align: middle; border-radius: .2rem; border: 1px solid rgba(0,0,0,.1); }
.tk-sheet-changed { animation: tk-sheet-pulse 1.2s ease-out 1; outline: 2px solid var(--bs-primary); outline-offset: -2px; }
@keyframes tk-sheet-pulse { 0% { box-shadow: inset 0 0 0 2rem rgba(var(--bs-primary-rgb), .5); } 100% { box-shadow: inset 0 0 0 2rem rgba(var(--bs-primary-rgb), 0); } }
