/* src/common/equipmentAlerts/equipmentAlerts.css */

/* ── Backdrop ── */
.eq-alerts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.eq-alerts-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Panel ── */
.eq-alerts-panel {
  position: fixed;
  z-index: 1000;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, opacity 0.2s ease;
  -webkit-overflow-scrolling: touch;

  /* Default: centered card (landscape tablets / desktop) */
  top: 50%;
  left: 50%;
  width: min(520px, 92vw);
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  pointer-events: none;
}

.eq-alerts-panel--visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Portrait phones: slide up from bottom as a sheet */
@media (max-width: 600px) and (orientation: portrait) {
  .eq-alerts-panel {
    top: auto;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    transform: translate(0, 100%);
    opacity: 1;
  }

  .eq-alerts-panel--visible {
    transform: translate(0, 0);
  }
}

/* ── Header ── */
.eq-alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--surface-border, #dee2e6);
  flex-shrink: 0;
}

.eq-alerts-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color, #212529);
}

.eq-alerts-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: none;
  background: var(--surface-hover, #e9ecef);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color, #212529);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.eq-alerts-close:active {
  background: var(--surface-300, #dee2e6);
}

/* ── Body (scrollable) ── */
.eq-alerts-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.4rem 1.6rem;
  -webkit-overflow-scrolling: touch;
}

/* ── Section ── */
.eq-alerts-section {
  margin-bottom: 1.4rem;
}

.eq-alerts-section:last-child {
  margin-bottom: 0;
}

.eq-alerts-section-title {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-color, #212529);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.eq-alerts-section-icon {
  font-size: 1.1rem;
}

.eq-alerts-count {
  font-weight: 400;
  color: var(--text-color-secondary, #6c757d);
  font-size: 0.95rem;
}

/* ── List ── */
.eq-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--surface-border, #dee2e6);
  border-radius: 12px;
  overflow: hidden;
}

.eq-alerts-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border, #dee2e6);
  font-size: 0.95rem;
}

.eq-alerts-item:last-child {
  border-bottom: none;
}

.eq-alerts-name {
  font-weight: 600;
  color: var(--text-color, #212529);
  word-break: break-word;
}

.eq-alerts-detail {
  font-size: 0.85rem;
}

.eq-alerts-detail--danger {
  color: #b91c1c;
}

.eq-alerts-detail--warn {
  color: #92400e;
}

.eq-alerts-empty {
  color: var(--text-color-secondary, #6c757d);
  font-style: italic;
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.eq-alerts-loading,
.eq-alerts-error {
  text-align: center;
  padding: 2rem 0;
  font-size: 1rem;
  color: var(--text-color-secondary, #6c757d);
  margin: 0;
}

.eq-alerts-error {
  color: #b91c1c;
}

/* ── Bell button (topbar) ── */
.topbar-bell-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 0;
  border-radius: 12px;
  border: 1px solid var(--surface-border, #dee2e6);
  background: var(--surface-card, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.topbar-bell-btn:hover {
  background: var(--surface-hover, #e9ecef);
}

.topbar-bell-btn:active {
  background: var(--surface-300, #dee2e6);
}

.topbar-bell-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-color, #212529);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

/* Severity color states */
.topbar-bell-btn.bell--red {
  border-color: #dc3545;
  background: #fff5f5;
}
.topbar-bell-btn.bell--red svg {
  stroke: #dc3545;
}

.topbar-bell-btn.bell--yellow {
  border-color: #f59e0b;
  background: #fffbeb;
}
.topbar-bell-btn.bell--yellow svg {
  stroke: #b45309;
}

.topbar-bell-btn.bell--green {
  border-color: #22c55e;
  background: #f0fdf4;
}
.topbar-bell-btn.bell--green svg {
  stroke: #16a34a;
}

.topbar-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  transition: background 0.2s;
}

.topbar-bell-badge.badge--red {
  background: #dc3545;
}

.topbar-bell-badge.badge--yellow {
  background: #f59e0b;
}

.topbar-bell-badge.badge--green {
  background: #22c55e;
}
