/* =========================================================
   C.E.S.I - Notifiche (campanellina + pagina)
   File: /styles/notifiche.css
   ========================================================= */

/* =========================================================
   1) CAMPANELLINA NELL'HEADER
   ========================================================= */
.cesi-notif-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.cesi-notif-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 16px 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid transparent;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.cesi-notif-btn i {
    font-size: 1.1rem;
    opacity: .95;
    color: #ffffff;
    transition: color .18s ease, transform .18s ease;
}

.cesi-notif-wrap:hover .cesi-notif-btn,
.cesi-notif-btn:hover,
.cesi-notif-btn:focus-visible {
    background: #1c1c1c;
    border-bottom-color: #3ab2f3;
    outline: none;
}

.cesi-notif-wrap:hover .cesi-notif-btn i,
.cesi-notif-btn:hover i,
.cesi-notif-btn:focus-visible i {
    color: #3ab2f3;
}

.cesi-notif-badge {
    position: absolute;
    top: 8px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e63946;
    color: #ffffff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 999px;
    pointer-events: none;
    box-shadow: 0 0 0 2px #0d0d0d;
    font-family: Arial, Helvetica, sans-serif;
}

/* =========================================================
   2) DROPDOWN PREVIEW — APRE IN HOVER, SENZA BORDER-RADIUS
   ========================================================= */
.cesi-notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #0d0d0d;
    color: #ffffff;
    border: 1px solid #2a2a2a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    z-index: 9999;
    overflow: hidden;

    /* niente border-radius */
    border-radius: 0;

    /* nascosto di default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

/* Apre in hover sul wrapper */
.cesi-notif-wrap:hover .cesi-notif-dropdown,
.cesi-notif-wrap:focus-within .cesi-notif-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Il dropdown esiste sempre nel DOM, anche se ha [hidden] */
.cesi-notif-dropdown[hidden] {
    display: block !important;
}

/* Head */
.cesi-notif-dropdown__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #111111;
    border-bottom: 1px solid #2a2a2a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: .86rem;
}

.cesi-notif-dropdown__head strong {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: .3px;
}

.cesi-notif-dropdown__all {
    color: #3ab2f3;
    font-size: .78rem;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .18s ease;
}

.cesi-notif-dropdown__all:hover {
    color: #7fcbf7;
}

/* Lista */
.cesi-notif-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
    background: #0d0d0d;
}

.cesi-notif-dropdown__loading,
.cesi-notif-dropdown__empty {
    padding: 22px 16px;
    text-align: center;
    color: #8a8f98;
    font-size: .85rem;
    font-family: Arial, Helvetica, sans-serif;
}

.cesi-notif-dropdown__item {
    border-bottom: 1px solid #1c1c1c;
}

.cesi-notif-dropdown__item:last-child {
    border-bottom: none;
}

.cesi-notif-dropdown__item.is-unread {
    background: #111111;
    border-left: 3px solid #3ab2f3;
}

.cesi-notif-dropdown__link {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #eaeaea;
    transition: background .18s ease;
}

.cesi-notif-dropdown__link:hover {
    background: #1c1c1c;
}

.cesi-notif-dropdown__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: rgba(58, 178, 243, .13);
    color: #3ab2f3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    border-radius: 0;
}

.cesi-notif-dropdown__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.cesi-notif-dropdown__title {
    font-size: .84rem;
    font-weight: 700;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cesi-notif-dropdown__msg {
    font-size: .78rem;
    color: #b8c4cf;
    line-height: 1.4;
    font-family: Arial, Helvetica, sans-serif;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cesi-notif-dropdown__time {
    font-size: .72rem;
    color: #8a8f98;
    margin-top: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

/* Foot */
.cesi-notif-dropdown__foot {
    padding: 10px 16px;
    background: #111111;
    border-top: 1px solid #2a2a2a;
    text-align: center;
}

.cesi-notif-dropdown__btn {
    display: inline-block;
    font-size: .82rem;
    font-weight: 700;
    color: #3ab2f3;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    transition: color .18s ease;
}

.cesi-notif-dropdown__btn:hover {
    color: #7fcbf7;
}

/* =========================================================
   3) PAGINA NOTIFICHE
   ========================================================= */
.cesi-notif-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px 60px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #2a2f37;
}

.cesi-notif-head {
    margin-bottom: 24px;
}

.cesi-notif-head__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cesi-notif-head__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0d0d0d;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cesi-notif-head__title i {
    color: #3ab2f3;
}

.cesi-notif-btn-action {
    background: #0d0d0d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: inherit;
    transition: background .18s ease;
}

.cesi-notif-btn-action:hover {
    background: #3ab2f3;
}

.cesi-notif-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #eef2f5;
    padding-bottom: 12px;
}

.cesi-notif-filter {
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 700;
    color: #4a515b;
    text-decoration: none;
    border-radius: 999px;
    transition: background .15s ease, color .15s ease;
}

.cesi-notif-filter:hover {
    background: #f4f6f8;
    color: #111;
}

.cesi-notif-filter.is-active {
    background: #3ab2f3;
    color: #fff;
}

/* Lista */
.cesi-notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.cesi-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #eef2f5;
    border-left: 4px solid #3ab2f3;
    border-radius: 12px;
    transition: box-shadow .18s ease, transform .18s ease;
}

