/* public/assets/css/s25-notifications.css
   KHMER HRMS — Notifications & Announcements (S25)
   Follows the Premium UI spec (Master List §4): soft shadows, 8px
   spacing scale, CSS-variable theming only (day/night safe), same
   dropdown mechanics already used by .lang-menu / .user-menu in
   layouts/main.php (show/hide via an `.open` class toggled by JS,
   never inline style="display:"). */

/* ── Top-bar bell trigger + unread dot ─────────────────────────── */
.notif-menu { position: relative; }

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}

/* ── Dropdown panel ─────────────────────────────────────────────── */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius, 14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
    z-index: 60;
}
.notif-dropdown:not(.open) { display: none !important; }
.notif-dropdown.open { display: flex; }

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-dropdown-header h4 { margin: 0; font-size: 14px; font-weight: 700; }
.notif-dropdown-header button {
    background: none; border: none; cursor: pointer;
    color: var(--primary); font-size: 12px; font-weight: 600; padding: 4px;
}

.notif-dropdown-list { overflow-y: auto; flex: 1; }

.notif-dropdown-item {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.notif-dropdown-item:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.notif-dropdown-item.is-unread { background: color-mix(in srgb, var(--primary) 9%, transparent); }

.notif-dropdown-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}
.notif-dropdown-icon svg { width: 16px; height: 16px; }

.notif-dropdown-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.notif-dropdown-message {
    font-size: 12px; color: var(--text-muted);
    line-height: 1.35; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-dropdown-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.notif-dropdown-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.notif-dropdown-empty svg { width: 32px; height: 32px; opacity: 0.4; margin-bottom: 8px; }

.notif-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-dropdown-footer a { font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }

@media (max-width: 575px) {
    .notif-dropdown { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}

/* ── Standalone /notifications page ─────────────────────────────── */
.notif-page-list { display: flex; flex-direction: column; gap: 8px; }

.notif-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s, transform 0.15s;
}
.notif-row:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); transform: translateY(-1px); }
.notif-row-unread { border-left: 3px solid var(--primary); }

.notif-row-icon {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}
.notif-row-icon svg { width: 18px; height: 18px; }

.notif-row-body { flex: 1; min-width: 0; text-decoration: none; color: var(--text); }
.notif-row-title { font-size: 14px; font-weight: 700; }
.notif-row-message { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.notif-row-time { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.notif-row-delete-form { flex-shrink: 0; }
.notif-row-delete-form .icon-btn { color: var(--text-muted); }
.notif-row-delete-form .icon-btn:hover { color: var(--danger, #dc2626); }

/* ── Top-bar shortcuts: Chat + Social Feed (desktop only) ───────────
   Mobile/tablet already reach both via the bottom nav and the sidebar,
   so these are hidden below the same 992px breakpoint the sidebar uses. */
.top-bar-link { position: relative; text-decoration: none; }
.top-bar-link.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface-alt));
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.top-bar-link.active:hover { color: #fff; }
@media (max-width: 991px) {
    .top-bar-desktop-only { display: none !important; }
}
