
/*
|--------------------------------------------------------------------------
| Public RoRo Notification - BERLAYAR
|--------------------------------------------------------------------------
| Desktop : Logo - Nav Menu - Lonceng
| Mobile  : Logo - Hamburger - Lonceng
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Header Layout
|--------------------------------------------------------------------------
*/

#header,
#header .container {
    overflow: visible;
}

/*
 * Mengatur urutan elemen pada header.
 *
 * 1. Logo
 * 2. Navigasi
 * 3. Notifikasi
 */

#header .logo {
    order: 1;
}

#header #navmenu {
    order: 2;
}

#header .public-roro-notification {
    order: 3;
}

/*
|--------------------------------------------------------------------------
| Notification Container
|--------------------------------------------------------------------------
*/

.public-roro-notification {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    margin-left: 12px;

    z-index: 1100;
}

/*
|--------------------------------------------------------------------------
| Notification Bell
|--------------------------------------------------------------------------
*/

.public-roro-bell {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;

    color: #0B5A8E;

    font-size: 21px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.public-roro-bell:hover {
    background: #eaf5fc;
    color: #0874b8;
}

.public-roro-bell:focus-visible {
    outline: 2px solid #0B5A8E;
    outline-offset: 2px;
}

/*
|--------------------------------------------------------------------------
| Notification Badge
|--------------------------------------------------------------------------
*/

.public-roro-badge {
    position: absolute;

    top: 0;
    right: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 17px;
    height: 17px;

    padding: 0 5px;

    background: #dc3545;
    color: #ffffff;

    border-radius: 12px;

    font-size: 10px;
    font-weight: 700;
    line-height: 17px;

    text-align: center;
}

/*
|--------------------------------------------------------------------------
| Hide Elements
|--------------------------------------------------------------------------
*/

.public-roro-badge[hidden],
.public-roro-notification-menu[hidden] {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Notification Dropdown
|--------------------------------------------------------------------------
*/

.public-roro-notification-menu {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;
    left: auto;

    width: 370px;
    max-width: calc(100vw - 20px);

    background: #ffffff;

    border: 1px solid #e5eaf0;
    border-radius: 10px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.16);

    overflow: hidden;

    z-index: 1101;
}

/*
|--------------------------------------------------------------------------
| Notification Header
|--------------------------------------------------------------------------
*/

.public-roro-notification-header {
    padding: 14px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 8px;

    color: #0B5A8E;

    font-size: 12px;

    border-bottom: 1px solid #e5eaf0;
}

.public-roro-notification-header strong {
    font-weight: 700;
}

.public-roro-notification-header small {
    color: #718096;

    white-space: nowrap;

    font-size: 10px;
}

/*
|--------------------------------------------------------------------------
| Notification List
|--------------------------------------------------------------------------
*/

.public-roro-notification-list {
    max-height: min(380px, 55vh);

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
}

/*
|--------------------------------------------------------------------------
| Empty Notification
|--------------------------------------------------------------------------
*/

.public-roro-empty {
    padding: 24px 14px;

    text-align: center;

    font-size: 12px;

    color: #718096;
}

/*
|--------------------------------------------------------------------------
| Notification Item
|--------------------------------------------------------------------------
*/

.public-roro-item {
    display: block;

    width: 100%;

    padding: 12px;

    border: none;
    border-bottom: 1px solid #edf2f7;

    background: #ffffff;

    text-align: left;

    cursor: pointer;
}

.public-roro-item:hover {
    background: #f3f9fd;
}

.public-roro-item.unread {
    background: #eef7ff;
}

/*
|--------------------------------------------------------------------------
| Notification Item Title
|--------------------------------------------------------------------------
*/

.public-roro-item-title {
    color: #0B5A8E;

    font-size: 12px;
    font-weight: 700;
}

/*
|--------------------------------------------------------------------------
| Notification Message
|--------------------------------------------------------------------------
*/

.public-roro-item-message {
    margin-top: 4px;

    font-size: 11px;
    line-height: 1.5;

    color: #475569;

    overflow-wrap: anywhere;
}

/*
|--------------------------------------------------------------------------
| Notification Time
|--------------------------------------------------------------------------
*/

.public-roro-item-time {
    margin-top: 5px;

    font-size: 10px;

    color: #94a3b8;
}

/*
|--------------------------------------------------------------------------
| Notification Footer
|--------------------------------------------------------------------------
*/

.public-roro-notification-footer {
    padding: 6px 10px;

    text-align: center;

    border-top: 1px solid #edf2f7;
}

.public-roro-notification-footer button {
    padding: 6px;

    border: none;

    background: transparent;

    color: #0B5A8E;

    font-size: 11px;

    cursor: pointer;
}

.public-roro-notification-footer button:hover {
    color: #0874b8;
}

/*
|--------------------------------------------------------------------------
| Toast Notification - Track RoRo
|--------------------------------------------------------------------------
*/

.public-roro-toast {
    position: fixed;

    bottom: 24px;
    right: 24px;

    z-index: 1200;

    width: 340px;
    max-width: calc(100vw - 32px);

    padding: 14px 16px;

    background: #ffffff;

    border-left: 4px solid #0B5A8E;
    border-radius: 9px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.20);

    font-size: 12px;

    color: #334155;
}

.public-roro-toast strong {
    display: block;

    margin-bottom: 5px;

    color: #0B5A8E;
}

.public-roro-toast-message {
    overflow-wrap: anywhere;
}

/*
|--------------------------------------------------------------------------
| Mobile Responsive
|--------------------------------------------------------------------------
| BootstrapMade menggunakan breakpoint 1200px
| untuk perubahan navigasi menjadi hamburger.
|--------------------------------------------------------------------------
*/

@media (max-width: 1199.98px) {

    /*
     * Lonceng tetap di luar navmenu.
     * Posisi di sebelah kanan hamburger.
     */

    #header .public-roro-notification {
        order: 3;

        margin-left: 8px;

        flex: 0 0 auto;

        z-index: 1100;
    }

    #header #navmenu {
        order: 2;

        flex: 0 0 auto;
    }

    /*
     * Ukuran ikon
     */

    .public-roro-bell {
        width: 36px;
        height: 36px;

        font-size: 19px;
    }

    /*
     * Dropdown tetap mengambang.
     * Tidak masuk ke dalam menu hamburger.
     */

    .public-roro-notification-menu {
        position: absolute;

        top: calc(100% + 12px);
        right: 0;
        left: auto;

        width: min(340px, calc(100vw - 20px));

        z-index: 1101;
    }

    .public-roro-notification-list {
        max-height: 50vh;
    }

    /*
     * Toast mobile
     */

    .public-roro-toast {
        right: 12px;
        bottom: 16px;

        max-width: calc(100vw - 24px);
    }
}

/*
|--------------------------------------------------------------------------
| Small Mobile
|--------------------------------------------------------------------------
*/

@media (max-width: 575.98px) {

    #header .public-roro-notification {
        margin-left: 4px;
    }

    .public-roro-bell {
        width: 34px;
        height: 34px;

        font-size: 18px;
    }

    .public-roro-badge {
        top: -2px;
        right: -2px;
    }

    /*
     * Dropdown menyesuaikan lebar layar.
     */

    .public-roro-notification-menu {
        width: min(320px, calc(100vw - 20px));

        top: calc(100% + 10px);
        right: 0;
    }

    .public-roro-notification-header {
        padding: 12px;

        flex-wrap: wrap;
    }

    .public-roro-notification-list {
        max-height: 40vh;
    }

    .public-roro-item {
        padding: 10px 12px;
    }
}