.cesi-notif-item:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
    transform: translateY(-1px);
}

.cesi-notif-item.is-read {
    opacity: .75;
    border-left-color: #d6dbe0;
}

.cesi-notif-item.is-success { border-left-color: #22a355; }
.cesi-notif-item.is-danger  { border-left-color: #e63946; }
.cesi-notif-item.is-info    { border-left-color: #3ab2f3; }
.cesi-notif-item.is-warning { border-left-color: #f5a524; }
.cesi-notif-item.is-admin   { border-left-color: #7c3aed; }

.cesi-notif-item__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(58, 178, 243, .13);
    color: #1a8fcc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.cesi-notif-item.is-success .cesi-notif-item__icon { background: rgba(34,163,85,.13);  color: #1a7a3e; }
.cesi-notif-item.is-danger  .cesi-notif-item__icon { background: rgba(230,57,70,.13);  color: #a11f1f; }
.cesi-notif-item.is-warning .cesi-notif-item__icon { background: rgba(245,165,36,.15); color: #b87400; }
.cesi-notif-item.is-admin   .cesi-notif-item__icon { background: rgba(124,58,237,.13); color: #6d28d9; }

.cesi-notif-item__body {
    flex: 1;
    min-width: 0;
}

.cesi-notif-item__title {
    font-size: .95rem;
    font-weight: 800;
    color: #0d0d0d;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.cesi-notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3ab2f3;
    display: inline-block;
}

.cesi-notif-item__msg {
    font-size: .88rem;
    color: #4a515b;
    line-height: 1.55;
}

.cesi-notif-item__time {
    font-size: .74rem;
    color: #8a8f98;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cesi-notif-item__action {
    flex-shrink: 0;
    align-self: center;
}

.cesi-notif-item__go {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f6f8;
    color: #4a515b;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.cesi-notif-item__go:hover {
    background: #3ab2f3;
    color: #fff;
    transform: scale(1.05);
}

/* Empty */
.cesi-notif-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8a8f98;
}

.cesi-notif-empty i {
    font-size: 3rem;
    color: #d6dbe0;
    margin-bottom: 14px;
    display: block;
}

.cesi-notif-empty p {
    font-size: 1rem;
}

/* Paginazione */
.cesi-notif-pager {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.cesi-notif-pager__link {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #eef2f5;
    background: #fff;
    color: #4a515b;
    text-decoration: none;
    font-weight: 700;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.cesi-notif-pager__link:hover {
    background: #f4f6f8;
    color: #111;
}

.cesi-notif-pager__link.is-active {
    background: #3ab2f3;
    color: #fff;
    border-color: #3ab2f3;
}

/* =========================================================
   4) RESPONSIVE
   ========================================================= */

/* Tablet/mobile: dropdown sotto al bottone, larghezza piena */
@media (max-width: 900px) {
    .cesi-notif-dropdown {
        position: static;
        width: 100%;
        max-width: 100%;
        transform: none;
        border-left: none;
        border-right: none;
        border-top: none;
        box-shadow: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease, opacity .18s ease, visibility .18s;
        opacity: 1;
        visibility: visible;
    }

    .cesi-notif-wrap:hover .cesi-notif-dropdown,
    .cesi-notif-wrap:focus-within .cesi-notif-dropdown {
        max-height: 500px;
    }

    /* Bottone a tutta larghezza come gli altri link */
    .cesi-notif-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 16px 20px;
        font-size: 1rem;
        gap: 12px;
        border-bottom: 1px solid #1c1c1c;
        border-left: 3px solid transparent;
    }

    .cesi-notif-btn i {
        font-size: 1.15rem;
        min-width: 22px;
        text-align: center;
    }

    .cesi-notif-btn::after {
        content: "Notifiche";
        color: #ffffff;
        font-size: 1rem;
        font-weight: 500;
    }

    .cesi-notif-wrap:hover .cesi-notif-btn,
    .cesi-notif-btn:hover,
    .cesi-notif-btn:focus-visible {
        background: #1c1c1c;
        border-left-color: #3ab2f3;
        border-bottom-color: #1c1c1c;
    }

    .cesi-notif-badge {
        position: static;
        margin-left: auto;
        margin-right: 4px;
        min-width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: .75rem;
        box-shadow: none;
    }
}

@media (max-width: 600px) {
    .cesi-notif-head__row {
        flex-direction: column;
        align-items: stretch;
    }

    .cesi-notif-btn-action {
        width: 100%;
        justify-content: center;
    }

    .cesi-notif-item {
        padding: 14px;
    }

    .cesi-notif-item__icon {
        width: 36px;
        height: 36px;
        font-size: .95rem;
    }
}