/*
 * 3Echo9 — Custom styles.
 * Tailwind handles utilities; this file adds named component classes and
 * status-colour overrides that would be verbose to repeat as utility strings.
 */

/* ── Form helpers ──────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  transition: box-shadow 0.1s;
}
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #111827;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: #111827;
  color: #fff;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}
.btn-primary:hover { background: #374151; }

.btn-secondary {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #f9fafb; }

.btn-danger {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #b91c1c; }

/* ── Navigation links ──────────────────────────────────────────────────── */
.nav-link {
  color: #d1d5db;
  font-size: 0.875rem;
  transition: color 0.1s;
}
.nav-link:hover { color: #fff; }

/* ── Status badges — facility ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-fmc        { background: #d1fae5; color: #065f46; }
.status-pmc        { background: #fef3c7; color: #92400e; }
.status-nmc        { background: #fee2e2; color: #991b1b; }
.status-contaminated { background: #ede9fe; color: #5b21b6; }
.status-fire       { background: #ffedd5; color: #9a3412; }
.status-damaged    { background: #fecaca; color: #7f1d1d; }
.status-custom     { background: #f3f4f6; color: #374151; }

/* ── Condition badges — FPCON ──────────────────────────────────────────── */
.badge-fpcon {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-fpcon-normal  { background: #dbeafe; color: #1e3a8a; }
.badge-fpcon-alpha   { background: #fef9c3; color: #78350f; }
.badge-fpcon-bravo   { background: #fde68a; color: #78350f; }
.badge-fpcon-charlie { background: #fdba74; color: #7c2d12; }
.badge-fpcon-delta   { background: #fca5a5; color: #7f1d1d; }

/* ── Condition badges — Alarm ──────────────────────────────────────────── */
.badge-alarm {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-alarm-green  { background: #d1fae5; color: #065f46; }
.badge-alarm-yellow { background: #fef9c3; color: #78350f; }
.badge-alarm-red    { background: #fee2e2; color: #991b1b; }
.badge-alarm-black  { background: #111827; color: #f9fafb; }

/* ── Condition badges — Designation ───────────────────────────────────── */
.badge-designation {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-exercise  { background: #dbeafe; color: #1e40af; }
.badge-realworld { background: #fee2e2; color: #991b1b; }

/* ── SVG map overlay ───────────────────────────────────────────────────── */
#map-container {
  user-select: none;
}

/* Highlight the rectangle under the cursor on the dashboard */
.facility-rect-group:hover .facility-rect {
  stroke-width: 0.8;
  filter: brightness(1.1);
}

/* ── HTMX loading indicator ────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator  { display: block; }

/* ── Utility: hide until Alpine initialises ────────────────────────────── */
[x-cloak] { display: none !important; }
