
/* =========================================
   BMB2027 - Updates Component
   Scoped to Updates elements only.
========================================= */

/* Floating Updates button */
.updates-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1040;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 12px 18px;
    border: 0;
    border-radius: 999px;

    background: #176b61;
    color: #fff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    cursor: pointer;

    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.updates-btn:hover {
    background: #12574f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.updates-btn:focus-visible {
    outline: 3px solid rgba(23, 107, 97, 0.35);
    outline-offset: 3px;
}

.updates-btn .bi {
    font-size: 17px;
}

.updates-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 22px;
    min-height: 22px;
    padding: 2px 6px;

    border-radius: 999px;
    background: #dc3545;
    color: #fff;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* Updates panel */
#updatesCanvas {
    z-index: 1055;
    width: min(100%, 460px);
}

#updatesCanvas .offcanvas-header {
    border-bottom: 1px solid #e9ecef;
}

#updatesCanvas .offcanvas-title {
    font-weight: 700;
}

#updatesCanvas .offcanvas-body {
    overflow-y: auto;
}

/* Filter tabs */
#updatesCanvas .update-tabs {
    gap: 6px;
}

#updatesCanvas .update-tabs .nav-link {
    border: 1px solid #dee2e6;
    border-radius: 999px;

    background: #fff;
    color: #495057;

    font-size: 13px;
    font-weight: 600;
}

#updatesCanvas .update-tabs .nav-link.active {
    border-color: #176b61;
    background: #176b61;
    color: #fff;
}

/* Individual update item */
#updatesCanvas .update-item {
    display: block;
    margin-bottom: 16px;
}

/* Used by the Updates filter JavaScript */
#updatesCanvas .update-item.hide {
    display: none !important;
}

#updatesCanvas .update-card {
    padding: 16px;
    border: 1px solid #e9ecef;
    border-radius: 14px;

    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);

    overflow-wrap: anywhere;
}

#updatesCanvas .update-card h6 {
    color: #212529;
    line-height: 1.5;
}

#updatesCanvas .update-card p {
    line-height: 1.65;
    white-space: normal;
}

#updatesCanvas .update-card .badge {
    white-space: normal;
}

#updatesCanvas .update-card a {
    text-decoration: none;
}

/* Responsive layout */
@media (max-width: 576px) {
    .updates-btn {
        right: 14px;
        bottom: 14px;
        gap: 8px;
        padding: 11px 14px;
    }

    #updatesCanvas {
        width: 100%;
    }

    #updatesCanvas .update-card {
        padding: 13px;
    }
}
