/*
 * Birthday and work anniversary celebrations.
 *
 * Shared by the three places that show them: the badges on the user listing, the navbar
 * indicator and its dropdown, and the popup shown once a session. One file so the two
 * colours - warm amber for a birthday, violet for an anniversary - mean the same thing
 * everywhere.
 *
 * No images and no web fonts: the icons are emoji already in the page's text, so this
 * costs one small stylesheet and nothing else.
 */

:root {
    --celebration-birthday: #b26a00;
    --celebration-birthday-bg: #fff4e0;
    --celebration-birthday-border: #ffd79a;
    --celebration-anniversary: #6b3fa0;
    --celebration-anniversary-bg: #f3edfd;
    --celebration-anniversary-border: #d9c8f5;
}

/* ---------- Badges, as used in the user listing and the lists below ---------- */

.celebration-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid transparent;
}

.celebration-badge-birthday {
    color: var(--celebration-birthday);
    background-color: var(--celebration-birthday-bg);
    border-color: var(--celebration-birthday-border);
}

.celebration-badge-anniversary {
    color: var(--celebration-anniversary);
    background-color: var(--celebration-anniversary-bg);
    border-color: var(--celebration-anniversary-border);
}

/* ---------- Navbar indicator ---------- */

.celebration-nav-icon {
    font-size: 17px;
    line-height: 1;
}

/* Sits on the corner of the icon the way the bell's unread dot does. */
.celebration-count {
    position: absolute;
    top: 6px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background-color: #e7515a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.celebration-dropdown-menu {
    width: 320px;
    max-width: calc(100vw - 24px);
    padding: 0;
}

.celebration-dropdown-header {
    padding: 12px 16px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    border-bottom: 1px solid #e9edf3;
}

/* The list scrolls rather than the dropdown growing past the viewport when a large
   business has a dozen people celebrating on the same day. */
.celebration-dropdown-body {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
}

/* ---------- One person, as listed in the navbar dropdown ---------- */

.celebration-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 16px;
}

.celebration-item+.celebration-item {
    border-top: 1px solid #f1f4f8;
}

.celebration-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 36px;
    text-align: center;
    text-transform: uppercase;
}

/* min-width:0 so this flex item may shrink below its content width; without it a long
   name would widen the row and push the avatar off the card. */
.celebration-item-body {
    min-width: 0;
    flex: 1 1 auto;
}

/* The whole name is the point of the list, so it wraps instead of ellipsing.
   overflow-wrap breaks a single unspaced run that is wider than the dropdown rather
   than letting it overflow. */
.celebration-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Role and location are supporting detail, so these stay on one line and ellipse;
   the full text is on the title attribute. */
.celebration-item-meta {
    font-size: 11.5px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.celebration-item-badge {
    display: inline-block;
    margin-top: 4px;
}

/* ---------- The popup shown once a session ---------- */

.celebration-modal .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
}

.celebration-modal .modal-body {
    position: relative;
    padding: 34px 30px 30px;
}

.celebration-modal-emoji {
    font-size: 52px;
    line-height: 1;
}

.celebration-modal-title {
    margin: 14px 0 6px;
    font-size: 21px;
    font-weight: 700;
    color: #0f172a;
}

.celebration-modal-message {
    margin: 0 auto;
    max-width: 340px;
    font-size: 14px;
    color: #475569;
}

.celebration-modal-years {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--celebration-anniversary);
    background-color: var(--celebration-anniversary-bg);
}

/* Sits over the modal, never over the buttons: the canvas is only as tall as the dialog
   and ignores the pointer, so nothing underneath becomes unclickable while it plays. */
#celebration_confetti_canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
}

/* The emoji lifts once and settles. Anyone who has asked their system not to animate
   gets the same popup, held still. */
@keyframes celebration-pop {
    0% {
        transform: scale(.4);
        opacity: 0;
    }

    60% {
        transform: scale(1.12);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-modal-emoji {
    animation: celebration-pop .5s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    .celebration-modal-emoji {
        animation: none;
    }
}

@media (max-width: 575px) {
    .celebration-dropdown-menu {
        width: 288px;
    }

    .celebration-modal .modal-body {
        padding: 28px 20px 24px;
    }
}
