/* FILE: assets/css/lifeboat.css */

/* =========================
   LIFEBOAT BOX
========================= */

.lifeboat-launch-box {
  border-color: rgba(47,129,247,.75);

  box-shadow:
    0 0 0 1px rgba(47,129,247,.16),
    0 0 14px rgba(47,129,247,.32),
    0 10px 24px rgba(0,0,0,.22);
}

/* =========================
   HEADER IMAGE
========================= */

.lifeboat-header-img {
  height: 95px;

  margin: -14px -14px 10px;

  border-radius: 14px 14px 0 0;

  background-image: url("/images/rnli2.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;

  filter: brightness(1.05) contrast(1.05) saturate(1.05);
}

/* =========================
   STATION NAME TOP DIVIDER
========================= */

.lifeboat-station-name::before {
  content: "";
  display: block;

  height: 2px;
  margin: 0 -14px 8px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(47,129,247,.95),
    transparent
  );

  box-shadow:
    0 0 6px rgba(47,129,247,.85),
    0 0 12px rgba(47,129,247,.55);
}

/* =========================
   CONTENT
========================= */

.lifeboat-launch-content {
  display: grid;
  gap: 8px;
}

.lifeboat-station-name {
  position: relative;

  text-align: center;

  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  line-height: 1.35;

  padding-bottom: 10px;
  margin-bottom: 2px;

  text-shadow: 0 0 6px rgba(47,129,247,.45);
}

.lifeboat-station-name::after {
  content: "";
  position: absolute;

  left: -14px;
  right: -14px;
  bottom: 0;

  height: 2px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(47,129,247,.95),
    transparent
  );

  box-shadow:
    0 0 6px rgba(47,129,247,.85),
    0 0 12px rgba(47,129,247,.55);
}

/* =========================
   INFO ROWS
========================= */

.lifeboat-launch-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: center;

  padding: 7px 8px;
  border-radius: 10px;

  background: rgba(255,255,255,.025);
}

.lifeboat-launch-row span {
  color: var(--muted);
  font-size: 13px;
}

.lifeboat-launch-row strong {
  margin: 0;
  color: #ffffff;
  font-size: 13px;
}

/* =========================
   STATUS BAR
========================= */

.lifeboat-standby-bar,
.lifeboat-status-bar {
  margin-top: 4px;

  text-align: center;

  padding: 9px 10px;
  border-radius: 10px;

  font-size: 13px;
  font-weight: 900;
  letter-spacing: .5px;

  color: #d6f5df;

  background:
    linear-gradient(180deg, rgba(22,163,74,.22), rgba(22,163,74,.10));

  border: 1px solid rgba(22,163,74,.30);
}

/* =========================
   ACTIVE LAUNCHING
========================= */

.launching-now-bar {
  color: #ffffff !important;

  background:
    linear-gradient(180deg, rgba(255,59,48,.45), rgba(255,59,48,.22)) !important;

  border-color: rgba(255,59,48,.85) !important;

  box-shadow:
    0 0 0 1px rgba(255,59,48,.45),
    0 0 18px rgba(255,59,48,.75),
    inset 0 0 14px rgba(255,59,48,.22);

  animation: flashRed .75s ease-in-out infinite;
}

/* Outside lifeboat box when launch mode is active */
.lifeboat-launch-box:has(.launching-now-bar) {
  border-color: rgba(255,59,48,1);

  box-shadow:
    0 0 0 2px rgba(255,59,48,.65),
    0 0 28px rgba(255,59,48,.85),
    0 0 58px rgba(255,59,48,.45),
    0 10px 24px rgba(0,0,0,.28);

  animation: lifeboatBoxFlashRed .75s ease-in-out infinite;

  will-change: box-shadow, border-color;
}

/* Turn the two blue station divider lines red when active */
.lifeboat-launch-box:has(.launching-now-bar) .lifeboat-station-name::before,
.lifeboat-launch-box:has(.launching-now-bar) .lifeboat-station-name::after {
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,59,48,1),
    transparent
  );

  box-shadow:
    0 0 8px rgba(255,59,48,.95),
    0 0 18px rgba(255,59,48,.75),
    0 0 30px rgba(255,59,48,.45);
}

.lifeboat-launch-box:has(.launching-now-bar) .lifeboat-station-name {
  text-shadow:
    0 0 6px rgba(255,59,48,.65),
    0 0 14px rgba(255,59,48,.45);
}

