/*
 * Shared layout components: dark page headers/heros, empty states,
 * breadcrumbs, and filter bars. These reproduce patterns that were
 * previously duplicated as inline <style> across home, tickets, and other
 * list/detail pages. Design tokens (--lot-black, --lot-mint, --radius-*,
 * --shadow-*, etc.) are defined globally in base.html.
 */

/* ──────────────────────────────────────────────
 * Page header / hero — the dark banner with title,
 * subtitle, and a decorative blurred mint accent.
 * ────────────────────────────────────────────── */
.page-banner {
    background: var(--lot-black);
    color: var(--lot-white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Decorative blurred accent (same as .tickets-header / .admin-header / .dashboard-header) */
.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--lot-mint);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(60px);
}

/* Keep header content above the decorative accent */
.page-banner__eyebrow,
.page-banner__title,
.page-banner__subtitle,
.page-banner__actions,
.page-banner__content {
    position: relative;
    z-index: 1;
}

/* Eyebrow / role pill (e.g. "Support", "Admin") */
.page-banner__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(134, 239, 172, 0.15);
    color: var(--lot-mint);
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.page-banner__title {
    margin-bottom: 0.5rem;
    color: var(--lot-white);
}

.page-banner__subtitle {
    opacity: 0.8;
    margin: 0;
    color: var(--lot-gray-300);
    max-width: 520px;
}

.page-banner__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/*
 * Hero variant — the dark welcome banner used on the authenticated dashboard
 * (formerly .dashboard-header). Its decorative accent sits slightly higher and
 * is a touch fainter than the list-page headers, matching the original.
 */
.page-banner--hero::before {
    top: -40%;
    opacity: 0.08;
}

@media (max-width: 768px) {
    .page-banner {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .page-banner {
        padding: 1.5rem 1rem;
    }

    .page-banner__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-banner__actions .btn {
        width: 100%;
    }
}

/* ──────────────────────────────────────────────
 * Empty state — icon circle + heading + description + CTA.
 * ────────────────────────────────────────────── */
.ui-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--lot-white);
    border: 1px dashed var(--lot-gray-300);
    border-radius: var(--radius-lg);
}

.ui-empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--lot-gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.ui-empty-state-icon svg {
    width: 32px;
    height: 32px;
    color: var(--lot-gray-400);
}

.ui-empty-state h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ui-empty-state p {
    color: var(--lot-gray-600);
    margin-bottom: 1.5rem;
}

/*
 * When an empty state is rendered inside a card/table that already supplies
 * its own surface and border, drop the dashed border + white background so it
 * blends in (matches the admin ticket list's borderless empty state).
 */
.ui-empty-state--bare {
    background: transparent;
    border: none;
}

.ui-empty-state--bare p {
    margin-bottom: 0;
}

/*
 * Soft gray surface (no dashed border) — matches the many bespoke empty states
 * that used a gray-50 panel rather than the default white-dashed card.
 */
.ui-empty-state--muted {
    background: var(--lot-gray-50);
    border: none;
}

/* ──────────────────────────────────────────────
 * Breadcrumb trail.
 * ────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--lot-gray-500);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--lot-gray-500);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--lot-black);
}

.breadcrumb-separator {
    color: var(--lot-gray-300);
}

.breadcrumb-current {
    color: var(--lot-black);
    font-weight: 500;
}

/* ──────────────────────────────────────────────
 * Filter bar — the filter-form row used by list pages.
 * Pages can still add page-specific groups/inputs.
 * ────────────────────────────────────────────── */
.ui-filter-bar {
    background: var(--lot-white);
    border: 1px solid var(--lot-gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.ui-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 160px;
}

.ui-filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--lot-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ui-filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--lot-gray-300);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--lot-gray-800);
    background: var(--lot-white);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.ui-filter-select:focus {
    outline: none;
    border-color: var(--lot-mint-dark);
    box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.2);
}

.ui-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 768px) {
    .ui-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .ui-filter-group {
        min-width: 100%;
    }

    .ui-filter-actions {
        width: 100%;
    }

    .ui-filter-actions .btn {
        flex: 1;
    }
}

/* =========================================================================
   Light page head — a plain page title row on the normal light background
   (NOT the dark .page-banner hero). Replaces the dozens of bespoke local
   ".page-header" rules that repeat the same "title left / actions right"
   pattern. Namespaced as .page-head so it never collides with the bare
   local .page-header class still used by not-yet-migrated templates.
   ========================================================================= */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Stacked variant: just a title block with bottom spacing, no actions row. */
.page-head--stack {
    display: block;
}

.page-head__titles {
    min-width: 0;
}

.page-head__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--lot-black);
    margin: 0 0 0.5rem;
}

/* 2rem variant — matches base.html's default h1 size, for pages whose title
   was that size before consolidation (preserves exact fidelity). */
.page-head__title--lg {
    font-size: 2rem;
}

/* Title-only header (no subtitle): drop the title's bottom margin so spacing
   matches the original single-line headers. */
.page-head__title--flush {
    margin-bottom: 0;
}

.page-head__subtitle {
    color: var(--lot-gray-600);
    margin: 0;
}

.page-head__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .page-head {
        flex-direction: column;
    }

    .page-head__actions {
        width: 100%;
    }
}
