/* ═══════════════════════════════════════════════════════════════
   Alerts History Page
═══════════════════════════════════════════════════════════════ */

/* ── Page Header ───────────────────────────────────────────── */
.alerts-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
}

/* .back-btn defined globally in styles.css */

.alerts-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.alerts-count-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  min-width: 24px;
  text-align: center;
}

.alerts-clear-btn {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.alerts-clear-btn:hover {
  color: var(--red);
  border-color: var(--red-dim);
  background: var(--red-soft);
}
.alerts-clear-btn--confirm {
  color: var(--red);
  border-color: var(--red-dim);
  background: var(--red-soft);
  font-size: 0.65rem;
}
.alerts-clear-btn--done {
  color: var(--green);
  border-color: rgba(45,198,83,0.35);
  background: rgba(45,198,83,0.10);
  pointer-events: none;
}

/* ── Watching Panel (outer container) ──────────────────────── */
.alerts-watching-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* ── Each sub-widget ─────────────────────────────────────────── */
.aw-widget {
  padding: 12px 16px 14px;
  background: var(--bg-primary);
}
.aw-widget + .aw-widget {
  border-top: 1px solid var(--border-subtle);
}

.aw-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.aw-widget-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── Chip row ────────────────────────────────────────────────── */
.aw-widget-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ── Base chip ───────────────────────────────────────────────── */
.alerts-watch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 5px 11px 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Saved match — amber */
.alerts-watch-chip--saved {
  background: rgba(244, 160, 28, 0.08);
  border: 1px solid rgba(244, 160, 28, 0.3);
  color: #F4A01C;
}

/* Followed team — green */
.alerts-watch-chip--team {
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.28);
  color: #30D158;
}

/* Followed referee — blue */
.alerts-watch-chip--ref {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #60a5fa;
}

/* Tracked player — orange */
.alerts-watch-chip--player {
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.28);
  color: #FF6B00;
}

/* ── × remove button ─────────────────────────────────────────── */
.watch-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 3px;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: opacity 0.15s, background 0.15s;
}
.watch-chip-remove:hover {
  opacity: 1;
  background: rgba(255,255,255,0.12);
}

/* ── Filter Bar ────────────────────────────────────────────── */
.alerts-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}
.alerts-filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-chip:hover {
  border-color: var(--red-dim);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Alert List ────────────────────────────────────────────── */
.alerts-list {
  padding: 0 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Date Separator ────────────────────────────────────────── */
.alerts-date-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 8px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.alerts-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ── Alert Row ─────────────────────────────────────────────── */
.alert-history-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeInRow 0.25s ease both;
}
.alert-history-row:last-child { border-bottom: none; }

@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered entry */
.alert-history-row:nth-child(1)  { animation-delay: 0.03s; }
.alert-history-row:nth-child(2)  { animation-delay: 0.06s; }
.alert-history-row:nth-child(3)  { animation-delay: 0.09s; }
.alert-history-row:nth-child(4)  { animation-delay: 0.12s; }
.alert-history-row:nth-child(5)  { animation-delay: 0.15s; }

.alert-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
  border-left: 3px solid var(--alert-row-color, var(--yellow));
  background: var(--alert-row-bg, rgba(244,160,28,0.08));
}

.alert-row-body {
  flex: 1;
  min-width: 0;
}

.alert-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.alert-row-type {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--alert-row-color, var(--yellow));
}

.alert-row-minute {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
}

.alert-row-push-badge {
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 2px;
}

.alert-row-player {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.alert-row-match {
  font-size: 0.67rem;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-row-message {
  font-size: 0.7rem;
  color: var(--alert-row-color, var(--yellow));
  margin-top: 5px;
  font-weight: 500;
  line-height: 1.3;
}

.alert-row-time {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 4px;
  flex-shrink: 0;
  text-align: right;
}

/* ── Loading / Empty States ────────────────────────────────── */
.alerts-loading,
.alerts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 24px;
  text-align: center;
}

.alerts-empty-icon {
  font-size: 2.5rem;
  opacity: 0.35;
}

.alerts-empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.alerts-empty-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 240px;
}

.alerts-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Error state ───────────────────────────────────────────── */
.alerts-error {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════════════
   PUSH NOTIFICATION CARD
══════════════════════════════════════════════════════════════ */
.push-notif-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 10px;
  margin: 12px 16px 4px;
}

.push-notif-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.push-notif-body {
  flex: 1;
  min-width: 0;
}

.push-notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.push-notif-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.push-toggle-btn {
  flex-shrink: 0;
  padding: 6px 13px;
  border-radius: 7px;
  border: 1px solid rgba(251,191,36,0.3);
  background: rgba(251,191,36,0.08);
  color: #fbbf24;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  white-space: nowrap;
}

.push-toggle-btn:hover {
  background: rgba(251,191,36,0.16);
  border-color: rgba(251,191,36,0.5);
}

.push-toggle-btn:active { transform: scale(0.95); }

.push-toggle-btn--active {
  background: rgba(251,191,36,0.18);
  border-color: #fbbf24;
  color: #fbbf24;
}

.push-toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
