/* ══════════════════════════════════════════════
   HR Dashboard — Announcements & Notifications Styles
   ══════════════════════════════════════════════ */

/* ────────────────────────────────────────────
   ANNOUNCEMENTS PAGE
   ──────────────────────────────────────────── */

/* ── Header row ── */
.ann-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ann-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ann-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.ann-new-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.ann-new-btn:active {
  transform: translateY(0);
}

/* ── Audience Badge ── */
.ann-card__audience-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 6px;
}

/* ── Priority filter pills ── */
.ann-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ann-filter {
  padding: 7px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.ann-filter:hover {
  border-color: #94a3b8;
  color: #1e293b;
  background: #f8fafc;
}

.ann-filter--active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}

.ann-filter--active:hover {
  background: #334155;
  border-color: #334155;
  color: #fff;
}

/* ── Announcement feed ── */
.ann-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ann-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
  font-size: 0.95rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ── Announcement card ── */
.ann-card {
  display: flex;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ann-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
}

/* Left colored priority bar */
.ann-card__priority-bar {
  width: 5px;
  flex-shrink: 0;
  border-radius: 12px 0 0 12px;
}

/* Card body */
.ann-card__body {
  flex: 1;
  padding: 18px 22px;
  min-width: 0;
}

/* Card header row */
.ann-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ann-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.35;
}

.ann-card__priority-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Meta line (date + author) */
.ann-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: #64748b;
}

.ann-card__separator {
  color: #cbd5e1;
}

/* Content with collapse / expand */
.ann-card__content-wrapper {
  position: relative;
}

.ann-card__content {
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.ann-card__content--collapsed {
  max-height: 2.8em;       /* approx 2 lines */
  line-height: 1.4;
}

.ann-card__content--expanded {
  max-height: 600px;       /* large enough for any content */
  line-height: 1.6;
}

.ann-card__content p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: inherit;
}

.ann-card__readmore {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: #3b82f6;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ann-card__readmore:hover {
  color: #2563eb;
  text-decoration: underline;
}


/* ────────────────────────────────────────────
   NEW ANNOUNCEMENT MODAL
   ──────────────────────────────────────────── */

.ann-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ann-modal-overlay--visible {
  display: flex;
  opacity: 1;
}

.ann-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  margin: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: ann-modal-slide-in 0.3s ease;
  overflow: hidden;
}

@keyframes ann-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ann-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.ann-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.ann-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.ann-modal__close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.ann-modal__body {
  padding: 20px 24px;
}

.ann-modal__field {
  margin-bottom: 16px;
}

.ann-modal__field:last-child {
  margin-bottom: 0;
}

.ann-modal__field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ann-modal__field input[type="text"],
.ann-modal__field select,
.ann-modal__field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.ann-modal__field input[type="text"]:focus,
.ann-modal__field select:focus,
.ann-modal__field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ann-modal__field textarea {
  resize: vertical;
  min-height: 100px;
}

.ann-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.ann-modal__cancel {
  padding: 9px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ann-modal__cancel:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.ann-modal__post {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.ann-modal__post:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}


/* ────────────────────────────────────────────
   NOTIFICATION BELL & DROPDOWN
   ──────────────────────────────────────────── */

/* Bell wrapper (positioned inside the header container) */
.notif-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Bell button */
.notif-bell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-bell-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.notif-bell-icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* Red badge (absolute top-right of bell button) */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 9px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.4);
  pointer-events: none;
}

/* Dropdown panel */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
}

.notif-dropdown--open {
  max-height: 400px;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
}

/* Dropdown header */
.notif-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.notif-dropdown__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

