/* FILE: assets/css/alerts.css */

/* =========================
   ALERT GRID
========================= */

.alerts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

/* =========================
   ALERT CARD
========================= */

.alert-card {
  display: grid;
  grid-template-columns: 72px 1fr;

  height: 230px;
  min-height: 230px;

  border: 1px solid var(--cat);
  border-left: 8px solid var(--cat);
  border-radius: 14px;

  overflow: hidden;

  background: linear-gradient(180deg, #0b1622, #0a1420);

  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cat) 26%, transparent),
    0 0 18px color-mix(in srgb, var(--cat) 52%, transparent),
    0 10px 28px rgba(0,0,0,.24);

  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.alert-card:hover {
  transform: translateY(-1px);

  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cat) 34%, transparent),
    0 0 26px color-mix(in srgb, var(--cat) 68%, transparent),
    0 14px 30px rgba(0,0,0,.30);
}

/* =========================
   LEFT CATEGORY PANEL
========================= */

.alert-left {
  padding: 2px 2px;
  background: rgba(255,255,255,.04);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;

  text-align: center;
  overflow: hidden;
}

.cat-icon {
  width: 64px;
  height: 64px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
}

.cat-icon img,
.cat-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-name {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.05;

  color: #d8eaff;
  letter-spacing: .4px;

  text-transform: uppercase;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.service-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
}

/* =========================
   BODY
========================= */

.alert-body {
  padding: 4px 6px;
  min-width: 0;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  grid-template-rows: 1fr auto;
  gap: 4px 4px;

  overflow: hidden;
}

.alert-main {
  min-width: 0;
  overflow: hidden;

  height: 100%;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.alert-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.alert-head h3 {
  font-size: 16px;
  color: #ffffff;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.alert-preview {
  width: 230px;
  height: 185px;

  align-self: center;
  background: #07131d;

  overflow: hidden;
}

.meta {
  grid-column: 1 / -1;
}

/* =========================
   PRIORITY BADGE
========================= */

.priority {
  flex-shrink: 0;

  padding: 2px 6px;
  border-radius: 999px;

  font-size: 8px;
  font-weight: 900;
  letter-spacing: .6px;

  border: 1px solid rgba(255,255,255,.08);
  color: #ffffff;
  background: rgba(255,255,255,.04);
}

/* =========================
   TEXT ROWS
========================= */

.location,
.ngr,
.details,
.units-list {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.0;
  overflow-wrap: anywhere;
}

.location {
  color: #bcdcff;
}

.ngr {
  color: #8ed0ff;
}

.ngr a {
  color: #8ed0ff;
  text-decoration: underline;
}

.ngr a:hover {
  color: #ffffff;
}

/* =========================
   ALERT SECTIONS
========================= */

.alert-section {
  margin-top: 6px;
  min-width: 0;
}

.alert-section h4 {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.1;
  font-weight: 900;
  color: #9fd1ff;
  letter-spacing: .3px;
}

.alert-section p {
  margin: 0;
}

/* =========================
   DETAILS
========================= */

.details {
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;

  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;

  max-height: 73px;
  overflow: hidden;
}

/* =========================
   UNITS
========================= */

.units-list {
  margin: 0;
  color: var(--text);
  white-space: normal;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  max-height: 18px;
  overflow: hidden;
}

/* =========================
   META FOOTER
========================= */

.meta {
  margin-top: auto;
  padding-top: 2px;

  display: flex;
  align-items: center;

  font-size: 11px;
  color: var(--muted);

  width: 100%;
}

.meta-status {
  color: var(--muted);
}

.meta-more {
  margin-left: auto;
  margin-right: auto;

  font-size: 10px;
  font-weight: 900;
  color: #94A3B8;

  text-transform: uppercase;
}

.meta-created-by {
  margin-left: auto;
  color: var(--muted);
}

.meta-created-by strong {
  color: #d8eaff;
  font-weight: 900;
}

.meta-gap {
  display: none;
}

/* =========================
   IMAGE
========================= */

.alert-image {
  width: 100%;
  height: 100%;

  margin: 0;

  display: block;

  border-radius: 0;
  border: 0;

  max-height: none;

  object-fit: cover;
}

/* =========================
   PRIORITY COLORS (BADGE ONLY)
========================= */

.alert-card.info .priority {
  background: rgba(0,174,239,.28);
  border-color: rgba(0,174,239,.62);
  color: #c8f2ff;
  box-shadow: 0 0 10px rgba(0,174,239,.38);
}

.alert-card.low .priority {
  background: rgba(22,163,74,.30);
  border-color: rgba(22,163,74,.60);
  color: #b8ffd0;
  box-shadow: 0 0 10px rgba(22,163,74,.38);
}

.alert-card.medium .priority {
  background: rgba(255,204,0,.28);
  border-color: rgba(255,204,0,.62);
  color: #fff1a6;
  box-shadow: 0 0 10px rgba(255,204,0,.38);
}

.alert-card.high .priority {
  background: rgba(255,136,0,.30);
  border-color: rgba(255,136,0,.65);
  color: #ffd1a3;
  box-shadow: 0 0 11px rgba(255,136,0,.42);
}

.alert-card.critical .priority {
  background: rgba(255,59,48,.34);
  border-color: rgba(255,59,48,.70);
  color: #ffd0cc;
  box-shadow: 0 0 12px rgba(255,59,48,.48);
}

/* =========================
   NEW ALERT FLASH
========================= */

.alert-card.is-new {
  animation:
    pulse 1.4s ease-in-out infinite,
    alertBarFlash .7s linear infinite;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--cat) 26%, transparent),
      0 0 18px color-mix(in srgb, var(--cat) 52%, transparent),
      0 10px 28px rgba(0,0,0,.24);
  }

  50% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--cat) 38%, transparent),
      0 0 30px color-mix(in srgb, var(--cat) 75%, transparent),
      0 14px 30px rgba(0,0,0,.30);
  }
}

@keyframes alertBarFlash {
  0%, 100% {
    border-left-color: var(--cat);
  }

  50% {
    border-left-color: color-mix(in srgb, var(--cat) 55%, black);
  }
}