/* ── CSS Tooltip ─────────────────────────────────────────────────── */
/* Usage: <span class="tip" data-tip="Your text here">...</span>      */

/* ── TopNav Timer ────────────────────────────────────────────────── */

.timer-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0 0.25rem;
    cursor: pointer;
    color: inherit;
    border-radius: 4px;
    line-height: 1;
}

.timer-btn:hover {
    opacity: 0.75;
}

/* Elapsed time — hidden by default, slides in when .timer-running is added */
.timer-elapsed {
    display: inline-block;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    margin-left: 0;
    vertical-align: middle;
    transition: max-width 0.35s ease, opacity 0.35s ease, margin-left 0.35s ease;
}

.timer-elapsed.timer-running {
    max-width: 5.5rem;
    opacity: 1;
    margin-left: 0.3rem;
}

/* Pulsing red dot shown while running */
.timer-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--tblr-red, #d63939);
    margin-left: 0.3rem;
    animation: timer-pulse 1.4s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes timer-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.3; transform: scale(0.75); }
}

/* ── Notification dot ───────────────────────────────────────────── */
.notification-dot {
    position: absolute;
    top: 2px;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--tblr-red, #d63939);
    animation: notif-pulse 1.5s ease-in-out infinite;
}

@keyframes notif-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.5; transform: scale(1.6); }
}

.tip {
    position: relative;
    display: inline-block;
    cursor: default;
}

.tip::before,
.tip::after {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 1070;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Black balloon */
.tip::before {
    content: attr(data-tip);
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: #212529;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Tail arrow */
.tip::after {
    content: '';
    bottom: calc(100% + 2px);
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: #212529;
    border-bottom: none;
}

.tip:hover::before,
.tip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Solid outline buttons in dark mode */
[data-bs-theme="dark"] .btn-outline-primary {
    background-color: var(--tblr-primary, #066fd1) !important;
    border-color: var(--tblr-primary, #066fd1) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    background-color: var(--tblr-secondary, #6c757d) !important;
    border-color: var(--tblr-secondary, #6c757d) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    background-color: var(--tblr-danger, #d63939) !important;
    border-color: var(--tblr-danger, #d63939) !important;
    color: #fff !important;
}

/* Darker page background in light mode so cards pop */
html[data-bs-theme="light"] {
    --tblr-body-bg: #f7f9fa;
}

/* TopNav background matches page background in light mode */
    html[data-bs-theme="light"] .navbar.navbar-expand-md {
        --tblr-navbar-bg: #f7f9fa;
        background-color: #f7f9fa !important;
    }

/* DataTables sorted column header — keep theme text color, don't let DT override it */
#table-clients thead th.dt-ordering-asc,
#table-clients thead th.dt-ordering-desc {
    color: inherit !important;
}

/* ── Quill editor ─────────────────────────────────────────────────── */
#quill-note-body .ql-editor,
#quill-edit-note .ql-editor {
    min-height: 150px;
}

/* ── Form field contrast ──────────────────────────────────────────── */
.form-control,
.form-select {
    border-color: #d3dae0 !important;
}

.form-check-input {
    border-color: #d3dae0 !important;
}

/* ── Password toggle (input-group-flat) ───────────────────────────── */
/* Make the input-group-text blend seamlessly with the adjacent form-control */
.input-group-flat .input-group-text {
    background-color: var(--tblr-form-control-bg, #fff);
    border-color: #d3dae0 !important;
}

/* Suppress the browser's native password-reveal button (avoids two eye icons) */
input[type="password"]::-ms-reveal {
    display: none;
}

/* ── Messaging ────────────────────────────────────────────────────── */
/* Incoming (non-me) bubbles: use inset box-shadow as the border.
   Tabler has no border or box-shadow on .chat-bubble, so this is fully
   additive, respects border-radius, and cannot be overridden by Tabler's
   border properties. .chat-bubble-me already gets box-shadow:none from
   Tabler so only non-me bubbles are affected. */
.chat-bubble:not(.chat-bubble-me) {
    box-shadow: inset 0 0 0 1px #e6e9ed;
}

/* Lock External page background to a consistent colour in light mode only,
   regardless of which Tabler theme JS sets after Blazor-enhanced navigation. */
[data-bs-theme="light"] .page {
    background-color: #f7f9fa !important;
}