/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
/* Smooth Marquee Animation */
.marquee {
  display: inline-block;
  padding-left: 100%;                    /* Start from right */
  animation: marquee 90s linear infinite;
  will-change: transform;
}

.marquee:hover {
  animation-play-state: paused;          /* Pause on hover - nice UX */
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* Optional: Faster animation for longer messages */
.marquee.long-text {
  animation-duration: 45s;
}


/* app/assets/stylesheets/admin/announcements.css */

/* ── Layout ──────────────────────────────────────────── */
.announcements-admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: "DM Sans", system-ui, sans-serif;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn-primary {
  background: #111;
  color: #fff;
}
.btn-primary:hover { background: #333; }

.btn-ghost {
  background: transparent;
  color: #374151;
  border: 1.5px solid #d1d5db;
}
.btn-ghost:hover { background: #f3f4f6; }

.btn-icon { font-size: 1.1em; line-height: 1; }

/* ── Table ───────────────────────────────────────────── */
.announcements-table-wrapper {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.announcements-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.announcements-table thead th {
  background: #f9fafb;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1.5px solid #e5e7eb;
}

.announcement-row td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
  color: #111;
}

.announcement-row:last-child td { border-bottom: none; }
.announcement-row.row--inactive { opacity: 0.55; }

.col-title .title-text {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.col-title .message-preview {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Level badges */
.level-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.level-0 { background: #dbeafe; color: #1d4ed8; }
.level-1 { background: #fef3c7; color: #b45309; }
.level-2 { background: #fee2e2; color: #b91c1c; }

/* Status dot */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.status-active  { background: #22c55e; }
.status-inactive { background: #d1d5db; }

.time-range { font-variant-numeric: tabular-nums; color: #374151; }
.text-muted { color: #9ca3af; }

/* Actions */
.col-actions { white-space: nowrap; }
.action-link {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.action-link:hover { color: #111; }
.action-link--danger { color: #ef4444; }
.action-link--danger:hover { color: #b91c1c; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border: 1.5px dashed #d1d5db;
  border-radius: 12px;
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: #111; margin: 0 0 0.4rem; }
.empty-desc  { font-size: 0.875rem; color: #6b7280; margin: 0 0 1.5rem; }

/* ── Form card ───────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
}

.announcement-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group--full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #111;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.form-control:focus {
  outline: none;
  border-color: #111;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
  background: #fff;
}

textarea.form-control { resize: vertical; }

/* Toggle */
.toggle-wrapper { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.2rem; }
.form-toggle { display: none; }
.toggle-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.toggle-track {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.form-toggle:checked + .toggle-label .toggle-track { background: #111; }
.form-toggle:checked + .toggle-label .toggle-track::after { transform: translateX(18px); }
.toggle-text { font-size: 0.875rem; color: #374151; }

/* Form errors */
.form-errors {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.errors-title { font-weight: 600; color: #b91c1c; font-size: 0.875rem; margin: 0 0 0.5rem; }
.form-errors ul { margin: 0; padding-left: 1.25rem; font-size: 0.85rem; color: #991b1b; }

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
}

/* ── Global announcement banner ──────────────────────── */
.global-announcement {
  width: 100%;
  padding: 0.75rem 1rem;
}

.global-announcement--level-0 { background: #eff6ff; border-bottom: 2px solid #bfdbfe; }
.global-announcement--level-1 { background: #fffbeb; border-bottom: 2px solid #fde68a; }
.global-announcement--level-2 { background: #fef2f2; border-bottom: 2px solid #fca5a5; }

.global-announcement__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.global-announcement__icon { font-size: 1.1rem; flex-shrink: 0; }

.global-announcement__content { flex: 1; font-size: 0.875rem; }
.global-announcement__title { font-weight: 700; margin-right: 0.4rem; }
.global-announcement__message { color: #374151; }

.global-announcement__dismiss {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
  flex-shrink: 0;
  padding: 0 0.25rem;
}
.global-announcement__dismiss:hover { color: #374151; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .announcement-form .form-grid { grid-template-columns: 1fr; }
  .announcements-table { font-size: 0.8rem; }
  .col-window, .col-created { display: none; }
}



/* ── Layout ── */
.users-header {
  margin-bottom: 1.5rem;
}

.users-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.users-heading {
  font-size: 1.375rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ── Primary Button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { transform: scale(0.98); }

/* ── Tab Nav ── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1.5px solid #e2e8f0;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-link:hover { color: #0f172a; }
.tab-link--active { color: #2563eb; border-bottom-color: #2563eb; }
.tab-link--deleted { color: #dc2626; border-bottom-color: #dc2626; }

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tab-dot--active { background: #22c55e; }
.tab-dot--deleted { background: #f87171; }

/* ── Table ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.users-table thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.users-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.users-table td {
  padding: 0.875rem 1rem;
  color: #0f172a;
  vertical-align: middle;
}

.user-row {
  border-top: 1px solid #f1f5f9;
  transition: background 0.1s ease;
}

.user-row:hover { background: #f8fafc; }
.user-row--deleted { opacity: 0.6; background: #fef2f2; }
.user-row--deleted:hover { background: #fee2e2; }

/* ── User Name Cell ── */
.user-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.user-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-fullname {
  font-weight: 500;
  color: #0f172a;
  line-height: 1.3;
}

.user-email-mobile {
  font-size: 0.75rem;
  color: #64748b;
}

.text-muted { color: #64748b; }

/* ── Account Badge ── */
.account-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

/* ── Status Badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge--deleted {
  background: #fef2f2;
  color: #dc2626;
}

/* ── Actions ── */
.actions-cell { white-space: nowrap; }

.action-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.action-btn--edit {
  color: #2563eb;
  background: #eff6ff;
}
.action-btn--edit:hover { background: #dbeafe; }

.action-btn--delete {
  color: #dc2626;
  background: #fef2f2;
}
.action-btn--delete:hover { background: #fee2e2; }

.action-btn--restore {
  color: #16a34a;
  background: #f0fdf4;
}
.action-btn--restore:hover { background: #dcfce7; }

/* ── Responsive Breakpoints ── */
@media (max-width: 768px) {
  .hide-mobile { display: none; }

  .users-table th,
  .users-table td {
    padding: 0.75rem 0.75rem;
  }

  .action-btn span { display: none; }
  .action-btn {
    padding: 6px 8px;
    border-radius: 6px;
  }

  .users-heading { font-size: 1.125rem; }

  .btn-primary {
    font-size: 0.8rem;
    padding: 0.45rem 0.8rem;
  }
}

@media (max-width: 1024px) {
  .hide-tablet { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none; }
}