.notif-mark-all {
  border: none;
  background: none;
  color: #3b82f6;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.notif-mark-all:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Notification list */
.notif-list {
  padding: 6px 0;
}

.notif-empty {
  padding: 32px 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* Individual notification item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.notif-item:hover {
  background: #f8fafc;
}

/* Unread state */
.notif-item--unread {
  border-left: 3px solid #3b82f6;
  background: #f0f7ff;
}

.notif-item--unread:hover {
  background: #e8f1fd;
}

.notif-item--unread .notif-item__message {
  font-weight: 600;
  color: #1e293b;
}

/* Notification icon */
.notif-item__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 8px;
}

/* Notification body */
.notif-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-item__message {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
  font-weight: 400;
}

.notif-item__time {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Unread dot indicator */
.notif-item__dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}


/* ────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .ann-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ann-new-btn {
    width: 100%;
    justify-content: center;
  }

  .ann-card__header {
    flex-direction: column;
    gap: 6px;
  }

  .ann-card__priority-badge {
    align-self: flex-start;
  }

  .ann-card__body {
    padding: 14px 16px;
  }

  /* Notification dropdown */
  .notif-dropdown {
    width: calc(100vw - 32px);
    right: -10px;
  }

  .ann-modal {
    max-width: calc(100vw - 32px);
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .ann-filters {
    gap: 6px;
  }

  .ann-filter {
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  .ann-page-title {
    font-size: 1.25rem;
  }

  .ann-card__title {
    font-size: 1rem;
  }

  .notif-dropdown {
    width: calc(100vw - 24px);
    right: -6px;
  }

  .notif-item {
    padding: 10px 14px;
    gap: 10px;
  }

  .notif-item__icon {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}


/* ────────────────────────────────────────────
   DARK THEME OVERRIDES
   ──────────────────────────────────────────── */

.theme-dark .ann-page-title {
  color: #e2e8f0;
}

.theme-dark .ann-card {
  background: #1e293b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .ann-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.theme-dark .ann-card__title {
  color: #f1f5f9;
}

.theme-dark .ann-card__meta {
  color: #94a3b8;
}

.theme-dark .ann-card__content p {
  color: #cbd5e1;
}

.theme-dark .ann-filter {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.theme-dark .ann-filter:hover {
  border-color: #475569;
  color: #e2e8f0;
  background: #334155;
}

.theme-dark .ann-filter--active {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #f1f5f9;
}

.theme-dark .ann-empty {
  background: #1e293b;
  color: #64748b;
}

.theme-dark .ann-modal {
  background: #1e293b;
}

.theme-dark .ann-modal__header {
  border-bottom-color: #334155;
}

.theme-dark .ann-modal__title {
  color: #f1f5f9;
}

.theme-dark .ann-modal__close {
  background: #334155;
  color: #94a3b8;
}

.theme-dark .ann-modal__close:hover {
  background: #475569;
  color: #f1f5f9;
}

.theme-dark .ann-modal__field label {
  color: #94a3b8;
}

.theme-dark .ann-modal__field input[type="text"],
.theme-dark .ann-modal__field select,
.theme-dark .ann-modal__field textarea {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.theme-dark .ann-modal__footer {
  background: #0f172a;
  border-top-color: #334155;
}

.theme-dark .ann-modal__cancel {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.theme-dark .ann-modal__cancel:hover {
  background: #334155;
  border-color: #475569;
}

.theme-dark .notif-dropdown {
  background: #1e293b;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.theme-dark .notif-dropdown__header {
  background: #1e293b;
  border-bottom-color: #334155;
}

.theme-dark .notif-dropdown__title {
  color: #f1f5f9;
}

.theme-dark .notif-item:hover {
  background: #334155;
}

.theme-dark .notif-item--unread {
  background: rgba(59, 130, 246, 0.1);
}

.theme-dark .notif-item--unread:hover {
  background: rgba(59, 130, 246, 0.15);
}

.theme-dark .notif-item__message {
  color: #cbd5e1;
}

.theme-dark .notif-item--unread .notif-item__message {
  color: #f1f5f9;
}

.theme-dark .notif-item__time {
  color: #64748b;
}

.theme-dark .notif-item__icon {
  background: #334155;
}

.theme-dark .notif-empty {
  color: #64748b;
}

.theme-dark .notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
