/* =========================================================
   Netmon - Global Styles
   Login, Navbar, Dashboard, Alerts and Message Bubbles
   ========================================================= */


/* ---------------------------------------------------------
   Base / common
   --------------------------------------------------------- */

:root {
  --nm-blue-dark: #0b2a5b;
  --nm-blue: #1252a3;
  --nm-blue-light: #e8f0fc;

  --nm-text: #14233c;
  --nm-muted: #6b7a90;
  --nm-border: #e3e9f2;
  --nm-bg: #f5f7fb;

  --nm-success: #198754;
  --nm-warning: #f2a007;
  --nm-danger: #dc3545;
  --nm-info: #0aa2c0;
}

body {
  color: var(--nm-text);
  background: var(--nm-bg);
}


/* ---------------------------------------------------------
   Login page
   --------------------------------------------------------- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 12px;

  /*
    Optional custom login image:
    static/img/login-bg.jpg

    If login-bg.jpg is unavailable, login-bg.svg will appear.
  */
  background:
    linear-gradient(rgba(6, 20, 50, 0.55), rgba(6, 20, 50, 0.65)),
    url("../img/login-bg.jpg"),
    url("../img/login-bg.svg");

  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  padding: 26px 20px 20px;
  color: #ffffff;
  text-align: center;
  background: linear-gradient(135deg, #0b3d91, #1a73e8);
}

.auth-brand .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 30px;
}

.auth-brand h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auth-brand p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.auth-body {
  padding: 22px 24px 8px;
}

.auth-foot {
  padding: 8px 0 16px;
  color: #6b7280;
  text-align: center;
  font-size: 12px;
}

.auth-body .nav-pills .nav-link {
  font-size: 14px;
}


/* ---------------------------------------------------------
   Application navbar
   --------------------------------------------------------- */

.app-navbar {
  background: linear-gradient(90deg, var(--nm-blue-dark), var(--nm-blue));
  box-shadow: 0 2px 9px rgba(8, 37, 82, 0.16);
}

.app-navbar .navbar-brand {
  color: #ffffff;
  font-weight: 700;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.15s ease, background 0.15s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  color: #ffffff;
}

.app-navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
}


/* ---------------------------------------------------------
   Dashboard cards
   --------------------------------------------------------- */

.stat-card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.stat-card .num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 22px;
}

.tile {
  display: block;
  padding: 22px 12px;
  color: inherit;
  text-align: center;
  text-decoration: none;
  background: #ffffff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  color: inherit;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.tile i {
  color: var(--nm-blue);
  font-size: 34px;
}

.tile div {
  margin-top: 8px;
  font-weight: 600;
}

.page-title {
  color: var(--nm-text);
  font-weight: 700;
}


/* =========================================================
   Alerts and Messages
   Telegram-style cards and full visible message bubbles
   ========================================================= */


/* Alert list container */

.al-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}


/* Each alert row */

.alert-row {
  width: 100%;
}


/* Main alert card */

.al {
  --c: var(--nm-warning);

  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;

  background: #ffffff;
  border: 1px solid var(--nm-border);
  border-left: 5px solid var(--c);
  border-radius: 16px;

  box-shadow: 0 3px 12px rgba(16, 42, 84, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.al:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 42, 84, 0.12);
}


/* Alert severity */

.al.sev-warning {
  --c: var(--nm-warning);
}

.al.sev-critical {
  --c: var(--nm-danger);
}

.al.sev-critical.is-new {
  background: linear-gradient(90deg, #fff6f6 0%, #ffffff 65%);
}


/* Acknowledged state */

.al.is-ack {
  opacity: 0.72;
}


/* Severity icon left side */

.al-ic {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  min-width: 42px;

  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, white);
  border-radius: 12px;

  font-size: 20px;
}


/* Main alert content */

.al-main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}


/* Alert top line: severity, plaza, source, timestamp */

.al-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.chip-sev {
  color: #ffffff;
  background: var(--c);
}

.sev-warning .chip-sev {
  color: #5c3900;
  background: #ffd978;
}

.chip-plaza {
  color: var(--nm-blue);
  background: var(--nm-blue-light);
}

.chip-src {
  color: #4b5d73;
  background: #eef2f6;
}

.al-time {
  margin-left: auto;
  color: #8492a6;
  font-size: 12px;
  white-space: nowrap;
}


/* ---------------------------------------------------------
   Telegram-style message bubble
   Full message always wraps and remains visible
   --------------------------------------------------------- */

