/* PWA-spezifische Stile. Farben und Grundbausteine kommen aus _content/LinTifsTracking.Ui/css/tracking.css. */

html,
body {
    margin: 0;
    overscroll-behavior-y: contain;
}

/* Ladebildschirm vor dem Start von Blazor. */
.lt-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    height: 100vh;
    background: linear-gradient(135deg, #143C70 0%, #1B4F93 55%, #2563AE 100%);
    color: #ffffff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.lt-start img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.lt-start-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.lt-start-balken {
    width: 120px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.lt-start-balken::after {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    background: #ffffff;
    animation: lt-laden 1.2s ease-in-out infinite;
}

@keyframes lt-laden {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

/* ---- Kopfzeile ------------------------------------------------------------------------------------------------ */

.lt-appbar.mud-appbar {
    background: var(--lt-verlauf);
    box-shadow: 0 2px 8px rgba(15, 42, 77, 0.25);
}

.lt-marke {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lt-marke img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.lt-marke-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.lt-marke-name {
    font-weight: 600;
    font-size: 1rem;
}

.lt-marke-projekt {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Untere Navigation (Daumenbedienung) ----------------------------------------------------------------- */

.lt-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-around;
    background: #ffffff;
    border-top: 1px solid var(--lt-grau-200);
    box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.05);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.lt-bottomnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--lt-grau-700);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Aktiver Eintrag: Pille hinter dem Symbol. */
.lt-bottomnav .lt-nav-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 30px;
    border-radius: 15px;
    transition: background-color 0.15s ease;
}

.lt-bottomnav a.active {
    color: var(--lt-blau-700);
    font-weight: 600;
}

.lt-bottomnav a.active .lt-nav-symbol {
    background: var(--lt-blau-100);
}

.lt-inhalt {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* ---- Start: Kacheln ------------------------------------------------------------------------------------------ */

.lt-gruss {
    margin: 4px 0 2px;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--lt-grau-900);
}

.lt-hauptaktion {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 16px;
    background: var(--lt-verlauf);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(27, 79, 147, 0.28);
    -webkit-tap-highlight-color: transparent;
}

.lt-hauptaktion:active {
    transform: scale(0.99);
}

.lt-hauptaktion-symbol {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
}

.lt-hauptaktion-titel {
    font-size: 1.1875rem;
    font-weight: 600;
}

.lt-hauptaktion-text {
    font-size: 0.875rem;
    opacity: 0.85;
}

.lt-kacheln {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lt-kachel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--lt-radius);
    background: #ffffff;
    border: 1px solid var(--lt-grau-200);
    box-shadow: var(--lt-schatten);
    color: var(--lt-grau-900);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.lt-kachel:active {
    background: var(--lt-blau-50);
}

.lt-kachel-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--lt-blau-100);
    color: var(--lt-blau-700);
}

.lt-kachel-titel {
    font-weight: 600;
    font-size: 0.9375rem;
}

.lt-kachel-text {
    margin-top: -6px;
    color: var(--lt-grau-700);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.lt-kachel-marke {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ---- Listen (Equipments, Multiscan, Ausgang) ------------------------------------------------------------- */

.lt-liste {
    background: #ffffff;
    border: 1px solid var(--lt-grau-200);
    border-radius: var(--lt-radius);
    box-shadow: var(--lt-schatten);
    overflow: hidden;
}

.lt-zeile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid var(--lt-grau-200);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lt-zeile:first-child {
    border-top: 0;
}

.lt-zeile:active {
    background: var(--lt-blau-50);
}

.lt-zeile-inhalt {
    flex: 1;
    min-width: 0;
}

.lt-zeile-titel {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--lt-grau-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lt-zeile-text {
    margin-top: 2px;
    color: var(--lt-grau-700);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lt-punkt {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--lt-blau-700);
    vertical-align: middle;
}

.lt-punkt-grau {
    background: var(--lt-grau-300);
}

/* ---- Erfassung ----------------------------------------------------------------------------------------------- */

/* Melden-Knopf bleibt beim Scrollen über der unteren Navigation stehen. */
.lt-aktion-unten {
    position: sticky;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 5;
}

.lt-aktion-unten .mud-button-root {
    box-shadow: 0 8px 20px rgba(27, 79, 147, 0.30);
}

.lt-gross {
    min-height: 56px;
    font-size: 1rem;
}

.lt-scanner {
    position: relative;
    width: 100%;
    background: #0b1220;
    border-radius: var(--lt-radius);
    overflow: hidden;
    box-shadow: var(--lt-schatten-hoch);
}

.lt-scanner-video {
    display: block;
    width: 100%;
    max-height: 45vh;
    object-fit: cover;
}

/* Eckmarken statt Rechteck, dazu eine langsam laufende Scanlinie. */
.lt-scanner-rahmen {
    --farbe: rgba(255, 255, 255, 0.95);
    --laenge: 30px;
    --dicke: 4px;
    position: absolute;
    inset: 16% 20%;
    pointer-events: none;
    background:
        linear-gradient(var(--farbe), var(--farbe)) top left / var(--laenge) var(--dicke),
        linear-gradient(var(--farbe), var(--farbe)) top left / var(--dicke) var(--laenge),
        linear-gradient(var(--farbe), var(--farbe)) top right / var(--laenge) var(--dicke),
        linear-gradient(var(--farbe), var(--farbe)) top right / var(--dicke) var(--laenge),
        linear-gradient(var(--farbe), var(--farbe)) bottom left / var(--laenge) var(--dicke),
        linear-gradient(var(--farbe), var(--farbe)) bottom left / var(--dicke) var(--laenge),
        linear-gradient(var(--farbe), var(--farbe)) bottom right / var(--laenge) var(--dicke),
        linear-gradient(var(--farbe), var(--farbe)) bottom right / var(--dicke) var(--laenge);
    background-repeat: no-repeat;
}

.lt-scanner-rahmen::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    height: 2px;
    border-radius: 2px;
    background: rgba(42, 120, 214, 0.9);
    box-shadow: 0 0 12px rgba(42, 120, 214, 0.9);
    animation: lt-scanlinie 2.4s ease-in-out infinite alternate;
}

@keyframes lt-scanlinie {
    from { top: 10%; }
    to { top: 88%; }
}

.lt-vorschau {
    position: relative;
}

.lt-vorschau button {
    position: absolute;
    top: -8px;
    right: -8px;
}

/* ---- Anmeldung ----------------------------------------------------------------------------------------------- */

.lt-login {
    min-height: 100vh;
    background:
        linear-gradient(180deg, transparent 0, transparent 46vh, var(--lt-grau-100) 46vh),
        var(--lt-verlauf);
    padding: calc(48px + env(safe-area-inset-top)) 16px 32px;
}

.lt-login-marke {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    color: #ffffff;
    text-align: center;
}

.lt-login-marke img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.lt-login-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.lt-login-text {
    font-size: 0.9375rem;
    opacity: 0.85;
}

.lt-login-karte {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--lt-schatten-hoch);
}

/* ---- Hinweis auf eine neue Version (index.html) --------------------------------------------------------- */

.lt-update {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
    background: #0F2A4D;
    color: #ffffff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
}

.lt-update[hidden] {
    display: none;
}

.lt-update button {
    border: 1px solid #ffffff;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    padding: 6px 12px;
    font: inherit;
    cursor: pointer;
}

#blazor-error-ui {
    background: #FFF4E0;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .lt-start-balken::after,
    .lt-scanner-rahmen::after {
        animation: none;
    }

    .lt-bottomnav .lt-nav-symbol {
        transition: none;
    }
}
