/* =========================
   Notifications page
   ========================= */

.notifications-page {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header */

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.notifications-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.notifications-header .page-title {
    margin: 0;
    font-size: 1.6rem;
}

.notifications-header .page-subtitle {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Header meta */

.notifications-header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.notifications-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.8);
    background-color: rgba(15, 23, 42, 0.9);
    font-size: 0.8rem;
    max-width: 100%;
    box-sizing: border-box;
}

.notifications-count-badge strong {
    font-weight: 700;
}

/* Inline forms */

.notifications-inline-form {
    margin: 0;
    max-width: 100%;
}

/* Alerts */

.alert {
    border-radius: 0.9rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
}

.alert.error {
    background-color: rgba(127, 29, 29, 0.85);
    border-color: rgba(248, 113, 113, 0.8);
    color: #fee2e2;
}

.alert.success {
    background-color: rgba(22, 101, 52, 0.85);
    border-color: rgba(52, 211, 153, 0.9);
    color: #dcfce7;
}

/* Main card */

.notifications-card {
    border-radius: 1.1rem;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(148, 163, 184, 0.5);
    background-color: rgba(15, 23, 42, 0.92);
    padding: 0.8rem 0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(18px);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Toolbar */

.notifications-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    flex-wrap: wrap;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    padding-top: 0.1rem;
    padding-bottom: 0.75rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgba(30, 64, 175, 0.35);
    box-sizing: border-box;
}

.notifications-toolbar-button {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-top: 0.3rem;
    padding-bottom: 0.35rem;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition-property: background-color, border-color, color, transform, box-shadow, opacity;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
    border-color: rgba(148, 163, 184, 0.85);
    background-color: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
    max-width: 100%;
    box-sizing: border-box;
}

.notifications-toolbar-button:hover {
    transform: translateY(-1px);
}

.notifications-toolbar-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.notifications-toolbar-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.notifications-toolbar-primary {
    border-color: rgba(56, 189, 248, 0.95);
    background-color: rgba(30, 64, 175, 0.96);
    color: #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.9);
}

.notifications-toolbar-primary:hover {
    background-color: rgba(59, 130, 246, 0.98);
    border-color: rgba(191, 219, 254, 0.98);
}

.notifications-toolbar-danger {
    border-color: rgba(248, 113, 113, 0.85);
    background-color: rgba(127, 29, 29, 0.9);
    color: #fee2e2;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.9);
}

.notifications-toolbar-danger:hover {
    background-color: rgba(153, 27, 27, 0.95);
    border-color: rgba(252, 165, 165, 0.95);
}

/* Empty state */

.notifications-empty {
    margin: 0;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    padding-top: 1.15rem;
    padding-bottom: 1.25rem;
    font-size: 0.9rem;
    opacity: 0.9;
    box-sizing: border-box;
}

/* List wrapper */

.notifications-list {
    list-style-type: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar */

.notifications-list::-webkit-scrollbar {
    width: 7px;
}

.notifications-list::-webkit-scrollbar-track {
    background-color: rgba(15, 23, 42, 0.95);
}

.notifications-list::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.95);
    border-radius: 999px;
}

/* Notification row */

.notification-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) auto;
    gap: 0.85rem;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: rgba(30, 64, 175, 0.35);
    transition-property: background-color;
    transition-duration: 120ms;
    transition-timing-function: ease-out;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.notification-row:last-child {
    border-bottom-width: 0;
    border-bottom-style: none;
    border-bottom-color: transparent;
}

/* Unread vs read */

.notification-unread {
    background-color: rgba(30, 64, 175, 0.32);
}

.notification-read {
    background-color: transparent;
}

.notification-row:hover {
    background-color: rgba(30, 64, 175, 0.55);
}

/* Main column */

.notification-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

/* Title + time */

.notification-title-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.notification-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
}

.notification-created-at {
    font-size: 0.78rem;
    opacity: 0.8;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Body text */

.notification-body {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
    word-break: break-word;
}

/* CTA */

.notification-cta {
    margin-top: 0.25rem;
}

.notification-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(56, 189, 248, 1);
    background-image: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.6), rgba(37, 99, 235, 1));
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.95);
    transition-property: transform, box-shadow, filter;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
    max-width: 100%;
    box-sizing: border-box;
}

.notification-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.98);
    filter: brightness(1.05);
}

.notification-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.9);
}

/* Actions column */

.notification-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: 0.5rem;
    min-width: 0;
}

.notification-actions .notifications-inline-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
    max-width: 100%;
}

/* Action buttons */

.notification-action-button {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.35rem;
    padding-bottom: 0.38rem;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition-property: background-color, border-color, color, transform, box-shadow;
    transition-duration: 140ms;
    transition-timing-function: ease-out;
    max-width: 100%;
    box-sizing: border-box;
}

.notification-action-button:hover {
    transform: translateY(-1px);
}

.notification-action-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.notification-action-primary {
    border-color: rgba(56, 189, 248, 0.95);
    background-color: rgba(30, 64, 175, 0.96);
    color: #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.9);
}

.notification-action-primary:hover {
    background-color: rgba(59, 130, 246, 0.98);
    border-color: rgba(191, 219, 254, 0.98);
}

.notification-action-secondary {
    border-color: rgba(148, 163, 184, 0.85);
    background-color: rgba(15, 23, 42, 0.98);
    color: #e5e7eb;
}

.notification-action-secondary:hover {
    border-color: rgba(209, 213, 219, 0.9);
    background-color: rgba(31, 41, 55, 0.98);
}

.notification-action-danger {
    border-color: rgba(248, 113, 113, 0.85);
    background-color: rgba(127, 29, 29, 0.9);
    color: #fee2e2;
}

.notification-action-danger:hover {
    border-color: rgba(252, 165, 165, 0.95);
    background-color: rgba(153, 27, 27, 0.95);
}

/* =========================
   Mobile responsiveness
   ========================= */

@media (max-width: 960px) {
    .notifications-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .notifications-header-meta {
        flex-wrap: wrap;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .notifications-page {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .notifications-toolbar {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .notification-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .notification-title-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .notification-created-at {
        align-self: flex-start;
        white-space: normal;
    }

    .notification-actions {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .notification-actions .notifications-inline-form {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .notifications-card {
        border-radius: 0.95rem;
    }

    .notification-row {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .notifications-toolbar {
        gap: 0.45rem;
    }

    .notifications-toolbar .notifications-inline-form {
        width: 100%;
    }

    .notifications-toolbar-button {
        width: 100%;
        justify-content: center;
    }

    .notification-actions .notifications-inline-form {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }

    .notification-action-button,
    .notification-cta-button {
        width: 100%;
        justify-content: center;
    }
}