/* Bitfeder Access – global styles */
/* MudBlazor übernimmt das Design-System (Theme/BitfederTheme.cs), hier nur projektspezifische Overrides */
/* Brand: Teal #32C8C5 / Navy #111B30 */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================= AppBar ================= */

.mud-appbar {
    box-shadow: none !important;
}

/* Teal-Keyline als Marken-Signatur unter der AppBar */
.bf-appbar {
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-appbar-background) !important;
    position: relative;
}
.bf-appbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, #32C8C5 0%, rgba(50,200,197,0.35) 35%, transparent 70%);
    pointer-events: none;
}

/* Brand-Dot mit Glow */
.bf-brand-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #32C8C5;
    box-shadow: 0 0 8px rgba(50,200,197,0.8);
}
.bf-brand-dot-lg {
    width: 12px; height: 12px;
    box-shadow: 0 0 14px rgba(50,200,197,0.9);
}

/* Kopf-Links-Zone (Menübutton + Marke) exakt auf Drawer-Breite, Trennlinie in der Menü-Flucht.
   Toolbar-Padding links entfernen, damit die Zone bei viewport-x = 240px (Drawer-Rand) endet. */
.bf-appbar .mud-toolbar { padding-left: 0 !important; }
.bf-headleft {
    display: flex; align-items: center; height: 100%;
    width: 240px; box-sizing: border-box;                 /* = Drawer-Breite */
    padding-left: 2px;
    border-right: 1px solid var(--mud-palette-divider);
    margin-right: 20px;                                    /* Abstand zu „Mein Bereich" */
}
/* Marke näher an den Menübutton (weiter links) */
.bf-headleft .bf-brand { margin-left: 0 !important; }
.bf-headleft .mud-button-root.mud-icon-button { margin-right: -4px; }

/* Marke: pulsierendes Feder-Logo + Name (BitFeder / Kronox) */
.bf-brand-logo {
    width: 75px; height: 75px;
    object-fit: contain;
    animation: bf-logo-pulse 2.2s ease-in-out infinite;
}
@keyframes bf-logo-pulse {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(50,200,197,0.45)); opacity: 0.92; }
    50%      { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(50,200,197,0.95)); opacity: 1; }
}
/* BitFeder voll, Kronox klein darunter, mittig zentriert */
.bf-brand-text { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.bf-brand-name {
    font-weight: 700; font-size: 1.35rem; line-height: 1; letter-spacing: -0.01em;
    color: var(--mud-palette-text-primary);
}
.bf-brand-product {
    font-weight: 600; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
    color: #32C8C5; margin-top: 3px;
}

/* Header ~15% höher (48px -> 55px), Content-Versatz mitziehen */
.bf-appbar, .bf-appbar .mud-toolbar { min-height: 55px !important; }
.mud-layout .mud-main-content { padding-top: 55px !important; }

/* Header-Hauptbereiche */
.bf-areas { gap: 4px; align-items: center; }
.bf-area {
    text-transform: none !important;
    color: var(--mud-palette-text-secondary) !important;
    border-radius: 8px !important;
    font-weight: 500;
}
.bf-area:hover { background: rgba(50,200,197,0.08) !important; }
.bf-area-active {
    color: var(--mud-palette-primary) !important;
    background: rgba(50,200,197,0.12) !important;
    font-weight: 700;
}
.bf-gear-active { color: var(--mud-palette-primary) !important; background: rgba(50,200,197,0.12); }

/* Team-Abwesenheitskalender */
/* width:max-content statt 100%: bei table-layout:fixed teilen sich sonst die 28–31
   Tagesspalten die Breite und drücken die Namensspalte zusammen. So behält jede Spalte
   ihre Wunschbreite, und der umgebende Container scrollt bei Bedarf horizontal. */
.bf-cal { border-collapse: collapse; font-size: 0.75rem; width: max-content; min-width: 100%; table-layout: fixed; }
.bf-cal th, .bf-cal td {
    border: 1px solid var(--mud-palette-divider);
    width: 26px; height: 28px; text-align: center; padding: 0;
    font-variant-numeric: tabular-nums;
}
.bf-cal th { font-weight: 600; color: var(--mud-palette-text-secondary); }
.bf-cal .bf-cal-name {
    width: 240px; max-width: 240px; text-align: left; padding: 0 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: sticky; left: 0;
    background: var(--mud-palette-surface); z-index: 1;
}
.bf-cal .bf-cal-we { background: rgba(128,128,128,0.10); }
.bf-cal td { font-weight: 700; }

/* ================= Navigation ================= */

/* Aktiver Link: Teal-Pill statt nur Border */
.mud-nav-link.active {
    border-left: 3px solid #32C8C5;
    padding-left: calc(16px - 3px) !important;
    font-weight: 600;
    background: rgba(50,200,197,0.10);
}
.mud-nav-link.active .mud-nav-link-text {
    color: var(--mud-palette-primary) !important;
}
.mud-nav-link.active .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}
.mud-nav-link {
    border-radius: 0 10px 10px 0;
    margin-right: 8px;
    transition: background-color 120ms ease;
}

