/* Styles for static/js/qol.js — flashes, busy buttons, draft + session bars. */

/* ── Flash messages ── */
.flash-stack {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 990;
    display: flex;
    flex-direction: column;
}

.flash-msg {
    position: relative;
    padding: .6rem 3rem;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: .03em;
    backdrop-filter: blur(6px);
    transition: opacity .4s, transform .4s;
}

.flash-msg.flash-success {
    background: rgba(20, 60, 35, .92);
    border-bottom: 1px solid rgba(86, 204, 119, .4);
    color: #56cc77;
}

.flash-msg.flash-error {
    background: rgba(70, 20, 24, .94);
    border-bottom: 1px solid rgba(255, 107, 107, .4);
    color: #ff6b6b;
}

.flash-msg.flash-warning {
    background: rgba(70, 55, 10, .94);
    border-bottom: 1px solid rgba(255, 211, 105, .4);
    color: #ffd369;
}

.good-alert, .bad-alert { position: relative; padding-right: 2.5rem; }

.flash-close {
    position: absolute;
    top: 50%;
    right: .8rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
}

.flash-close:hover { opacity: 1; }

.flash-hide {
    opacity: 0;
    transform: translateY(-8px);
}

/* ── Busy submit button ── */
.qol-busy {
    cursor: progress !important;
    opacity: .75;
}

.qol-spinner {
    display: inline-block;
    width: .85em;
    height: .85em;
    vertical-align: -.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: qol-spin .7s linear infinite;
}

@keyframes qol-spin { to { transform: rotate(360deg); } }

/* ── Draft + session bars ── */
.qol-draft-bar,
.qol-session-bar {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: .85rem;
    color: #e2e8f0;
    background: #1a1d27;
    border: 1px solid #2e3050;
    border-radius: 8px;
    padding: .55rem .9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.qol-draft-bar {
    margin: .75rem auto;
    max-width: 900px;
    border-left: 3px solid #4da6ff;
}

.qol-session-bar {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    z-index: 9500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    max-width: calc(100vw - 2rem);
}

.qol-session-bar.warn { border-left: 3px solid #ffd369; }
.qol-session-bar.expired { border-left: 3px solid #ff6b6b; }

.qol-btn {
    background: none;
    border: 1px solid #2e3050;
    border-radius: 5px;
    color: #9aa3b2;
    font-size: .8rem;
    font-weight: 600;
    padding: .25rem .75rem;
    cursor: pointer;
    text-decoration: none;
}

.qol-btn:hover { color: #e2e8f0; border-color: #9aa3b2; text-decoration: none; }

.qol-btn-primary {
    background: rgba(77, 166, 255, .15);
    border-color: #4da6ff;
    color: #4da6ff;
}

/* ── Searchable selects (Tom Select, dark theme to match form selects) ── */
/* "body" prefix: tom-select.min.css is injected later at runtime, so equal
   specificity would lose to its white input-active background. */
body .ts-wrapper { min-width: 8rem; max-width: 100%; text-align: left; }
body .ts-wrapper .ts-control,
body .ts-wrapper.single.input-active .ts-control {
    background: #121212;
    color: #fff;
    border: 2px ridge #7e7d7d;
    border-radius: 4px;
    font-weight: bold;
    cursor: text;
}
/* One compact line like the native selects: long names truncate instead of
   wrapping, and the search box shares the row with the chosen item. */
body .ts-wrapper.single .ts-control { padding: 2px 6px; min-height: 0; flex-wrap: nowrap; overflow: hidden; }
body .ts-wrapper.single .ts-control .item { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .ts-wrapper.single .ts-control input { flex: 1 1 0; min-width: 0 !important; }
body .ts-wrapper .ts-control input { color: #fff; }
body .ts-wrapper .ts-control input::placeholder { color: #9aa3b2; }
body .ts-wrapper.focus .ts-control { border-color: #4da6ff; box-shadow: 0 0 0 3px rgba(77, 166, 255, .2); }
body .ts-dropdown {
    background: #1a1d27;
    color: #e2e8f0;
    border: 1px solid #2e3050;
    z-index: 2000;
}
body .ts-dropdown .option,
body .ts-dropdown .no-results { padding: .35rem .6rem; }
body .ts-dropdown .active { background: rgba(77, 166, 255, .2); color: #fff; }
body .ts-dropdown .selected { color: #4da6ff; }
body .ts-dropdown .highlight { background: rgba(255, 211, 105, .3); color: inherit; }

@media print {
    .flash-stack, .good-alert, .bad-alert, .qol-draft-bar, .qol-session-bar { display: none !important; }
}

/* Phone width (726px and narrower): less page padding, smaller headings */
@media (max-width: 726px) {
    .hub-container { padding: 8px 16px 24px; box-sizing: border-box; max-width: 100vw; }
    .hub-container h1 { font-size: 1.8rem; }
    .hub-container h2 { font-size: 1.4rem; margin-bottom: 1rem; }
    .breadcrumb-bar { padding: .3rem 16px; }
}
