/* =========================================================
   GOC Portal — announcements (announcements.js)
   Megaphone icon in the top bar + a drop-down panel.
   ========================================================= */

/* ---------- top-bar icon (sits next to the birthday chip) ---------- */
.btn-ann {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #d7ecec;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-ann[hidden] { display: none; }
.btn-ann:hover,
.btn-ann.is-open {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}
.btn-ann svg { display: block; flex: none; }

/* ---------- unread state: amber pill "New" that pulses ----------
   Pulses only while there is something the person hasn't opened yet;
   stops for good as soon as the panel is opened once. */
.ann-new {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ann-new[hidden] { display: none; }

.btn-ann.has-new {
  width: auto;
  gap: 6px;
  padding: 0 11px 0 9px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #f6c45b, #d9952f);
  border-color: #f6c45b;
  color: #2b1c04;
  animation: ann-pulse 1.8s ease-out infinite;
}
.btn-ann.has-new:hover { background: linear-gradient(135deg, #ffd477, #e3a33c); color: #2b1c04; }
.btn-ann.has-new svg { animation: ann-ring 3.6s ease-in-out infinite; transform-origin: 30% 50%; }
.btn-ann.has-new .ann-dot { display: none; }

@keyframes ann-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(246, 196, 91, 0.75); }
  70%  { box-shadow: 0 0 0 10px rgba(246, 196, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(246, 196, 91, 0); }
}
/* a short "ring" of the megaphone every few seconds */
@keyframes ann-ring {
  0%, 82%, 100% { transform: rotate(0); }
  85% { transform: rotate(-14deg); }
  88% { transform: rotate(12deg); }
  91% { transform: rotate(-8deg); }
  94% { transform: rotate(5deg); }
}

/* Citrix/Windows often turn animations off ("reduced motion"): the
   amber "New" pill stays, just without movement. */
@media (prefers-reduced-motion: reduce) {
  .btn-ann.has-new, .btn-ann.has-new svg { animation: none; }
  .btn-ann.has-new { box-shadow: 0 0 0 3px rgba(246, 196, 91, 0.35); }
}

@media (max-width: 760px) {
  .btn-ann.has-new { width: 32px; padding: 0; justify-content: center; }
  .btn-ann.has-new .ann-new { display: none; }
}

/* small "new" dot — no animation, no counter: quiet on purpose */
.ann-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f6c45b;
  box-shadow: 0 0 0 2px var(--teal-900);
}
.ann-dot[hidden] { display: none; }

/* ---------- panel ---------- */
.ann-panel {
  position: fixed;
  z-index: 60;
  max-height: min(70vh, 620px);
  display: flex;
  flex-direction: column;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 34px rgba(16, 40, 40, 0.18), 0 2px 6px rgba(16, 40, 40, 0.08);
  overflow: hidden;
  animation: ann-in 0.16s ease;
}
.ann-panel[hidden] { display: none; }
@keyframes ann-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ann-panel { animation: none; } }

.ann-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.ann-panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-900);
}

.ann-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- one announcement ---------- */
.ann-card {
  --ann-a: var(--teal-100);
  --ann-b: #f6fbfa;
  --ann-accent: var(--teal-700);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 12px 15px;
  border-radius: 10px;
  background: linear-gradient(120deg, var(--ann-a) 0%, var(--ann-b) 70%);
  overflow: hidden;
}
.ann-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ann-accent);
}

.ann-tone--blue    { --ann-a: #e4edf8; --ann-b: #f6f9fd; --ann-accent: #3b6ea8; }
.ann-tone--rose    { --ann-a: #f8e7ec; --ann-b: #fdf7f9; --ann-accent: #c06683; }
.ann-tone--amber   { --ann-a: #f8ecd9; --ann-b: #fdf9f2; --ann-accent: var(--amber); }
.ann-tone--festive { --ann-a: #e2efe6; --ann-b: #fbf5e8; --ann-accent: #a8323a; }
.ann-tone--spring  { --ann-a: #e6f3dc; --ann-b: #f8fbf3; --ann-accent: #5d9a3a; }

.ann-media { position: relative; flex: none; width: 44px; height: 44px; }
.ann-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--teal-700);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  overflow: hidden;
  box-shadow: 0 0 0 2px #fff;
}
.ann-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-media .ann-emoji {
  position: absolute; right: -5px; bottom: -4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px;
  box-shadow: 0 1px 3px rgba(16, 40, 40, 0.2);
}
.ann-media--emoji .ann-emoji {
  position: static;
  width: 44px; height: 44px;
  font-size: 23px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px var(--line);
}

.ann-body { flex: 1; min-width: 0; }
.ann-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  color: var(--ann-accent);
  display: flex; align-items: center; gap: 8px;
}
.ann-when {
  margin-left: auto;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: var(--ink-400);
}
.ann-preview {
  font-size: 9.5px;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--ink-400);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  cursor: help;
}
.ann-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-900);
  margin-top: 3px;
  line-height: 1.3;
}
.ann-line, .ann-msg {
  font-size: 12.5px;
  color: var(--ink-600);
  margin-top: 3px;
  line-height: 1.45;
}
.ann-msg { color: var(--ink-400); white-space: pre-line; }

.ann-pic { margin-top: 8px; }
.ann-pic[hidden] { display: none; }
.ann-pic img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