/* ================= Tabellen & Karten ================= */

.mud-table-head .mud-table-cell {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
}

/* Ziffern in Tabellen sauber untereinander */
.mud-table-cell {
    font-variant-numeric: tabular-nums;
}

/* Karten/Paper: feiner Rand, sanfter Hover-Lift */
.mud-paper:not(.mud-dialog):not(.mud-appbar):not(.mud-drawer) {
    border: 1px solid var(--mud-palette-divider);
    box-shadow: 0 1px 2px rgba(17,27,48,0.05);
    transition: box-shadow 160ms ease, transform 160ms ease;
}

/* Chip ohne Uppercase */
.mud-chip-label {
    text-transform: none;
    font-weight: 500;
}

/* Wochentag-Chips (Zeitprofile) */
.bf-day-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-disabled);
    background: transparent;
    border: 1px solid var(--mud-palette-divider);
}
.bf-day-chip-on {
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
}

/* ================= Seiten-Einstieg ================= */

@keyframes bf-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.bf-page {
    animation: bf-fade-up 240ms ease-out;
}

/* ================= Login ================= */

.bf-login {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Bewusst einfarbige Marken-Welt: Navy, unabhängig vom App-Theme */
    background:
        radial-gradient(1100px 600px at 80% -10%, #16294A 0%, transparent 60%),
        linear-gradient(160deg, #111B30 0%, #0A101D 100%);
}
.bf-login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
}
.bf-login-glow-1 {
    width: 460px; height: 460px;
    background: #32C8C5;
    top: -160px; left: -120px;
    animation: bf-drift 14s ease-in-out infinite alternate;
}
.bf-login-glow-2 {
    width: 380px; height: 380px;
    background: #1A5F7A;
    bottom: -140px; right: -100px;
    animation: bf-drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes bf-drift {
    from { transform: translate3d(0,0,0) scale(1); }
    to   { transform: translate3d(40px, 24px, 0) scale(1.08); }
}
.bf-login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(50,200,197,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(50,200,197,0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 0%, transparent 75%);
    pointer-events: none;
}

.bf-login-card {
    position: relative;
    width: min(400px, calc(100vw - 32px));
    padding: 40px 36px 32px;
    border-radius: 16px;
    background: rgba(19,31,56,0.75);
    border: 1px solid rgba(50,200,197,0.18);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(4,8,16,0.55);
    animation: bf-fade-up 320ms ease-out;
}
.bf-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bf-login-logo {
    height: 72px;
    width: auto;
    /* Das PNG hat viel transparenten Rand (Feder ~35 % der Bildhöhe, zentriert) —
       ohne Skalierung wirkt sie winzig. transform ändert das Layout der Zeile nicht. */
    transform: scale(2.4);
    transform-origin: center;
    filter: drop-shadow(0 0 10px rgba(50,200,197,0.45));
}
/* Theme-Umschalter oben rechts in der Login-/Invite-Karte */
.bf-login-theme {
    position: absolute;
    top: 14px; right: 14px;
    color: rgba(126,207,205,0.75) !important;
}
.bf-login-wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #E8F4F4;
}
.bf-login-wordmark span {
    font-weight: 400;
    color: #7ECFCD;
}
.bf-login-tagline {
    margin-top: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #5A7A8A;
}
.bf-login-footer {
    position: relative;
    margin-top: 28px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(126,207,205,0.45);
}

/* Login-Felder: auf die Navy-Karte abgestimmt, unabhängig vom App-Theme */
.bf-login-card .mud-input-outlined .mud-input-outlined-border { border-color: rgba(126,207,205,0.25); }
.bf-login-card .mud-input-outlined:hover .mud-input-outlined-border { border-color: rgba(126,207,205,0.5); }
.bf-login-card .mud-input.mud-input-outlined input,
.bf-login-card .mud-input-label,
.bf-login-card .mud-icon-root { color: #C8E0E0; }
.bf-login-card .mud-input-label.mud-input-label-inputcontrol { color: #7A9AA8; }
.bf-login-submit {
    height: 46px;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(50,200,197,0.25);
}

/* ---- Login/Invite im HELLEN Theme (data-theme wird in Routes.razor gesetzt) ---- */
:root[data-theme="light"] .bf-login {
    background:
        radial-gradient(1100px 600px at 80% -10%, #DCEEEE 0%, transparent 60%),
        linear-gradient(160deg, #F3F7F8 0%, #E7EEF0 100%);
}
:root[data-theme="light"] .bf-login-glow { opacity: 0.16; }
:root[data-theme="light"] .bf-login-glow-2 { background: #7ECFCD; }
:root[data-theme="light"] .bf-login-grid {
    background-image:
        linear-gradient(rgba(17,27,48,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17,27,48,0.05) 1px, transparent 1px);
}
:root[data-theme="light"] .bf-login-card {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(50,200,197,0.28);
    box-shadow: 0 24px 60px rgba(17,27,48,0.12);
}
:root[data-theme="light"] .bf-login-wordmark { color: #111B30; }
:root[data-theme="light"] .bf-login-wordmark span { color: #1A9E9B; }
:root[data-theme="light"] .bf-login-tagline { color: #5A7A8A; }
:root[data-theme="light"] .bf-login-footer { color: rgba(90,122,138,0.7); }
:root[data-theme="light"] .bf-login-theme { color: rgba(26,158,155,0.9) !important; }
:root[data-theme="light"] .bf-login-logo { filter: drop-shadow(0 0 8px rgba(50,200,197,0.3)); }
/* Eingabefelder auf helle Karte abstimmen */
:root[data-theme="light"] .bf-login-card .mud-input-outlined .mud-input-outlined-border { border-color: rgba(17,27,48,0.18); }
:root[data-theme="light"] .bf-login-card .mud-input-outlined:hover .mud-input-outlined-border { border-color: rgba(50,200,197,0.6); }
:root[data-theme="light"] .bf-login-card .mud-input.mud-input-outlined input,
:root[data-theme="light"] .bf-login-card .mud-icon-root { color: #111B30; }
:root[data-theme="light"] .bf-login-card .mud-input-label,
:root[data-theme="light"] .bf-login-card .mud-input-label.mud-input-label-inputcontrol { color: #5A7A8A; }

/* FocusOnNavigate fokussiert die Seitenüberschrift programmatisch (tabindex=-1, per Tab
   NICHT erreichbar) — der Fokus-Rahmen ist dort nur störend (v. a. im hellen Theme). */
h1:focus, h4:focus,
h1[tabindex]:focus, h4[tabindex]:focus { outline: none !important; box-shadow: none !important; }

/* ================= Status & Feedback ================= */

/* Statusdot-Animation für Online-Status */
@keyframes pulse-teal {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.status-dot-online {
    animation: pulse-teal 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(63,185,80,0.6));
}

/* Blazor-Fehler-Overlay */
.blazor-error-boundary {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem 1rem 1rem 3.5rem;
    color: #ef4444;
}
.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10b981;
}
.invalid {
    outline: 1px solid #ef4444;
}
.validation-message {
    color: #ef4444;
    font-size: 0.8rem;
}

/* ================= A11y & Feinschliff ================= */

:focus-visible {
    outline: 2px solid #32C8C5;
    outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: rgba(90,122,138,0.35);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(50,200,197,0.5); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
    .bf-page, .bf-login-card { animation: none; }
    .bf-login-glow-1, .bf-login-glow-2 { animation: none; }
    .status-dot-online { animation: none; }
}
