/* ---------------------------------------------------------
   VaLog Global Styling (Dark + Light Theme Support)
   --------------------------------------------------------- */

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------
   Color Variables
   --------------------------------------------------------- */
:root {
    --bg-body-dark: #020617;       /* deep navy */
    --bg-nav-dark: #020617;
    --bg-card-dark: #0b1120;
    --text-main-dark: #e5e7eb;

    --bg-body-light: #f5f7fb;
    --bg-nav-light: #ffffff;
    --bg-card-light: #ffffff;
    --text-main-light: #111827;
}

/* ---------------------------------------------------------
   DARK MODE
   --------------------------------------------------------- */
html[data-theme="dark"] body,
html[data-theme="dark"] .bg-body {
    background-color: var(--bg-body-dark) !important;
    color: var(--text-main-dark) !important;
}

html[data-theme="dark"] .bg-nav,
html[data-theme="dark"] .navbar {
    background-color: var(--bg-nav-dark) !important;
}

html[data-theme="dark"] .navbar-brand,
html[data-theme="dark"] .navbar-nav .nav-link,
html[data-theme="dark"] .navbar-text {
    color: var(--text-main-dark) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-contrast {
    background-color: var(--bg-card-dark) !important;
    border-color: #1f2937 !important;
    color: var(--text-main-dark) !important;
}

html[data-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

/* ---------------------------------------------------------
   LIGHT MODE
   --------------------------------------------------------- */
html[data-theme="light"] body,
html[data-theme="light"] .bg-body {
    background-color: var(--bg-body-light) !important;
    color: var(--text-main-light) !important;
}

html[data-theme="light"] .bg-nav,
html[data-theme="light"] .navbar {
    background-color: var(--bg-nav-light) !important;
}

/* Light mode navbar text override for .navbar-dark */
html[data-theme="light"] .navbar-dark .navbar-brand,
html[data-theme="light"] .navbar-dark .navbar-nav .nav-link,
html[data-theme="light"] .navbar-dark .navbar-text {
    color: var(--text-main-light) !important;
}

html[data-theme="light"] .navbar-dark .navbar-nav .nav-link:hover,
html[data-theme="light"] .navbar-dark .navbar-nav .nav-link:focus {
    color: #1d4ed8 !important;
}

html[data-theme="light"] .card,
html[data-theme="light"] .card-contrast {
    background-color: var(--bg-card-light) !important;
    color: var(--text-main-light) !important;
}

/* Fix Toggle Button in Light Mode */
html[data-theme="light"] .btn-outline-light {
    color: #111827 !important;
    border-color: #111827 !important;
}
html[data-theme="light"] .btn-outline-light:hover {
    background-color: #111827 !important;
    color: white !important;
}

/* ---------------------------------------------------------
   TABLE OVERRIDES (Fix for Dark Mode)
   --------------------------------------------------------- */
html[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: #020617 !important;
    color: var(--text-main-dark) !important;
    border-color: #111827 !important;
}

html[data-theme="dark"] .table thead th {
    background-color: #0b1120 !important;
    color: var(--text-main-dark) !important;
    border-bottom-color: #1f2937 !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #030712 !important;
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: #111827 !important;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
    border-color: #111827 !important;
}

/* ---------------------------------------------------------
   LIST GROUPS
   --------------------------------------------------------- */
html[data-theme="dark"] .list-group-item {
    background-color: #020617 !important;
    border-color: #111827 !important;
    color: var(--text-main-dark) !important;
}

html[data-theme="dark"] .list-group-item:hover {
    background-color: #111827 !important;
}

/* ---------------------------------------------------------
   FORMS
   --------------------------------------------------------- */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background-color: #111827 !important;
    color: var(--text-main-dark) !important;
    border-color: #1f2937 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #6b7280 !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .3) !important;
}

/* ---------------------------------------------------------
   NAVBAR TOGGLER
   --------------------------------------------------------- */
html[data-theme="light"] .navbar-dark .navbar-toggler-icon {
    background-image: none !important;
    border: 1px solid #111827;
}
html[data-theme="light"] .navbar-dark .navbar-toggler-icon::before,
html[data-theme="light"] .navbar-dark .navbar-toggler-icon::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    height: 2px;
    background-color: #111827;
}
html[data-theme="light"] .navbar-dark .navbar-toggler-icon::before {
    top: 6px;
}
html[data-theme="light"] .navbar-dark .navbar-toggler-icon::after {
    bottom: 6px;
}

/* ---------------------------------------------------------
   MISC UI
   --------------------------------------------------------- */
.card-contrast {
    border-radius: 1rem;
    overflow: hidden;
}

table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.navbar-brand {
    letter-spacing: .1em;
}

.small {
    font-size: .85rem;
}

.badge.bg-info {
    background-color: #38bdf8 !important;
    color: #0c0c0c !important;
}

.badge.bg-purple {
  background-color: #6f42c1;
  color: #fff;
}

/* ---------------------------------------------------------
   PRIORITY NOTAM MOTORWAY MATRIX SIGN (v2)
   --------------------------------------------------------- */
