/* ══════════════════════════════════════════════════════════════════════════
   SBF Phone Max — Notifications CSS  |  Liquid-Glass Stil
   ══════════════════════════════════════════════════════════════════════════ */

/* ── CSS-Variablen ──────────────────────────────────────────────────────── */
:root {
    --notif-glass: #bbbbbc;
    --notif-light: #ffffff;
    --notif-dark:  #000000;
    --notif-rl:    1;
    --notif-rd:    1;
}

/* ── Notification-Container im Lock Screen ──────────────────────────────── */
.notifications-container {
    position: absolute;
    top: 194px;
    left: 16px;                /* integer-px Positionierung — verhindert Sub-Pixel-Blur */
    right: 16px;
    height: 370px;             /* Festes sichtbares Limit — scrollbar ab hier */
    z-index: 1500;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    /* Maske dynamisch via JS (_updateMask) — kein statisches CSS */
}
.notifications-container::-webkit-scrollbar { display: none; }
.notifications-container { -ms-overflow-style: none; scrollbar-width: none; }

/* Lock-Screen-Aktionen: X (immer) + Entfernen (ausfahrend) */
.notif-lock-actions {
    position: absolute;
    top: 150px;
    right: 16px;
    z-index: 1800;
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.notif-lock-close,
.notif-lock-remove {
    border: 0;
    color: rgba(255, 255, 255, 0.96);
    background-color: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(1px) saturate(160%);
    -webkit-backdrop-filter: blur(1px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px           rgba(255, 255, 255, 0.16),
        inset 1.4px 1.8px 0 -2px  rgba(255, 255, 255, 0.40),
        inset -1.6px -1.6px 0 -2px rgba(255, 255, 255, 0.15),
        inset -0.3px -1px 4px 0   rgba(0, 0, 0, 0.15),
        0 1px 5px 0               rgba(0, 0, 0, 0.14),
        0 6px 16px 0              rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.notif-lock-close {
    width: 25px;
    height: 25px;
    border-radius: 25px;
    font-size: 21px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.notif-lock-remove {
    height: 23px;
    border-radius: 21px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    padding: 0 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(10px);
    pointer-events: none;
    transition: max-width 260ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 180ms ease,
                transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
                padding 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notif-lock-actions.notif-lock-actions-open .notif-lock-remove {
    max-width: 180px;
    padding: 0 12px;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Hover-Verhalten wie gewünscht: X blendet aus, Entfernen blendet ein */
.notif-lock-actions:hover .notif-lock-close {
    opacity: 0;
    pointer-events: none;
}

.notif-lock-actions:hover .notif-lock-remove {
    max-width: 180px;
    padding: 0 12px;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 16px;
    background-color: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(1px) saturate(160%);
    -webkit-backdrop-filter: blur(1px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px           rgba(255, 255, 255, 0.12),
        inset 1.8px 2px 0 -2px    rgba(255, 255, 255, 0.45),
        inset -2px -2px 0 -2px    rgba(255, 255, 255, 0.16),
        inset -3px -8px 1px -6px  rgba(255, 255, 255, 0.12),
        inset -0.3px -1px 4px 0   rgba(0, 0, 0, 0.12),
        inset -1.5px 2.5px 0 -2px rgba(0, 0, 0, 0.20),
        inset 0 3px 4px -2px      rgba(0, 0, 0, 0.20),
        inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.10),
        0 1px 5px 0               rgba(0, 0, 0, 0.10),
        0 6px 16px 0              rgba(0, 0, 0, 0.08);
    transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
                box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
    cursor: pointer;
    /* Scharfe Text-Darstellung trotz backdrop-filter und GPU-Layer */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.notification-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    align-self: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.notification-app {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.notification-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 6px;
}

.notification-message {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* ── Animations für neue Einträge ────────────────────────────────────────── */
.notif-slide-in {
    animation: notifSlideIn 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.notif-fade-out {
    animation: notifFadeOut 0.28s ease forwards;
}

@keyframes notifFadeOut {
    from { opacity: 1; transform: scale(1);    }
    to   { opacity: 0; transform: scale(0.95); }
}

/* ══════════════════════════════════════════════════════════════════════════
   Gruppen-Container (iOS-Stacking)
   ══════════════════════════════════════════════════════════════════════════ */

.notif-group {
    position: relative;
    margin-bottom: 8px;
}

/* Extra Abstand wenn Stack-Schatten nach unten ragt */
.notif-group[data-stack="1"] { margin-bottom: 18px; }
.notif-group[data-stack="2"] { margin-bottom: 26px; }

/* Stack-Schatten Ebene 1 (2+ Notifications in der Gruppe)
   clip-path sorgt dafür dass der Schatten NUR unterhalb der Front-Card
   sichtbar ist — kein Overlap mit dem semi-transparenten Hintergrund */
.notif-group[data-stack="1"]::before,
.notif-group[data-stack="2"]::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 5px;
    right: 5px;
    bottom: -8px;
    border-radius: 19px;
    background-color: rgba(187, 187, 188, 0.13);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
    z-index: 1;
    /* Zeigt nur die 10px die unterhalb der Front-Card herausragen */
    clip-path: inset(calc(100% - 10px) 0 0 0 round 0 0 16px 16px);
}

/* Stack-Schatten Ebene 2 (3+ Notifications in der Gruppe) */
.notif-group[data-stack="2"]::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 10px;
    right: 10px;
    bottom: -18px;
    border-radius: 21px;
    background-color: rgba(187, 187, 188, 0.09);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    z-index: 0;
    /* Zeigt nur die 18px die unterhalb der Front-Card herausragen */
    clip-path: inset(calc(100% - 18px) 0 0 0 round 0 0 16px 16px);
}

/* Icon-Wrapper: ermöglicht Badge-Positionierung */
.notif-icon-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    align-self: center;
}

/* Badge: weißer Kreis mit schwarzer Zahl oben rechts am Icon */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    font-size: 9px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    display: block;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    box-sizing: border-box;
}

/* Expanded-Items innerhalb einer Gruppe */
.notif-expanded-item {
    margin-bottom: 6px;
}

.notif-expanded-item:last-child {
    margin-bottom: 0;
}
/* ══════════════════════════════════════════════════════════════════════════ */
.notification-banner {
    position: absolute;
    top: 42px;       /* 10px weiter oben fuer entsperrte Banner-Notification */
    left: 12px;
    right: 12px;
    z-index: 9000;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    background-color: rgba(187, 187, 188, 0.14);
    backdrop-filter: blur(1px) saturate(160%);
    -webkit-backdrop-filter: blur(1px) saturate(160%);
    box-shadow:
        inset 0 0 0 1px           rgba(255, 255, 255, 0.12),
        inset 1.8px 2px 0 -2px    rgba(255, 255, 255, 0.45),
        inset -2px -2px 0 -2px    rgba(255, 255, 255, 0.16),
        inset -3px -8px 1px -6px  rgba(255, 255, 255, 0.12),
        inset -0.3px -1px 4px 0   rgba(0, 0, 0, 0.12),
        inset -1.5px 2.5px 0 -2px rgba(0, 0, 0, 0.20),
        inset 0 3px 4px -2px      rgba(0, 0, 0, 0.20),
        inset 2px -6.5px 1px -4px rgba(0, 0, 0, 0.10),
        0 1px 5px 0               rgba(0, 0, 0, 0.10),
        0 6px 16px 0              rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transform: none;
    opacity: 0;
    transition: opacity 0.24s ease;
    pointer-events: none;
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-clip: padding-box;
}

.notification-banner.notif-banner-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Lesbarkeits-Layer direkt am entsperrten Banner (bewegt sich mit der Notification). */
.notification-banner.notification-banner-unlocked {
    overflow: hidden;
    isolation: isolate;
    border-radius: 16px;
    contain: paint;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* Nochmal 50% staerker als vorher: 37.5% -> 56.25%. */
.notification-banner.notification-banner-unlocked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5625);
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.notification-banner.notification-banner-unlocked > * {
    position: relative;
    z-index: 1;
}

.notif-banner-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    align-self: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.notif-unlocked-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.notif-unlocked-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-unlocked-body {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}