/* ===== NOTIFICATION DROPDOWN (PRISM) =====
   Prism-styled rules for the navbar notification dropdown. The dropdown panel,
   header, and item base styling are inherited from .prism-navbar in
   prism-common.css; this file styles the dynamic content inserted by
   notifications.js (day headers, item states, mark-read button, etc.) and the
   responsive layout. */

/* ===== DROPDOWN PANEL SIZING ===== */
#notification-dropdown {
    max-height: 600px;
    min-width: 360px;
    padding: 0;
    overflow: visible;
}

/* ===== SCROLLABLE LIST ===== */
.notifications-container {
    max-height: 500px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px;
    margin: 0;
}

.notifications-container::-webkit-scrollbar {
    width: 6px;
}

.notifications-container::-webkit-scrollbar-track {background: var(--prism-surface-2);
    border-radius: 3px;
}

.notifications-container::-webkit-scrollbar-thumb {background: var(--prism-fill-1);
    border-radius: 3px;
}

.notifications-container::-webkit-scrollbar-thumb:hover {
    background: rgba(29, 140, 248, 0.5);
}

/* ===== DAY HEADER ("Today", "Monday", etc.) ===== */
.notification-day-header {
    padding: 10px 10px 4px;
    margin: 6px 0 2px;
    color: var(--prism-accent-text);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;border-top: 1px solid var(--prism-accent-border);
}

.notification-day-header:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 4px;
}

/* ===== NOTIFICATION ITEM CARD ===== */
.notifications-container .notification-item {
    list-style: none;
    margin: 4px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.notifications-container .notification-item:hover {background: var(--prism-tint-3);
    transform: translateX(2px);
}

.notifications-container .notification-item.unread {background: var(--prism-tint-2);
}

.notifications-container .notification-item.unread:hover {
    background: rgba(29, 140, 248, 0.16);
}

.notifications-container .notification-item.read {
    background: transparent;
    opacity: 0.7;
}

.notifications-container .notification-item.read:hover {
    background: rgba(255, 255, 255, 0.04);
    opacity: 1;
}

.white-content .notifications-container .notification-item {
    background: rgba(29, 140, 248, 0.04);
}

.white-content .notifications-container .notification-item.read:hover {
    background: rgba(29, 140, 248, 0.05);
}

/* Type icon (rendered with inline color from JS) */
.notifications-container .notification-item .tim-icons {
    font-size: 1rem;
    margin-right: 0;
    flex-shrink: 0;
}

/* ===== CONTENT LAYOUT ===== */
.notifications-container .notification-content {
    flex: 1;
    min-width: 0;
    margin-left: 12px;
}

.notifications-container .notification-text {
    font-size: 0.85rem;
    line-height: 1.4;color: var(--prism-text);
    word-break: break-word;
}

.notifications-container .notification-item.read .notification-text {color: var(--prism-text-dim);
}

.notifications-container .notification-item small {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;color: var(--prism-text-dim);
}

/* Inline asset link inside the notification text */
.notifications-container .notification-text a {
    color: var(--prism-accent-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.notifications-container .notification-text a:hover {
    color: var(--prism-accent-text);
    text-decoration: underline;
}

.white-content .notifications-container .notification-text a {
    color: var(--prism-accent-text);
}

/* ===== MARK AS READ / UNREAD BUTTON ===== */
.notification-item .btn-link {
    padding: 4px 8px;
    flex-shrink: 0;color: var(--prism-text-dim);
    background: transparent;
    border: none;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.notification-item .btn-link:hover {
    background: rgba(0, 242, 195, 0.15);color: var(--prism-success);
}

.notification-item .btn-link .tim-icons {
    font-size: 0.95rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.notification-item .btn-link:hover .tim-icons {color: var(--prism-success);
    transform: scale(1.15);
}

/* ===== EMPTY STATE ===== */
#no-notifications {
    padding: 28px 16px;
    text-align: center;color: var(--prism-text-dim);
    font-size: 0.85rem;
    list-style: none;
}

/* ===== TOAST CONTAINER (separate UI element, not the dropdown) ===== */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clear the drawer by reading its width, not by restating it. This was a flat
   620px -- 600 + 20, the drawer's CAP plus this container's own gutter -- which
   was already wrong at every viewport under 2400px, where the clamp had not
   reached that cap: on a 1728px screen the toasts floated ~190px off the
   drawer's edge. Now that the drawer is drag-resizable there is no literal
   that could be right. */
body.right-sidebar-open #notification-container {
    right: calc(var(--rsb-w) + 20px);
}

/* Toasts are time-based, so one can perfectly well be on screen mid-drag --
   and the `transition: right` above, matched to the drawer's own 0.4s so the
   two glide together on open, then makes it lag a pointer it should be
   tracking. Same reasoning and same class as the drawer, the .main-panel
   padding and the scroll rail in prism-common.css; it lives here because the
   rule it cancels lives here. */
body.rsb-resizing #notification-container {
    transition: none;
}

@media (max-width: 768px) {
    body.right-sidebar-open #notification-container {
        right: 20px;
    }
}

/* ===== MISC LEGACY UTILITY ===== */
.badge-success-visible {
    color: #ffffff;
    background-color: #1f5714;
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    #notification-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        min-width: auto !important;
        max-width: none !important;
        transform: none !important;
        margin: 0 !important;
    }

    .notifications-container .notification-item {
        padding: 10px 12px;
    }

    .notifications-container .notification-text {
        font-size: 0.85rem;
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }

    .notifications-container .notification-item .d-flex {
        width: 100%;
        min-width: 0;
    }
}

@media screen and (max-width: 576px) {
    #notification-dropdown {
        top: 50px !important;
        left: 5px !important;
        right: 5px !important;
        width: calc(100vw - 10px) !important;
    }

    .notifications-container .notification-item {
        padding: 8px 10px;
    }

    .notifications-container .notification-text {
        font-size: 0.8rem;
    }
}