.al-message-bubble {
  position: relative;

  display: block;
  width: 100%;
  max-width: 100%;

  padding: 12px 15px;

  color: #1f2d44;
  background: #f1f6ff;
  border: 1px solid #d9e7fa;
  border-radius: 15px 15px 15px 5px;

  font-size: 15px;
  line-height: 1.65;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sev-warning .al-message-bubble {
  background: #fffaf0;
  border-color: #f7e5b8;
}

.sev-critical .al-message-bubble {
  background: #fff3f4;
  border-color: #ffd4d8;
}

.is-ack .al-message-bubble {
  background: #f7f9fc;
  border-color: #e7edf4;
}


/* Text inside bubble */

.al-message-bubble .message-text,
.al-message-bubble .al-msg {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;

  color: inherit;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* Optional expand/collapse "poora dekho" */

.al-message-bubble details {
  width: 100%;
}

.al-message-bubble summary {
  width: 100%;
  cursor: pointer;
  list-style: none;
}

.al-message-bubble summary::-webkit-details-marker {
  display: none;
}

.more {
  display: inline-block;
  margin-left: 6px;
  color: var(--nm-blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

details[open] .more {
  display: none;
}


/* Full expanded message */

.full {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: none;

  margin-top: 10px;
  padding: 11px 12px;

  overflow: visible;

  color: #24344d;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(18, 82, 163, 0.12);
  border-radius: 10px;

  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* ---------------------------------------------------------
   Alert footer, status, actions
   --------------------------------------------------------- */

.al-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;

  margin-top: 11px;
  padding: 0 2px;

  color: var(--nm-muted);
  font-size: 13px;
}

.st-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  color: var(--c);
  font-weight: 700;
}

.st-ack {
  display: none;
  align-items: center;
  gap: 6px;

  color: var(--nm-success);
  font-weight: 700;
}

.is-ack .st-new,
.is-ack .ackform,
.is-ack .btn-ack {
  display: none;
}

.is-ack .st-ack {
  display: inline-flex;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--c);
  border-radius: 50%;
  animation: alert-pulse 1.6s infinite;
}

@keyframes alert-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 48%, transparent);
  }

  70% {
    box-shadow: 0 0 0 7px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.via {
  color: #8492a6;
  font-size: 12.5px;
}


/* ---------------------------------------------------------
   Script-result message cards
   --------------------------------------------------------- */

.mc {
  position: relative;
  height: 100%;
  padding: 15px 16px;

  background: #ffffff;
  border: 1px solid var(--nm-border);
  border-left: 5px solid var(--nm-info);
  border-radius: 16px;

  box-shadow: 0 3px 12px rgba(16, 42, 84, 0.06);
}

.mc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.mc-msg {
  display: block;
  width: 100%;
  max-width: 100%;

  padding: 12px 14px;

  color: #1f2d44;
  background: #eefaff;
  border: 1px solid #d3f0f7;
  border-radius: 14px 14px 14px 5px;

  font-size: 14px;
  line-height: 1.62;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mc-del {
  position: absolute;
  right: 15px;
  bottom: 12px;
}


/* ---------------------------------------------------------
   New alert animation
   --------------------------------------------------------- */

@keyframes alert-slide-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.al.flash,
.msg-card.flash .mc {
  animation: alert-slide-in 0.65s ease-out;
}


/* ---------------------------------------------------------
   Alerts page support components
   --------------------------------------------------------- */

.empty {
  padding: 58px 10px;
  color: #8492a6;
  text-align: center;
  background: #f8fafc;
  border: 2px dashed var(--nm-border);
  border-radius: 16px;
}

.empty i {
  display: block;
  margin-bottom: 10px;
  color: var(--nm-success);
  font-size: 48px;
}

.foot-note {
  margin-top: 16px;
  padding: 12px 14px;
  color: #8492a6;
  background: #f6f8fb;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}


/* ---------------------------------------------------------
   Mobile responsive
   --------------------------------------------------------- */

@media (max-width: 575.98px) {
  .auth-page {
    padding: 16px 12px;
  }

  .auth-card {
    border-radius: 15px;
  }

  .auth-brand {
    padding: 22px 16px 17px;
  }

  .auth-body {
    padding: 20px 18px 8px;
  }

  .stat-card .num {
    font-size: 26px;
  }

  .tile {
    padding: 18px 10px;
  }

  .al {
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  .al-ic {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    font-size: 18px;
  }

  .al-time {
    width: 100%;
    margin-left: 0;
  }

  .al-message-bubble {
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.58;
  }

  .al-foot {
    gap: 8px;
  }
}