/**
 * ESChE Member Notifications Page.
 *
 * Styles for the member-facing notifications interface.
 *
 * @package ESChE_Digital_Membership
 */

/* =========================================================
   Notifications Container
   ========================================================= */

.esche-notifications {
    --esche-notifications-primary: #1560BD;
    --esche-notifications-primary-light: #EAF2FC;
    --esche-notifications-text: #1F2937;
    --esche-notifications-muted: #6B7280;
    --esche-notifications-border: #E5E7EB;
    --esche-notifications-background: #FFFFFF;
    --esche-notifications-page-background: #F8FAFC;
    --esche-notifications-success: #166534;
    --esche-notifications-success-background: #F0FDF4;
    --esche-notifications-error: #991B1B;
    --esche-notifications-error-background: #FEF2F2;

    width: 100%;
    max-width: 100%;
    color: var(--esche-notifications-text);
    box-sizing: border-box;
}

.esche-notifications *,
.esche-notifications *::before,
.esche-notifications *::after {
    box-sizing: border-box;
}

/* =========================================================
   Page Header
   ========================================================= */

.esche-notifications__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.esche-notifications__heading {
    min-width: 0;
    flex: 1;
}

.esche-notifications__eyebrow {
    margin: 0 0 8px;
    color: var(--esche-notifications-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
    line-height: 1.5;
    text-transform: uppercase;
}

.esche-notifications__title {
    margin: 0 0 10px;
    color: var(--esche-notifications-text);
    font-size: clamp(25px, 3vw, 32px);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.7px;
}

.esche-notifications__description {
    max-width: 620px;
    margin: 0;
    color: var(--esche-notifications-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   Unread Summary
   ========================================================= */

.esche-notifications__summary {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 125px;
    min-height: 105px;
    padding: 18px;
    background: var(--esche-notifications-primary-light);
    border: 1px solid #D5E4FA;
    border-radius: 14px;
    text-align: center;
}

.esche-notifications__summary-label {
    margin-bottom: 6px;
    color: #315681;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.esche-notifications__unread-count {
    color: var(--esche-notifications-primary);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
}

/* =========================================================
   Toolbar
   ========================================================= */

.esche-notifications__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    background: var(--esche-notifications-page-background);
    border: 1px solid var(--esche-notifications-border);
    border-radius: 12px;
}

.esche-notifications__toolbar-text {
    color: var(--esche-notifications-muted);
    font-size: 13px;
    line-height: 1.6;
}

.esche-notifications__mark-all-form {
    flex: 0 0 auto;
    margin: 0;
}

/* =========================================================
   Buttons
   ========================================================= */

.esche-notifications__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.esche-notifications__button--primary {
    color: #FFFFFF;
    background: var(--esche-notifications-primary);
    border-color: var(--esche-notifications-primary);
}

.esche-notifications__button--primary:hover {
    color: #FFFFFF;
    background: #104D99;
    border-color: #104D99;
}

.esche-notifications__button--secondary {
    color: #475569;
    background: #FFFFFF;
    border-color: #E2E8F0;
}

.esche-notifications__button--secondary:hover {
    color: var(--esche-notifications-primary);
    background: var(--esche-notifications-primary-light);
    border-color: #C9D9EE;
}

.esche-notifications__button:focus-visible {
    outline: 2px solid rgba(21, 96, 189, 0.35);
    outline-offset: 2px;
}

.esche-notifications__button:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* =========================================================
   Notification List
   ========================================================= */

.esche-notifications__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.esche-notifications__item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding: 22px;
    background: var(--esche-notifications-background);
    border: 1px solid var(--esche-notifications-border);
    border-radius: 13px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.esche-notifications__item:hover {
    border-color: #CBD5E1;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
}

.esche-notifications__item.is-unread {
    background: #FBFDFF;
    border-left: 4px solid var(--esche-notifications-primary);
}

.esche-notifications__item.is-read {
    background: #FFFFFF;
    border-left: 4px solid transparent;
}

/* =========================================================
   Notification Indicator
   ========================================================= */

.esche-notifications__item-indicator {
    display: flex;
    flex: 0 0 34px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.esche-notifications__unread-dot {
    display: block;
    width: 11px;
    height: 11px;
    background: var(--esche-notifications-primary);
    border: 2px solid #DCEAFE;
    border-radius: 50%;
    box-sizing: content-box;
}

.esche-notifications__read-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    color: #64748B;
    background: #F1F5F9;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

/* =========================================================
   Notification Content
   ========================================================= */

.esche-notifications__item-content {
    flex: 1 1 auto;
    min-width: 0;
}

.esche-notifications__item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.esche-notifications__item-title {
    margin: 0;
    color: var(--esche-notifications-text);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.esche-notifications__item-message {
    margin: 0;
    color: #4B5563;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.esche-notifications__item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 14px;
}

.esche-notifications__type {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    color: #475569;
    background: #F1F5F9;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.esche-notifications__date {
    color: var(--esche-notifications-muted);
    font-size: 11px;
    line-height: 1.6;
}

/* =========================================================
   Read / Unread Badges
   ========================================================= */

.esche-notifications__badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    color: #174EA6;
    background: #EAF2FF;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.4;
}

.esche-notifications__badge--read {
    color: #475569;
    background: #F1F5F9;
}

/* =========================================================
   Notification Actions
   ========================================================= */

.esche-notifications__item-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
}

.esche-notifications__item-actions form {
    display: inline-flex;
    width: auto;
    margin: 0;
}

.esche-notifications__item-actions .esche-notifications__button {
    width: auto;
    min-height: 30px;
    padding: 5px 10px;
    color: #475569;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.esche-notifications__item-actions .esche-notifications__button:hover {
    color: var(--esche-notifications-primary);
    background: var(--esche-notifications-primary-light);
    border-color: #C9D9EE;
}

/* =========================================================
   Empty State
   ========================================================= */

.esche-notifications__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 40px 24px;
    background: var(--esche-notifications-page-background);
    border: 1px dashed #CBD5E1;
    border-radius: 14px;
    text-align: center;
}

.esche-notifications__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    background: var(--esche-notifications-primary-light);
    border-radius: 50%;
    font-size: 25px;
}

