/*
 * Notifiche dentro l'applicativo: quadrato nel menu in alto, numerino dei non
 * letti e pannello a discesa.
 *
 * Il quadrato riusa le misure delle altre voci del menu: qui si aggiungono
 * solo l'icona, il numerino e il pannello.
 */

/* campanella disegnata nel foglio di stile, per non aggiungere un'immagine */
#menu-notifications
{
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E") no-repeat center 10px;
    background-size: 24px 24px;
    position: relative;
    z-index: 10;
}

#menu-notifications-li
{
    position: relative;
}

/* numerino dei non letti, in alto a destra del quadrato */
.notifications-badge
{
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background-color: #e69500;
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.notifications-badge.has-unread
{
    display: block;
}

/* numerino sulle copie del menu generate per il telefono */
.notifications-badge-mobile
{
    display: none;
    margin-left: 8px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background-color: #e69500;
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    font-weight: bold;
}

.notifications-badge-mobile.has-unread
{
    display: inline-block;
}

/* pannello a discesa */
#notifications-panel
{
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #c9c9c9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    text-align: left;
    z-index: 2000;
}

#notifications-panel.opened
{
    display: block;
}

/* il pannello vive dentro un elemento del menu: qui si annullano gli stili
   che il menu impone a liste, voci e link, altrimenti le notifiche vengono
   disegnate come voci di menu */
#notifications-panel ul,
#notifications-panel li
{
    list-style: none;
    margin: 0;
    padding: 0;
    float: none;
    display: block;
    background: none;
    border-radius: 0;
    width: auto;
    height: auto;
    text-transform: none;
}

#notifications-panel a,
#notifications-panel span,
#notifications-panel button
{
    display: block;
    width: auto;
    height: auto;
    float: none;
    text-align: left;
    text-transform: none;
    font-weight: normal;
    letter-spacing: normal;
    background: none;
}

#notifications-panel a:hover
{
    background: none;
}

#notifications-panel .notifications-panel-head
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #e3e3e3;
    background-color: #f4f4f4;
}

#notifications-panel .notifications-panel-title
{
    font-size: 13px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
}

#notifications-panel .notifications-mark-all
{
    font-size: 12px;
    color: #333;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

#notifications-panel .notifications-mark-all:hover
{
    color: #000;
}

#notifications-panel .notifications-empty
{
    padding: 18px 12px;
    font-size: 13px;
    color: #333;
}

#notifications-panel .notification-item
{
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #ededed;
}

#notifications-panel .notification-item:last-child
{
    border-bottom: 0;
}

#notifications-panel .notification-item-link
{
    flex: 1;
    display: block;
    padding: 10px 6px 10px 12px;
    text-decoration: none;
    color: #000;
}

#notifications-panel .notification-item-link:hover
{
    background-color: #f7f7f7;
}

#notifications-panel .notification-item-title
{
    font-size: 13px;
    text-align: left;
    font-weight: bold;
    line-height: 17px;
}

#notifications-panel .notification-item-description
{
    font-size: 12px;
    color: #333;
    line-height: 16px;
    margin-top: 2px;
}

#notifications-panel .notification-item-date
{
    font-size: 11px;
    color: #777;
    margin-top: 3px;
}

/* spunta che segna letta la singola notifica */
#notifications-panel .notification-item-read
{
    flex: 0 0 auto;
    width: 34px;
    align-self: stretch;
    border: 0;
    border-left: 1px solid #ededed;
    background-color: transparent;
    cursor: pointer;
    color: #4c4c4c;
    padding: 0;
}

#notifications-panel .notification-item-read:hover
{
    background-color: #e5f4e4;
    color: #1d7a1d;
}

#notifications-panel .notification-item-read svg
{
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

/* storico completo */
.notifications-history-list
{
    list-style: none;
    margin: 0;
    padding: 0;
}

.notifications-history-summary
{
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}

.notifications-history-item
{
    padding: 12px 0;
    border-bottom: 1px solid #ededed;
}

.notifications-history-item.is-unread
{
    border-left: 3px solid #e69500;
    padding-left: 9px;
}

.notifications-history-item .notification-item-title,
.notifications-history-item .notification-item-description,
.notifications-history-item .notification-item-date
{
    display: block;
}

.notifications-history-item .notification-item-title
{
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.notifications-history-link
{
    text-decoration: none;
}

.notifications-history-link:hover .notification-item-title
{
    text-decoration: underline;
}

.notifications-history-pages
{
    margin-top: 16px;
}

/* su telefono il pannello occupa la larghezza disponibile */
@media only screen and (max-width: 767px)
{
    #notifications-panel
    {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 70vh;
    }
}
