/*
 * Listen im Portal - Kopfbalken, Filter und Tabellenkarte.
 *
 * Derselbe Balken wie die Auftragsverwaltung (dd_av, .av-order-hero) und das Bedarfstool
 * (.lm-demand-hero), hier als allgemeiner Baustein fuer alle Listen (Kunden, Haendler, ...).
 * Farben aus der BrandPalette (--lm-deep*, Logo-Widget); ohne Kunde das Laemmermann-Navy.
 *
 * Einbinden je Template:
 *   <f:asset.css identifier="lmListHero" href="EXT:lm_pim/Resources/Public/Css/ListHero.css"/>
 *
 *   <div class="lm-list-hero">
 *       <div class="lm-list-hero-top">
 *           <div class="lm-list-hero-heading">
 *               <div class="lm-list-hero-eyebrow">Bereich</div>
 *               <h2 class="lm-list-hero-title">Titel</h2>
 *           </div>
 *           <div class="lm-list-hero-actions"> .btn.lm-list-hero-btn / .btn.lm-list-hero-new </div>
 *       </div>
 *       <div class="collapse lm-list-hero-filter" id="...">Filter-Partial (.card)</div>
 *   </div>
 *   <div class="card lm-list-card"> table.table.table-hover.align-middle.mb-0 </div>
 */


.lm-list-hero {
    /* Tiefe Töne der Kundenfarbe (BrandPalette, gesetzt im Logo-Widget); ohne Kunde das Lämmermann-Navy */
    --lm-list-hero-navy: var(--lm-deep, #051a33);
    --lm-list-hero-navy-2: var(--lm-deep-2, #07284d);
    --lm-list-hero-accent: var(--lm-deep-accent, #8cc4ff);
    --lm-list-hero-glow: var(--lm-deep-glow, rgba(0, 102, 188, 0.6));

    position: relative;
    margin-bottom: 1rem;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    overflow: hidden;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.72);
    background:
        radial-gradient(700px 420px at 92% 0%, var(--lm-list-hero-glow), transparent 62%),
        radial-gradient(500px 320px at 0% 100%, color-mix(in srgb, var(--lm-list-hero-glow) 40%, transparent), transparent 60%),
        linear-gradient(160deg, var(--lm-list-hero-navy) 0%, var(--lm-list-hero-navy-2) 100%);
    box-shadow: 0 30px 60px -36px color-mix(in srgb, var(--lm-list-hero-navy) 70%, transparent);
    isolation: isolate;
}

.lm-list-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 10%, transparent 75%);
}

.lm-list-hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.lm-list-hero-heading {
    margin-right: auto;
}

