/**
 * birthday-toast.css — Birthday greeting toast
 * ============================================================
 * Shown once after login when Auth sets the bday_greeting
 * session flash; rendered by includes/header.php.
 * ============================================================
 */

.bday-toast {
    position: fixed;
    top: 72px; right: 20px;
    z-index: 1080;
    display: flex; align-items: center; gap: 14px;
    max-width: 380px;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    animation: bdayToastIn .45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bday-toast.hide { opacity: 0; transform: translateY(-10px); transition: all .3s ease; }

.bday-toast-icon {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff; font-size: 22px;
    animation: bdayToastWiggle 1.4s ease-in-out 2;
}

.bday-toast-title { font-weight: 700; font-size: 15px; color: var(--color-gray-800, #1f2937); }
.bday-toast-sub   { font-size: 12.5px; color: var(--color-gray-500, #6b7280); margin-top: 2px; }

.bday-toast-close {
    flex: 0 0 auto; border: 0; background: transparent;
    color: var(--color-gray-400, #9ca3af); font-size: 14px;
    cursor: pointer; padding: 4px; margin-left: 4px; border-radius: 6px;
}
.bday-toast-close:hover { color: var(--color-gray-600, #4b5563); background: var(--color-gray-100, #f3f4f6); }

@keyframes bdayToastIn {
    from { opacity: 0; transform: translateY(-16px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bdayToastWiggle {
    0%, 100% { transform: rotate(0); }
    20%      { transform: rotate(-8deg); }
    40%      { transform: rotate(7deg); }
    60%      { transform: rotate(-5deg); }
    80%      { transform: rotate(3deg); }
}

/* Confetti holder + pieces (spawned by the header.php script) */
.bday-confetti {
    position: fixed; inset: 0;
    overflow: hidden; pointer-events: none;
    z-index: 1079;
}
.bday-confetti span {
    position: absolute; top: -16px;
    opacity: 0;
    animation: bdayConfettiFall 2.8s linear forwards;
}
@keyframes bdayConfettiFall {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--spin, 540deg)); opacity: .85; }
}

/* Dark mode */
html.dark-mode .bday-toast {
    background: #242526;
    border-color: #3E4042;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
html.dark-mode .bday-toast-title { color: #E4E6EB; }
html.dark-mode .bday-toast-sub   { color: #B0B3B8; }
html.dark-mode .bday-toast-close { color: #B0B3B8; }
html.dark-mode .bday-toast-close:hover { color: #E4E6EB; background: #3A3B3C; }

@media (prefers-reduced-motion: reduce) {
    .bday-toast, .bday-toast-icon, .bday-confetti span { animation: none; }
}

/* ─── Birthday hat — sidebar avatar, worn all day on the birthday ──
   The avatar normally clips to a circle via overflow:hidden; when the
   hat is on, the anchor un-clips and the photo keeps its own radius. */
.user-card-avatar.has-bday-hat {
    overflow: visible;
    position: relative;
}
.user-card-avatar.has-bday-hat img { border-radius: var(--radius-full, 50%); }

.bday-hat {
    position: absolute;
    top: -17px; left: -9px;
    width: 32px; height: 34px;
    transform: rotate(-26deg);
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.28));
    animation: bdayHatDrop .7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bday-hat svg { width: 100%; height: 100%; display: block; }

@keyframes bdayHatDrop {
    0%   { opacity: 0; transform: translateY(-10px) rotate(-8deg); }
    100% { opacity: 1; transform: translateY(0) rotate(-26deg); }
}

@media (prefers-reduced-motion: reduce) {
    .bday-hat { animation: none; }
}