.priority-notam-sign {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.priority-notam-inner {
    position: relative;
    background-color: #000000;
    border-radius: 0.5rem;
    border: 2px solid #1a1a1a;
    padding: 2rem 1.8rem;
    text-align: center;
    color: #facc15;
    font-family: "Courier New", monospace;
    text-transform: uppercase;
    overflow: hidden;
}

.priority-notam-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(#0a0a0a 1px, transparent 1px),
        linear-gradient(90deg, #0a0a0a 1px, transparent 1px);
    background-size: 6px 10px;
    opacity: 0.15;
    pointer-events: none;
}

.priority-notam-title,
.priority-notam-body,
.priority-notam-meta {
    position: relative;
    z-index: 1;
}

.priority-notam-dottext {
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #facc15;
    text-shadow:
        0 0 2px rgba(250, 204, 21, 0.7),
        0 0 4px rgba(250, 204, 21, 0.4);
    display: inline-block;
}

.priority-notam-dottext span {
    display: inline;
    animation: ledWave 4s infinite ease-in-out;
}

.priority-notam-dottext span:nth-child(odd)  { animation-delay: 0.2s; }
.priority-notam-dottext span:nth-child(3n)   { animation-delay: 0.5s; }
.priority-notam-dottext span:nth-child(4n)   { animation-delay: 1.1s; }
.priority-notam-dottext span:nth-child(5n)   { animation-delay: 0.7s; }
.priority-notam-dottext span:nth-child(7n)   { animation-delay: 1.6s; }

@keyframes ledWave {
    0%   { opacity: 1; }
    40%  { opacity: 0.97; }
    50%  { opacity: 1; }
    60%  { opacity: 0.98; }
    100% { opacity: 1; }
}

.priority-notam-title {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.priority-notam-body {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.priority-notam-meta {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: none;
    margin-top: 0.45rem;
    color: #facc15;
}

.priority-notam-lights {
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 2;
}

.priority-notam-lights-top {
    top: 0.55rem;
}

.priority-notam-lights-bottom {
    bottom: 0.55rem;
}

.priority-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #3f3f46;
    box-shadow: none;
    animation: motorwayFlash 0.65s infinite steps(1, end);
}

.priority-notam-lights-bottom .priority-light {
    animation-delay: 0.325s;
}

@keyframes motorwayFlash {
    0%, 49% {
        background-color: #3f3f46;
        box-shadow: none;
    }
    50%, 100% {
        background-color: #facc15;
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.9);
    }
}

/* ---------------------------------------------------------
   MODAL DARK MODE
   --------------------------------------------------------- */
html[data-theme="dark"] .modal-content {
  background: #0b1220;
  color: #e8eefc;
  border: 1px solid rgba(255,255,255,.08);
}

html[data-theme="dark"] .modal-header {
  border-bottom-color: rgba(255,255,255,.08);
}

html[data-theme="dark"] .modal-footer {
  border-top-color: rgba(255,255,255,.08);
}

/* =========================================================
   STAFF BOARD (CLEAN + FIXED)
   ========================================================= */

.staff-board {
  min-height: 100vh;
}

/* Fill most of the viewport */
.staff-board-top {
  min-height: calc(100vh - 260px);
}

/* Make each top column stretch properly */
.staff-board-top > .col-12 {
  display: flex;
}

/* Column card */
.staff-column {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Tighten padding */
.staff-column .card-body {
  padding: 0.75rem;
}

/* Ticket list box */
.staff-column .ticket-list {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: transparent;
  overflow-y: auto;
}

/* Ticket spacing */
.staff-column .ticket {
  margin-bottom: 8px;
}

/* Archived full-width */
.staff-archived {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
}

/* Archived wrap layout */
.ticket-list-archived {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  min-height: 160px;
}

/* Archived tiles */
.ticket-list-archived .ticket {
  width: 260px;
  margin: 0 !important;
}

/* =========================================================
   PRIORITY NOTAM – BROADCAST STRIP
   ========================================================= */

.broadcast-strip {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}

html[data-theme="light"] .broadcast-strip {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
}

/* Left “priority square” */
.broadcast-strip .broadcast-pill {
  width: 52px;
  min-width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.12);
  background: rgba(239, 68, 68, 0.25); /* red */
}

/* Gentle flash */
.broadcast-strip.is-priority .broadcast-pill {
  animation: broadcastPulse 1.35s ease-in-out infinite;
}

@keyframes broadcastPulse {
  0%, 100% { background: rgba(239, 68, 68, 0.22); }
  50%      { background: rgba(239, 68, 68, 0.48); }
}

/* Text area */
.broadcast-strip .broadcast-body {
  flex: 1;
  padding: 12px 14px;
}

.broadcast-strip .broadcast-title {
  font-weight: 800;
  margin-bottom: 4px;
}

.broadcast-strip .broadcast-text {
  opacity: 0.9;
  line-height: 1.25;
}

/* Optional: smaller meta line (issuer/time) */
.broadcast-strip .broadcast-meta {
  margin-top: 6px;
  font-size: .8rem;
  opacity: .7;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .broadcast-strip.is-priority .broadcast-pill {
    animation: none;
  }
}
/* Label colours */
.broadcast-pill.label-OPS   { background: rgba(59,130,246,0.25); }   /* blue */
.broadcast-pill.label-WX    { background: rgba(234,179,8,0.28); }    /* yellow */
.broadcast-pill.label-MAINT { background: rgba(249,115,22,0.28); }   /* orange */
.broadcast-pill.label-INFO  { background: rgba(148,163,184,0.22); }  /* grey */

/* Priority still flashes (overrides the base colour) */
.broadcast-strip.is-priority .broadcast-pill {
  animation: broadcastPulse 1.35s ease-in-out infinite;
}
