/* Basic theme tokens - default (dark) will be used unless data-theme present */
:root {
  --bg: #0f1724;
  --card: #0b1220;
  --accent: #1ea7ff;
  --accent-2: #5cc8ff;
  --muted: #9aa4b2;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.02);
  --danger: #ff6b6b;
  --success: #2ecc71;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  --radius: 12px;
  --text: #ffffff;
  --bg-input: rgba(255, 255, 255, 0.03);
  --border-input: rgba(255, 255, 255, 0.06);
  --scroll-thumb: var(--accent);
  --scroll-track: rgba(0, 0, 0, 0.04);
  --gradient-1: #020024;
  --gradient-2: #090979;
  --gradient-3: #000000;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f5f7fb;
  --card: #ffffff;
  --accent: #0077ff;
  --accent-2: #33aaff;
  --muted: #666;
  --glass: rgba(0, 0, 0, 0.04);
  --glass-2: rgba(0, 0, 0, 0.02);
  --danger: #ff4c4c;
  --success: #28a745;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  --text: #111;
  --bg-input: rgba(0, 0, 0, 0.03);
  --border-input: rgba(0, 0, 0, 0.06);
  --scroll-thumb: var(--accent);
  --scroll-track: rgba(0, 0, 0, 0.02);
  --gradient-1: #ffffff;
  --gradient-2: #f4f6fb;
  --gradient-3: #eef3ff;
}

/* Pink */
[data-theme="pink"] {
  --bg: #1b001b;
  --card: #2d001d;
  --accent: #ff1ea7;
  --accent-2: #ff5cc8;
  --muted: #d0a8c9;
  --glass: rgba(255, 30, 167, 0.04);
  --glass-2: rgba(255, 30, 167, 0.02);
  --danger: #ff6b6b;
  --success: #ff2ecc;
  --text: #fff;
  --bg-input: rgba(0, 0, 0, 0.04);
  --border-input: rgba(255, 255, 255, 0.04);
  --scroll-thumb: var(--accent);
}

/* Green */
[data-theme="green"] {
  --bg: #001b00;
  --card: #002200;
  --accent: #2eff1e;
  --accent-2: #5cff5c;
  --muted: #99bb99;
  --glass: rgba(46, 255, 30, 0.04);
  --glass-2: rgba(46, 255, 30, 0.02);
  --danger: #ff6b6b;
  --success: #2ecc71;
  --text: #fff;
  --bg-input: rgba(0, 0, 0, 0.04);
  --border-input: rgba(255, 255, 255, 0.04);
  --scroll-thumb: var(--accent);
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
  }

  /* mobile navbar overlay (hidden by default) */

  /* Sidebar Overlay */
  #sidebarOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.829);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 998;
    filter: blur(100);
  }

  /* Sidebar */
  #sidebar {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card);
    transition: top 0.4s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 1rem 2rem;
    overflow-y: auto;
  }

  #sidebar.active {
    top: 0;
  }

  #sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
  }

  #sidebar .logo-icon {
    font-size: 2rem;
  }

  #sidebar .close-btn {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
  }

  /* Sidebar Navigation */
  #sidebar nav.nav-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  #sidebar nav .nav-btn {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
  }

  #sidebar nav .nav-btn:hover,
  #sidebar nav .nav-btn.active {
    background: rgba(0, 0, 0, 0.1);
  }

  /* Sidebar Bottom */
  #sidebar .sidebar-bottom {
    margin-top: auto;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Ensure main content is visible */
  #mainContent {
    padding: 1rem 2rem;
  }

  /* Nav buttons */
  #mainNav {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  #mainNav .nav-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }

  /* optional menu toggle style */
  .menu-toggle {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 10000;
    font-size: 24px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
  }

  .menu-toggle {
    display: block;
  }

  .top-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  #incidentForm,
  .card-raise {
    margin: 10px;
    padding: 12px;
  }

  .grid-list {
    grid-template-columns: 1fr !important;
  }

  .incident-card {
    width: 100%;
  }
}

/* reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.centered-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
}
.card-raise {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.padded {
  padding: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--text);
  font-weight: 700;
}
.btn.small {
  padding: 6px 8px;
  font-size: 0.9rem;
}
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-input);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* layout */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  gap: 18px;
  padding: 18px;
}
#sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.03));
  border-radius: var(--radius);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  font-weight: 700;
}
.nav-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
}
.nav-btn.active {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  background: var(--glass);
  color: var(--accent-2);
}
.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* main area */
#mainContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.searchbar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
}
.select,
input,
textarea,
select {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text);
  margin: 6px;
}
.incident-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  padding: 12px;
  background: var(--card);
}
.form-row {
  display: flex;
  gap: 10px;
  background-color: var(--bg);
  border-radius: 20px;
}
.form-row > * {
  flex: 1;
  background-color: var(--bg);
  border-radius: 20px;
}
#location {
  background-color: var(--bg);
}
.optional-panel summary {
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  background: var(--glass);
  margin: 7px;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  padding: 8px;
}

/* lists */
.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.incident-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--border-input);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.incident-card h3 {
  color: var(--accent);
  margin-bottom: 6px;
}
.incident-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
}
.pill {
  background: var(--glass);
  padding: 6px 8px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.thumbnail-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.thumbnail-row img {
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-input);
}

/* action buttons under incidents */
.incident-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-start;
}
.incident-actions .btn {
  flex: 1 1 110px;
  min-width: 110px;
}

/* suspect/vehicle small cards */
.small-card {
  background: var(--card);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-input);
}
.suspect-summary,
.vehicle-summary {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.suspect-summary img,
.vehicle-summary img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-input);
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-card {
  max-width: 960px;
  width: 100%;
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  overflow: auto;
  max-height: 90vh;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--muted);
}

/* fullscreen photo overlay */
.fullscreen-photo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}
.fullscreen-photo img {
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
}

/* utilities */
.centered {
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000;
}
.loader.hidden {
  display: none;
}
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* inputs focus + hover */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  background: var(--glass);
}

/* scrollbars */
#mainContent::-webkit-scrollbar {
  width: 8px;
}
#mainContent::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 8px;
}
#mainContent::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

/* responsive */
@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 13000;
  }
  #sidebar.active {
    transform: translateX(0);
  }
  .dashboard-container {
    padding: 12px;
  }
  .form-row {
    flex-direction: column;
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .incident-actions .btn {
    min-width: unset;
  }
}
@media (max-width: 600px) {
  .grid-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .login-container {
    width: 92%;
    padding: 16px;
  }
}

/* ensure theme switch buttons area */
.style_btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 40px;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.96);
}