/* =========================
   WARNING BAR
========================= */

.lifeboat-warning-bar {
  margin-top: 8px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px;
  border-radius: 10px;

  background:
    linear-gradient(180deg, rgba(255,204,0,.24), rgba(255,204,0,.10));

  border: 1px solid rgba(255,204,0,.36);

  color: #fff0a6;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  text-align: center;
}

.lifeboat-warning-bar img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* =========================
   FLASH ANIMATION
========================= */

@keyframes flashRed {
  0%,100% {
    box-shadow:
      0 0 0 1px rgba(255,59,48,.25),
      0 0 10px rgba(255,59,48,.35),
      inset 0 0 8px rgba(255,59,48,.12);
  }

  50% {
    box-shadow:
      0 0 0 1.5px rgba(255,59,48,.55),
      0 0 18px rgba(255,59,48,.65),
      0 0 28px rgba(255,59,48,.35),
      inset 0 0 12px rgba(255,59,48,.22);
  }
}

@keyframes lifeboatBoxFlashRed {
  0%,100% {
    border-color: rgba(255,59,48,.75);

    box-shadow:
      0 0 0 1.5px rgba(255,59,48,.30),
      0 0 14px rgba(255,59,48,.35),
      0 0 28px rgba(255,59,48,.18),
      0 10px 24px rgba(0,0,0,.25);
  }

  50% {
    border-color: rgba(255,80,72,.9);

    box-shadow:
      0 0 0 2px rgba(255,59,48,.65),
      0 0 26px rgba(255,59,48,.75),
      0 0 48px rgba(255,59,48,.45),
      0 0 70px rgba(255,59,48,.25),
      0 12px 28px rgba(0,0,0,.30);
  }
}

/* =========================
   LATEST RNLI LAUNCH BOX (SMALLER CONTENT, FULL WIDTH)
========================= */

.rnli-latest-box {
  margin-top: 10px;

  border-radius: 14px;
  overflow: hidden;

  border: 1px solid rgba(47,129,247,.55);

  background: rgba(255,255,255,.02);

  box-shadow:
    0 0 0 1px rgba(47,129,247,.12),
    0 0 10px rgba(47,129,247,.25),
    0 8px 18px rgba(0,0,0,.22);
}

/* HEADER IMAGE */
.rnli-latest-header-img {
  height: 55px;

  margin: -14px -14px 0;

  border-radius: 14px 14px 0 0;

  background-image: url("/images/rnli3.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;

  filter: brightness(1.05) contrast(1.05) saturate(1.05);
}

/* DIVIDER */
.rnli-latest-divider {
  content: "";
  display: block;

  height: 2px;
  margin: 0 -14px 6px;

  background: linear-gradient(
    to right,
    transparent,
    rgba(47,129,247,.95),
    transparent
  );

  box-shadow:
    0 0 6px rgba(47,129,247,.85),
    0 0 10px rgba(47,129,247,.55);
}

/* CONTENT */
.rnli-latest-content {
  padding: 8px 8px 2px;
}

/* STATION */
.rnli-latest-station {
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  padding: 5px;

  border-radius: 8px;
  border: 1px solid rgba(47,129,247,.6);

  background: rgba(47,129,247,.15);
  color: #ffffff;

  margin-bottom: 6px;
}

/* META GRID */
.rnli-latest-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;

  margin-bottom: 6px;
}

.rnli-meta-box {
  padding: 5px 6px;
  border-radius: 6px;

  background: rgba(255,255,255,.04);
  border: 1px solid rgba(47,129,247,.35);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.rnli-meta-box span {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .3px;
}

.rnli-meta-box strong {
  font-size: 11px;
  color: #ffffff;
  margin-top: 1px;
}

/* Lifeboat ID emphasis */
#rnliLatestLifeboatId {
  font-weight: 900;
  letter-spacing: 0.4px;
}

/* LINK BUTTON */
.rnli-latest-link {
  display: block;
  text-align: center;

  padding: 5px;
  border-radius: 6px;

  font-size: 11px;
  font-weight: 800;

  text-decoration: none;
  color: #ffffff;

  background: rgba(47,129,247,.25);
  border: 1px solid rgba(47,129,247,.55);

  transition: all .2s ease;
}

.rnli-latest-link:hover {
  background: rgba(47,129,247,.45);
}

/* FOOTER */
.rnli-latest-footer {
  margin-top: 8px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}