.esche-notifications__empty-title {
    margin: 0 0 10px;
    color: var(--esche-notifications-text);
    font-size: 18px;
    font-weight: 750;
    line-height: 1.4;
}

.esche-notifications__empty-description {
    max-width: 390px;
    margin: 0;
    color: var(--esche-notifications-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* =========================================================
   Status Messages
   ========================================================= */

.esche-notifications__notice {
    margin: 0 0 20px;
    padding: 13px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.7;
}

.esche-notifications__notice--success {
    color: var(--esche-notifications-success);
    background: var(--esche-notifications-success-background);
    border-color: #BBF7D0;
}

.esche-notifications__notice--error {
    color: var(--esche-notifications-error);
    background: var(--esche-notifications-error-background);
    border-color: #FECACA;
}

/* =========================================================
   Notification Limit Note
   ========================================================= */

.esche-notifications__limit-note {
    margin: 18px 0 0;
    color: var(--esche-notifications-muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

/* =========================================================
   Responsive Layout
   ========================================================= */

@media (max-width: 900px) {

    .esche-notifications__item {
        gap: 12px;
        padding: 18px;
    }

    .esche-notifications__item-indicator {
        flex-basis: 25px;
    }

    .esche-notifications__item-actions {
        align-self: flex-start;
    }

}

@media (max-width: 640px) {

    .esche-notifications__header {
        flex-direction: column;
        gap: 18px;
    }

    .esche-notifications__summary {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        min-height: auto;
        padding: 14px 16px;
        text-align: left;
    }

    .esche-notifications__summary-label {
        margin: 0;
        font-size: 12px;
    }

    .esche-notifications__unread-count {
        font-size: 25px;
    }

    .esche-notifications__toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .esche-notifications__mark-all-form {
        width: 100%;
    }

    .esche-notifications__mark-all-form .esche-notifications__button {
        width: auto;
    }

    .esche-notifications__item {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .esche-notifications__item-indicator {
        flex-basis: 22px;
        padding-top: 3px;
    }

    .esche-notifications__item-content {
        flex: 1 1 calc(100% - 40px);
    }

    .esche-notifications__item-top {
        flex-wrap: wrap;
        gap: 8px;
    }

    .esche-notifications__item-actions {
        width: auto;
        padding-left: 34px;
    }

    .esche-notifications__item-actions form {
        width: auto;
    }

    .esche-notifications__item-actions .esche-notifications__button {
        width: auto;
    }

    .esche-notifications__empty {
        min-height: 240px;
        padding: 30px 18px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .esche-notifications__item,
    .esche-notifications__button {
        transition: none;
    }

}

/* =========================================================
   Clickable Notification Links
   ========================================================= */

.esche-notifications__item-message a.esche-notifications__link {
    color: #1560BD;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.esche-notifications__item-message a.esche-notifications__link:hover {
    color: #104D99;
    text-decoration-thickness: 2px;
}

.esche-notifications__item-message a.esche-notifications__link:focus-visible {
    outline: 2px solid #1560BD;
    outline-offset: 3px;
    border-radius: 3px;
}

.esche-notifications__item-message a.esche-notifications__link--action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 8px 0;
    padding: 9px 15px;
    color: #FFFFFF;
    background: #1560BD;
    border: 1px solid #1560BD;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

.esche-notifications__item-message a.esche-notifications__link--action:hover {
    color: #FFFFFF;
    background: #104D99;
    border-color: #104D99;
}