/* ============================================
   Notification Panel — notif.css
   Mirrors chat.css animation / z-index pattern
   ============================================ */

/* Badge do sino — classe própria para não ser afetado pelo chat.js */
.header-notif-badge {
    position: absolute !important;
    top: -4px !important;
    right: 15px !important;
    min-width: 16px !important;
    height: 16px !important;
    background: #ee8a04 !important;
    border-radius: 8px !important;
    border: 1.5px solid #000 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #fff !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    line-height: 16px !important;
    font-family: 'Roboto', sans-serif !important;
    text-align: center !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
}

/* Overlay */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.notif-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Panel */
.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    background: #000;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.7);
}
.notif-panel.open {
    transform: translateX(0);
}

/* Panel header */
.notif-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 56px;
    background: #0a0a0a;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
}

.notif-panel-title {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    letter-spacing: 0.3px;
}

/* Mark all read button */
.notif-mark-read-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #888;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
    padding: 5px 10px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.notif-mark-read-btn:hover {
    color: #ee8a04;
    border-color: #ee8a04;
}
.notif-mark-read-btn svg {
    flex-shrink: 0;
}

/* Close button */
.notif-panel-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #aaa;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.notif-panel-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: rotate(90deg);
}

/* Retention info bar */
.notif-retention-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 5px 14px;
    background: #0e0e0e;
    border-bottom: 1px solid #1a1a1a;
    font-family: 'Roboto', sans-serif;
    font-size: 10.5px;
    color: #444;
    text-align: left;
    flex-shrink: 0;
}
.notif-retention-bar svg {
    flex-shrink: 0;
    color: #383838;
}

/* Scrollable notification list */
.notif-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #000;
}
.notif-list::-webkit-scrollbar {
    width: 4px;
}
.notif-list::-webkit-scrollbar-track {
    background: transparent;
}
.notif-list::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}

/* Notification item */
.notif-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #0a0a0a;
    border-bottom: 5px solid #000;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.notif-item:hover {
    background: #1e1e1e;
}
.notif-item:last-child {
    border-bottom: none;
}

/* Unread indicator dot */
.notif-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ee8a04;
    flex-shrink: 0;
    transition: opacity 0.3s;
}
.notif-unread-dot--hidden {
    opacity: 0;
}

/* Avatar */
.notif-avatar {
    flex-shrink: 0;
}
.notif-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.notif-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2a2a2a;
}
.notif-avatar-placeholder--square {
    border-radius: 6px;
}
.notif-avatar-img--event {
    border-radius: 6px !important;
    object-fit: cover;
}

/* Text content */
.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-name {
    margin: 0 !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-action {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1px;
}
.notif-time {
    display: block;
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    color: #444;
    margin-top: 2px;
}

/* Unread item highlight */
.notif-item--unread {
    background: #0a0a0a;
}
.notif-item--unread:hover {
    background: #1a1a1a;
}

/* Empty state */
.notif-empty {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 24px;
}
.notif-empty p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #555;
    text-align: center;
}

/* Loading skeleton */
.notif-skeleton {
    padding: 14px 16px;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    gap: 12px;
}
.notif-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e1e1e;
    flex-shrink: 0;
    animation: notifPulse 1.4s ease infinite;
}
.notif-skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notif-skeleton-line {
    height: 10px;
    border-radius: 4px;
    background: #1e1e1e;
    animation: notifPulse 1.4s ease infinite;
}
.notif-skeleton-line:last-child {
    width: 55%;
}

@keyframes notifPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Settings section */
.notif-settings {
    border-top: 1px solid #1a1a1a;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #0e0e0e;
    flex-shrink: 0;
}
.notif-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
}
.notif-setting-row + .notif-setting-row {
    border-top: none;
}
.notif-setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.notif-setting-name {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #ccc;
}
.notif-setting-hint {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    color: #444;
}

/* Toggle switch */
.notif-toggle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}
.notif-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.notif-toggle-slider {
    display: block;
    width: 34px;
    height: 18px;
    background: #2a2a2a;
    border-radius: 18px;
    transition: background 0.2s;
    position: relative;
}
.notif-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #555;
    transition: transform 0.2s, background 0.2s;
}
.notif-toggle-input:checked + .notif-toggle-slider {
    background: rgba(238, 138, 4, 0.25);
}
.notif-toggle-input:checked + .notif-toggle-slider::after {
    transform: translateX(16px);
    background: #ee8a04;
}

@media (max-width: 400px) {
    .notif-panel {
        width: 100vw;
    }
}