.modal-card {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.incident-form {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Suspect info chips */
/* === Info Chips === */
.info-chip {
  display: inline-flex;
  align-items: center;
  background: var(--accent, #007bff);
  color: var(--text-on-accent, #fff);
  font-weight: 600;
  border-radius: 14px;
  padding: 4px 10px;
  margin: 3px 6px 0 0;
  font-size: 0.85rem;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, background 0.2s ease;
}

.info-chip:hover {
  transform: scale(1.05);
}

.info-chip .label {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-right: 6px;
  text-transform: uppercase;
}

.info-chip.info-id {
  background: #0078ff;
}

.info-chip.info-dob {
  background: #00b894;
}

.info-chip.info-address {
  background: #e17055;
}

.info-chip .value {
  font-weight: 700;
  color: #fff;
}
.info-chip.info-address {
  background: #e17055; /* nice orange-red color */
}

/* Fullscreen image viewer */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.image-viewer.hidden {
  display: none;
}

.image-viewer-overlay {
  position: absolute;
  inset: 0;
}

.image-viewer-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-x: scroll;
  white-space: nowrap;
  scroll-snap-type: x mandatory;
}

.image-viewer-content img {
  height: 80vh;
  object-fit: contain;
  margin: 0 8px;
  border-radius: 8px;
  scroll-snap-align: center;
}

.image-viewer::-webkit-scrollbar {
  display: none;
}

.close-viewer {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: transform 0.2s ease;
}

.close-viewer:hover {
  transform: scale(1.1);
}

select {
  background-color: #222; /* background of the dropdown itself */
  color: var(--text); /* text color */
  border-radius: 6px; /* may not affect options in all browsers */
  padding: 4px 8px;
  border: 1px solid #555;
}

select option {
  background-color: var(--bg);
  color: #fff;
}

/*GLOBAL ANNOUNCEMENT*/

/* ---------- Notification Container ---------- */
.notification-block {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

/* ---------- Notification Base ---------- */
.notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.4s forwards;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hover effect */
.notification:hover {
  transform: translateX(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* ---------- Notification Types ---------- */
.notification.success {
  background: linear-gradient(90deg, #00d084, #00a676);
}

.notification.error {
  background: linear-gradient(90deg, #ff5f6d, #ffc371);
}

.notification.info {
  background: linear-gradient(90deg, #3a86ff, #8338ec);
}

.notification.warning {
  background: linear-gradient(90deg, #ffb347, #ffcc33);
}

/* Close icon */
.notification::after {
  content: "×";
  margin-left: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* Slide-in animation */
@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Fade-out animation */
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.tab-title {
  text-align: center;
  color: #00eaff;
  margin-bottom: 1rem;
}

.stats-summary {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(25, 25, 35, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 2rem;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
  transition: 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.35);
}

.stat-card h3 {
  color: #00bcd4;
  margin-bottom: 0.5rem;
}

.stat-card p {
  font-size: 1.4rem;
  color: #fff;
  font-weight: bold;
}

.chart-container {
  background: rgba(25, 25, 35, 0.6);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  margin-bottom: 2rem;
}

.heatmap-container {
  width: 100%;
  height: 400px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.2);
}

#logsContainer {
  padding: 20px;
  color: #c8ffff;
  font-family: "Courier New", monospace;
}

.log-entry {
  background: rgba(0, 30, 40, 0.5);
  border-left: 4px solid #00ffff;
  border-radius: 8px;
  margin: 8px 0;
  padding: 10px 14px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
  transition: transform 0.2s ease;
}
.log-entry:hover {
  transform: scale(1.01);
  background: rgba(0, 50, 60, 0.6);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-user {
  font-weight: bold;
  color: #00ffff;
}

.log-role {
  color: #ff00ff;
  margin-left: 8px;
  font-size: 0.9em;
}

.log-body {
  margin-top: 5px;
}

.log-action {
  color: #00ffcc;
  font-weight: bold;
}

.log-details {
  margin: 4px 0 0;
  font-size: 0.9em;
  color: #a0ffff;
  opacity: 0.8;
}

.empty,
.error {
  color: #aaa;
  font-style: italic;
  text-align: center;
  margin-top: 20px;
}
#map {
  width: 100%;
  height: 100%;
}

.heatmap-container {
  width: 100%;
  height: 500px; /* the height you want */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 238, 255, 0.4);
  border: 2px solid #00eaff;
}
.heatmap-container {
  box-shadow: 0 0 20px rgba(0, 238, 255, 0.4);
  border: 2px solid #00eaff;
}

/* Add to your style.css */
.new-log-highlight {
  background-color: #fff3b0; /* soft yellow */
  transition: background-color 2s ease;
}

.log-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}
#imageViewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

#imageViewer.hidden {
  display: none !important;
}

.image-viewer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

.close-viewer {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-size: 2rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  font-size: 3rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 0 12px;
  cursor: pointer;
  border-radius: 6px;
}

.arrow.left {
  left: 12px;
}
.arrow.right {
  right: 12px;
}

.image-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow-x: hidden;
  touch-action: none;
}

.image-scroll img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  margin: 0 8px;
  flex-shrink: 0;
  cursor: grab;
  transition: transform 0.3s;
}

.image-scroll img:active {
  cursor: grabbing;
}

.hidden {
  display: none !important;
}

#terminalOutput::-webkit-scrollbar {
  width: 8px;
}
#terminalOutput::-webkit-scrollbar-thumb {
  background: #00ffcc55;
  border-radius: 4px;
}
