/* UTT Platform Design System — component styles
 * ------------------------------------------------------------------
 * Styles for the shared includes under templates/includes/design/.
 * Also defines the icon/colour accent registry.
 *
 * Loaded from base.html AFTER custom.css so component styles win.
 */

/* ── Accent colour registry ─────────────────────────────────────── */
:root {
    --ds-accent-event:    #60a5fa;  /* blue     — calendar, events */
    --ds-accent-mail:     #a78bfa;  /* purple   — campaigns, email */
    --ds-accent-file:     #2dd4bf;  /* teal     — files, documents */
    --ds-accent-tag:      #fbbf24;  /* amber    — tags, labels */
    --ds-accent-location: #f87171;  /* red      — locations */
    --ds-accent-neutral:  #94a3b8;  /* slate    — people, generic */
}

/* Semantic icon utility classes — apply to <i class="bi ..."> to colour it.
   Do NOT use Bootstrap's text-info/warning/etc for accent tinting on icons. */
.ds-icon-event    { color: var(--ds-accent-event); }
.ds-icon-mail     { color: var(--ds-accent-mail); }
.ds-icon-file     { color: var(--ds-accent-file); }
.ds-icon-tag      { color: var(--ds-accent-tag); }
.ds-icon-location { color: var(--ds-accent-location); }
.ds-icon-neutral  { color: var(--ds-accent-neutral); }

/* ── page_header ─────────────────────────────────────────────────── */
.ds-page-header__icon {
    color: var(--ds-accent-neutral);
    font-size: 0.9em;
}

/* ── empty_state ─────────────────────────────────────────────────── */
.ds-empty__icon {
    font-size: 3rem;
    color: var(--ds-accent-neutral);
    opacity: 0.6;
}

/* ── filter_bar ──────────────────────────────────────────────────── */
.ds-filter-bar .card-body {
    background: rgba(255, 255, 255, 0.02);
}

/* ── data_table ──────────────────────────────────────────────────── */
.ds-table-wrap .ds-table__head th {
    position: sticky;
    top: 0;
    background: rgba(13, 34, 64, 0.95);
    backdrop-filter: blur(8px);
    z-index: 2;
    font-weight: 500;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ds-table-wrap .ds-table__head a {
    color: inherit;
    text-decoration: none;
}
.ds-table-wrap .ds-table__head a:hover {
    color: #ffffff;
}
.ds-table-wrap tbody tr:hover .ds-table__select input {
    outline: 2px solid rgba(99, 179, 255, 0.4);
    outline-offset: 1px;
}

/* ── bulk_action_bar ─────────────────────────────────────────────── */
.ds-bulk-bar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(120%);
    z-index: 1055;
    transition: transform 220ms ease-out;
    max-width: min(720px, calc(100vw - 32px));
    width: max-content;
}
.ds-bulk-bar:not(.d-none) {
    transform: translateX(-50%) translateY(0);
}
.ds-bulk-bar__inner {
    background: #0d2240;
    border: 1px solid rgba(99, 179, 255, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    color: #e8edf5;
}
.ds-bulk-bar__count {
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: nowrap;
    margin-right: 8px;
}

/* ── section (collapsible) ───────────────────────────────────────── */
.ds-section__header {
    cursor: pointer;
    user-select: none;
}
.ds-section__header:hover {
    background-color: rgba(99, 179, 255, 0.06);
}
.ds-section__caret {
    transition: transform 180ms ease-out;
    font-size: 0.9em;
    color: var(--ds-accent-neutral);
}
.ds-section__header[aria-expanded="false"] .ds-section__caret {
    transform: rotate(-90deg);
}

/* ── command palette (Cmd+K) ─────────────────────────────────────── */
.ds-palette {
    position: fixed; inset: 0;
    z-index: 1090;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.ds-palette.ds-palette--open { display: flex; }
.ds-palette__backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}
.ds-palette__panel {
    position: relative;
    width: min(640px, calc(100vw - 32px));
    max-height: 70vh;
    background: #0d2240;
    border: 1px solid rgba(99, 179, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ds-palette__input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}
.ds-palette__input-wrap .bi {
    color: var(--ds-accent-neutral);
    font-size: 1.05rem;
}
.ds-palette__input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: #e8edf5;
    font-size: 1rem;
    padding: 0;
}
.ds-palette__input::placeholder { color: #64748b; }
.ds-palette__esc,
.ds-palette__footer kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-family: inherit;
    line-height: 1.4;
}
.ds-palette__results {
    flex: 1;
    overflow-y: auto;
    padding: 6px 6px 8px;
}
.ds-palette__category {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    padding: 10px 12px 4px;
}
.ds-palette__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #e8edf5;
    text-decoration: none;
}
.ds-palette__item:hover,
.ds-palette__item.ds-palette__item--active {
    background: rgba(99, 179, 255, 0.18);
    color: #ffffff;
    text-decoration: none;
}
.ds-palette__item .bi {
    color: var(--ds-accent-neutral);
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.ds-palette__item-body { flex: 1; min-width: 0; }
.ds-palette__item-label {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-palette__item-sub {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ds-palette__empty {
    padding: 24px;
    color: #94a3b8;
    text-align: center;
    font-size: 0.9rem;
}
.ds-palette__footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Optional Cmd+K hint chip that can be placed in the nav */
.ds-palette-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.72rem;
    cursor: pointer;
}
.ds-palette-hint:hover { background: rgba(99, 179, 255, 0.12); color: #cbd5e1; }
.ds-palette-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    padding: 0 3px;
    font-family: inherit;
    font-size: 0.7rem;
}

/* ── toasts ──────────────────────────────────────────────────────── */
.ds-toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
}
.ds-toast {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
    pointer-events: auto;
}
.ds-toast--shown {
    opacity: 1;
    transform: translateY(0);
}
.ds-toast .btn-close {
    padding: 0.35rem;
    font-size: 0.7rem;
}
.ds-toast__text {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}
