@import url("/css/pages/default.css");

.announcements-page {
  flex: 1;
  min-height: 0;
}

.announcements-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 32px;
}

.announcements-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.announcements-title h1 {
  margin: 0;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: normal;
}

.announcements-title p {
  margin: 4px 0 0;
  max-width: 520px;
  color: #41484c;
  font-size: 16px;
  line-height: 24px;
}

.announcements-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcements-notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 14px;
  font-weight: 600;
}

.announcements-notice[hidden] {
  display: none !important;
}

.announcements-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.announcements-stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  background: #ffffff;
}

.announcements-stat-card__title {
  color: #41484c;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.announcements-stat-card strong {
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
}

.announcements-table-card {
  border: 1px solid #e3e6ea;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.announcements-table-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid #eceef1;
}

.announcements-table-card__title-row h2 {
  margin: 0;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.announcements-table-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.announcements-table-filter__label {
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}

.custom-select--announcements-status {
  min-width: 180px;
}

.announcements-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.announcements-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: auto;
}

.announcements-table__empty td {
  padding: 32px 20px;
  color: #71787d;
  text-align: center;
  white-space: normal;
}

.announcements-table th,
.announcements-table td {
  padding: 14px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 20px;
  border-bottom: 1px solid #eceef1;
  white-space: nowrap;
  vertical-align: middle;
}

.announcements-table th {
  color: #41484c;
  font-weight: 600;
  background: #fafbfc;
}

.announcements-table td {
  color: #191c1d;
}

.announcements-table td.is-muted {
  color: #71787d;
}

.announcements-table tbody tr:last-child td {
  border-bottom: 0;
}

.announcements-text-preview {
  display: inline-block;
  max-width: 220px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.announcements-text-preview:hover {
  color: #00658f;
  text-decoration: underline;
}

.announcements-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.announcements-table th:nth-child(1),
.announcements-table td:nth-child(1) {
  min-width: 160px;
}

.announcements-table th:nth-child(2),
.announcements-table td:nth-child(2) {
  min-width: 180px;
}

.announcements-table th:nth-child(3),
.announcements-table td:nth-child(3) {
  min-width: 100px;
}

.announcements-table th:nth-child(4),
.announcements-table td:nth-child(4),
.announcements-table th:nth-child(5),
.announcements-table td:nth-child(5) {
  min-width: 110px;
}

.announcements-table th:nth-child(6),
.announcements-table td:nth-child(6) {
  min-width: 100px;
}

.announcements-table th:nth-child(7),
.announcements-table td:nth-child(7) {
  min-width: 120px;
  padding-right: 20px;
}

.announcements-table td.is-date {
  color: #41484c;
}

.announcements-table td.is-actions {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.announcements-status.is-live {
  background: #e8f5e9;
  color: #2e7d32;
}

.announcements-status.is-scheduled {
  background: #e3f2fd;
  color: #1565c0;
}

.announcements-status.is-expired {
  background: #fce8e8;
  color: #b31b25;
}

.announcements-status.is-inactive {
  background: #fff3e0;
  color: #e65100;
}



.announcements-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.announcements-modal[hidden] {
  display: none !important;
}

.announcements-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 28, 29, 0.45);
}

.announcements-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(560px, 100%);
  flex-direction: column;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(25, 28, 29, 0.18);
}

.announcements-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #eceef1;
  flex-shrink: 0;
}

.announcements-modal__header h2 {
  margin: 0;
  color: #191c1d;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.announcements-modal__close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #41484c;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.announcements-modal__form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.announcements-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
}

.announcements-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.announcements-modal__fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.announcements-modal__fields label > span {
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.announcements-modal__fields input[type="text"],
.announcements-modal__fields textarea {
  width: 100%;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #f9f9fb;
  color: #191c1d;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  padding: 12px 14px;
}

.announcements-modal__fields textarea {
  min-height: 120px;
  resize: vertical;
}

.announcements-modal__row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.announcements-modal__field--toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 12px !important;
}

.announcements-modal__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 14px;
}

.announcements-modal__error[hidden] {
  display: none !important;
}

.announcements-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid #eceef1;
  flex-shrink: 0;
  background: #ffffff;
}

.announcements-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.announcements-modal__confirm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.announcements-modal__confirm-name {
  margin: 0;
  color: #191c1d;
  font-weight: 600;
}

.announcements-modal__preview-body {
  max-height: 50vh;
  overflow: auto;
}

.announcements-modal__preview-text {
  margin: 0;
  color: #41484c;
  font-size: 15px;
  line-height: 24px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .announcements-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .announcements-main {
    padding: 20px 16px 32px;
  }

  .announcements-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .announcements-toolbar__actions {
    width: 100%;
    justify-content: stretch;
  }

  .announcements-toolbar__actions .add-btn {
    width: 100%;
    justify-content: center;
  }

  .announcements-pagination {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .announcements-pagination .table-pagination-footer__controls {
    margin-left: auto;
    justify-content: flex-end;
    align-self: auto;
    width: auto;
  }

  .announcements-modal__row {
    grid-template-columns: 1fr;
  }

  .announcements-modal:not(.announcements-modal--confirm):not(.announcements-modal--preview) {
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top, 0px)) 12px max(20px, env(safe-area-inset-bottom, 0px));
  }

  .announcements-modal:not(.announcements-modal--confirm):not(.announcements-modal--preview) .announcements-modal__panel {
    width: 100%;
    max-height: calc(100vh - 64px);
    max-height: min(82dvh, calc(100dvh - 64px));
  }

  .announcements-modal:not(.announcements-modal--confirm):not(.announcements-modal--preview) .announcements-modal__header {
    padding: 16px 16px 0;
    border-bottom: 0;
  }

  .announcements-modal:not(.announcements-modal--confirm):not(.announcements-modal--preview) .announcements-modal__body {
    padding: 16px;
  }

  .announcements-modal:not(.announcements-modal--confirm):not(.announcements-modal--preview) .announcements-modal__footer {
    padding: 12px 16px 16px;
  }

  .announcements-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .announcements-table {
    min-width: 920px;
  }

  .announcements-table th,
  .announcements-table td {
    padding: 12px 14px;
  }

  .announcements-text-preview {
    max-width: 200px;
  }
}