.lm-list-hero-eyebrow {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.6rem;
    color: var(--lm-list-hero-accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lm-list-hero-eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.lm-list-hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: 300;
    letter-spacing: -0.02em;
}

.lm-list-hero-search {
    flex: 1 1 20rem;
    max-width: 34rem;
}

.lm-list-hero-search .input-group-text,
.lm-list-hero-search .form-control {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.lm-list-hero-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.lm-list-hero-search .form-control:focus {
    border-color: var(--lm-list-hero-accent);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.lm-list-hero-btn,
/* btn-outline-light im Balken: das Theme setzt dort dunkle Schrift - Navy auf Navy, kaum lesbar */
.lm-list-hero .btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.lm-list-hero-btn:hover,
.lm-list-hero-btn:focus-visible,
.lm-list-hero .btn-outline-light:hover,
.lm-list-hero .btn-outline-light:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.lm-list-hero-new {
    border-color: #fff;
    background: #fff;
    color: var(--lm-list-hero-navy);
    font-weight: 600;
}

.lm-list-hero-new:hover,
.lm-list-hero-new:focus-visible {
    border-color: var(--lm-list-hero-accent);
    background: var(--lm-list-hero-accent);
    color: var(--lm-list-hero-navy);
}

/* Status-Kacheln im Balken */
.lm-list-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.lm-list-hero-stat {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid var(--lm-list-stat-color, var(--lm-list-hero-accent));
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.lm-list-hero-stat:hover,
.lm-list-hero-stat:focus-visible {
    border-color: rgba(255, 255, 255, 0.3);
    border-left-color: var(--lm-list-stat-color, var(--lm-list-hero-accent));
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.lm-list-hero-stat > i {
    font-size: 1.6rem;
    color: var(--lm-list-stat-color, var(--lm-list-hero-accent));
}

.lm-list-hero-stat-count {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.lm-list-hero-stat-label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
}

.lm-list-stat-secondary { --lm-list-stat-color: #adb5bd; }
.lm-list-stat-primary { --lm-list-stat-color: var(--lm-list-hero-accent); }
.lm-list-stat-warning { --lm-list-stat-color: #ffc35a; }
.lm-list-stat-info { --lm-list-stat-color: #6ee7d8; }
.lm-list-stat-danger { --lm-list-stat-color: #ff8a9b; }

@media (max-width: 575.98px) {
    .lm-list-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Erweiterte Suche: das Filter-Partial klappt im Balken auf und uebernimmt dessen Farben */
.lm-list-hero-filter > .card {
    margin: 1.5rem 0 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
}

.lm-list-hero-filter .header-title {
    color: #fff;
}

.lm-list-hero-filter .header-title a {
    color: var(--lm-list-hero-accent);
}

.lm-list-hero-filter .form-control,
.lm-list-hero-filter .form-select {
    border-color: rgba(255, 255, 255, 0.22);
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.lm-list-hero-filter .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.lm-list-hero-filter .form-select option {
    color: #212529;
}

.lm-list-hero-filter .form-control:focus,
.lm-list-hero-filter .form-select:focus {
    border-color: var(--lm-list-hero-accent);
    background-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.lm-list-hero-filter .form-floating > label,
.lm-list-hero-filter .form-check-label {
    color: rgba(255, 255, 255, 0.65);
}

.lm-list-hero-filter .form-floating > .form-control:focus ~ label,
.lm-list-hero-filter .form-floating > .form-control:not(:placeholder-shown) ~ label,
.lm-list-hero-filter .form-floating > .form-select ~ label {
    color: rgba(255, 255, 255, 0.65);
}

.lm-list-hero-filter .form-floating > .form-control:focus ~ label::after,
.lm-list-hero-filter .form-floating > .form-control:not(:placeholder-shown) ~ label::after,
.lm-list-hero-filter .form-floating > .form-select ~ label::after {
    background-color: transparent;
}

.lm-list-hero-filter .form-check-input {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
}

.lm-list-hero-filter .form-check-input:checked {
    border-color: var(--lm-list-hero-accent);
    background-color: var(--lm-list-hero-accent);
}

.lm-list-hero-filter .filter-btns .btn {
    border-color: #fff;
    background: #fff;
    color: var(--lm-list-hero-navy);
    font-weight: 600;
}

.lm-list-hero-filter .filter-btns .btn:hover,
.lm-list-hero-filter .filter-btns .btn:focus-visible {
    border-color: var(--lm-list-hero-accent);
    background: var(--lm-list-hero-accent);
    color: var(--lm-list-hero-navy);
}

/* Filter ohne Klappe (Listen, deren Filter immer sichtbar bleiben soll) */
.lm-list-hero-filter:not(.collapse) > .card:first-child {
    margin-top: 1.5rem;
}

.lm-list-hero-filter .card-body {
    padding: 1rem 1.25rem 0.25rem;
}

.lm-list-hero-filter .card + .card {
    margin-top: 0.75rem;
}

/* Knopfleiste rechts im Balken */
.lm-list-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.lm-list-hero-actions .btn > i {
    margin-right: 0.25rem;
}

/* Umschalter Liste | Karte im Balken */
.lm-list-hero .lm-view-switch .btn {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.lm-list-hero .lm-view-switch .btn.btn-primary {
    border-color: #fff;
    background: #fff;
    color: var(--lm-list-hero-navy);
    font-weight: 600;
}

.lm-list-hero .lm-view-switch .btn:not(.btn-primary):hover {
    background: rgba(255, 255, 255, 0.14);
}

.lm-list-hero-subtitle {
    margin: 0.35rem 0 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.875rem;
}

/* Tabellenkarte unter dem Balken */
.lm-list-card {
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 12px 32px -24px rgba(5, 26, 51, 0.45);
}

.lm-list-card > .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
}

.lm-list-card .table {
    margin-bottom: 0;
}

.lm-list-card .table > thead th {
    border-bottom-width: 1px;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lm-list-card .table > :not(caption) > * > *:first-child {
    padding-left: 1rem;
}

.lm-list-card .table > :not(caption) > * > *:last-child {
    padding-right: 1rem;
}

.lm-list-card .lm-list-actions {
    text-align: right;
    white-space: nowrap;
}

.lm-list-card > .card-footer,
.lm-list-card .lm-list-pagination {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: transparent;
}

.lm-list-card .lm-list-pagination .pagination {
    margin-bottom: 0;
}

.lm-list-empty {
    padding: 2.5rem 1rem;
    color: #6c757d;
    text-align: center;
}

.lm-list-empty > i {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    opacity: 0.5;
}

/* Hinweise und Knöpfe in Filtern, die nicht über .filter-btns laufen (z. B. Modellpflege) */
.lm-list-hero-filter .form-text,
.lm-list-hero-filter .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.lm-list-hero-filter .btn-primary {
    border-color: #fff;
    background: #fff;
    color: var(--lm-list-hero-navy);
    font-weight: 600;
}

.lm-list-hero-filter .btn-outline-secondary,
.lm-list-hero-filter .btn-white,
.lm-list-hero-filter .btn-light {
    border-color: rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
}

.lm-list-hero-filter .filter-btns .btn-white {
    border-color: #fff;
    background: #fff;
    color: var(--lm-list-hero-navy);
}
