/* Shared broadcast UI: banner stack + modal queue rendered by
   public/js/announcementFeed.js from GET /me/announcements. */

/* The site header is position:fixed (out of document flow), so this stack -
   the first thing in normal flow right after it - needs its own offset to
   clear it; "top: 0" alone would tuck it underneath the header instead of
   below it. Sticking at --header-height keeps it pinned just under the
   header on scroll instead of jumping to the real viewport top. */
.ann-banner-stack {
  position: sticky;
  top: var(--header-height, 64px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
}

.ann-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 44px 12px 16px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.ann-banner + .ann-banner { margin-top: 1px; }

.ann-banner-info    { background: #eef4ff; color: #1d3a8a; }
.ann-banner-success  { background: #eafaf0; color: #17643c; }
.ann-banner-warning  { background: #fff7e6; color: #8a5a00; }
.ann-banner-new      { background: #f3ecff; color: #5b2fa8; }

.ann-banner strong { font-weight: 600; }

.ann-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  text-decoration: underline;
  color: inherit;
}

.ann-banner-dismiss {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 4px;
}
.ann-banner-dismiss:hover { opacity: 1; }

.ann-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(15, 20, 30, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: background 0.15s ease;
}
.ann-modal-overlay[hidden] { display: none; }

/* Bottom-right / bottom-left: a non-blocking corner card instead of a
   centered, backdrop-blocking dialog - the page stays usable behind it.
   Only on screens with room for it; phones keep the classic centered
   dialog (set on the JS side, see announcementFeed.js). */
.ann-modal-overlay.ann-pos-bottom-right,
.ann-modal-overlay.ann-pos-bottom-left {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  /* Clears the chatbot bubble (fixed, bottom:20px/right:20px, 52px). */
  padding: 0 20px 92px 20px;
}
.ann-modal-overlay.ann-pos-bottom-right { justify-content: flex-end; align-items: flex-end; }
.ann-modal-overlay.ann-pos-bottom-left  { justify-content: flex-start; align-items: flex-end; }
.ann-modal-overlay.ann-pos-bottom-right .ann-modal,
.ann-modal-overlay.ann-pos-bottom-left .ann-modal {
  pointer-events: auto;
  margin: 0;
  width: min(380px, 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.08);
}

.ann-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: annModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes annModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ann-modal-banner-bar { height: 6px; border-radius: 14px 14px 0 0; }
.ann-modal-banner-bar.ann-info    { background: #3b6fe0; }
.ann-modal-banner-bar.ann-success  { background: #2fa864; }
.ann-modal-banner-bar.ann-warning  { background: #e0a324; }
.ann-modal-banner-bar.ann-new      { background: #8a4fe0; }

.ann-modal-body { padding: 24px; }

.ann-modal-image {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
}

.ann-modal-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #16181d;
}

.ann-modal-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: #454b57;
  white-space: pre-wrap;
}

.ann-modal-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ann-modal-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.ann-modal-cta.primary   { background: #3b6fe0; color: #fff; }
.ann-modal-cta.secondary { background: #eef1f6; color: #23262f; }
.ann-modal-cta.link      { background: none; color: #3b6fe0; text-decoration: underline; padding-left: 0; padding-right: 0; }

.ann-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eef0f4;
}

.ann-modal-queue-hint { font-size: 12px; color: #8a90a0; }

.ann-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.ann-modal-close:hover { background: #f1f5f9 !important; color: #0f172a; }

/* Dashboard notices: rendered into #ann-dashboard-notices on the school
   dashboard and the admin dashboard (announcementFeed.js). */
.ann-dashboard-notices {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.ann-dashboard-notices:empty { display: none; }
.ann-notice {
  position: relative;
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid #2563eb;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  text-align: left;
}
.ann-notice-success { border-left-color: #16a34a; }
.ann-notice-warning { border-left-color: #d97706; }
.ann-notice-new     { border-left-color: #7c3aed; }
.ann-notice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ann-notice-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}
.ann-notice-text {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #475569;
  white-space: pre-line;
}
.ann-notice-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ann-notice-ctas .ann-modal-cta { width: auto; margin: 0; }
.ann-notice-close {
  flex-shrink: 0;
  width: 28px !important;
  height: 28px;
  margin: -4px -6px 0 0 !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  border-radius: 50%;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.ann-notice-close:hover { background: #f1f5f9 !important; color: #0f172a !important; }
.ann-dashboard-notices--org {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
}
