body {
  margin: 0;
  font-family: "Share Tech Mono", monospace;
  background: #010114;
  color: #0ff;
  overflow-x: hidden;
}
body.dark {
  background: #111;
  color: #0aa;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 14px 0;
  text-align: center;
  z-index: 1000;
}
header h1 {
  margin: 0;
  font-size: 2rem;
  text-shadow: 0 0 10px #0ff;
}
.indicator {
  margin-top: 6px;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 4px;
  text-shadow: 0 0 5px #0ff;
}
.theme-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #0ff;
  cursor: pointer;
  text-shadow: 0 0 5px #0ff;
}

.sidebar {
  position: fixed;
  top: 72px;
  left: 0;
  width: 180px;
  bottom: 44px;
  background: rgba(0, 0, 30, 0.8);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar a {
  color: #0ff;
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.3s;
}
.sidebar a:hover {
  background: #0f0;
  color: #011;
}

main {
  margin-top: 90px;
  margin-left: 160px;
  margin-right: 20px;
  margin-bottom: 60px;
  padding-left: 10px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-bottom: 20px;
}

.tool-grid .card {
  min-width: 0;
  padding: 12px;
}

@media (max-width: 1024px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: rgba(0, 0, 30, 0.7);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 0 12px #0ff;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 22px #0f0;
}
.card h2 {
  margin-top: 0;
  text-shadow: 0 0 8px #0ff;
}

.controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}
input {
  width: 100%;
  padding: 10px;
  background: #021;
  color: #0ff;
  border: 1px solid #0ff;
  margin-bottom: 10px;
}
.btn {
  background: #0ff;
  color: #011;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
.btn:hover {
  background: #0f0;
  color: #011;
  transform: scale(1.05);
}

.qr-display,
.result-box,
.history-wrapper {
  margin: 12px 0;
  padding: 12px;
  background: rgba(0, 0, 30, 0.4);
  border: 1px solid #0ff;
  border-radius: 4px;
}

.history-card {
  box-shadow: 0 0 20px #0f0;
  margin-top: 30px;
}

.history-card {
  grid-column: 1 / -1;
  margin-top: 20px;
  box-shadow: 0 0 20px #0f0;
  padding: 16px;
}

.history-wrapper {
  max-height: 260px;
  overflow-y: auto;
}
#historyTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
#historyTable th,
#historyTable td {
  padding: 8px;
  border: 1px solid #0ff;
  text-align: left;
  vertical-align: middle;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 0;
  text-align: center;
  color: #0ff;
  font-size: 0.85rem;
  text-shadow: 0 0 5px #0ff;
}

.chat-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 400px;
  background: rgba(0, 0, 30, 0.9);
  border: 1px solid #0ff;
  border-radius: 6px;
  display: none;
  flex-direction: column;
  z-index: 2000;
}
.chat-header {
  padding: 10px;
  background: rgba(0, 0, 30, 1);
  border-bottom: 1px solid #0ff;
  display: flex;
  justify-content: space-between;
  color: #0ff;
}
.chat-content {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  color: #ccc;
}
.chat-input {
  display: flex;
  border-top: 1px solid #0ff;
}
.chat-input input {
  flex: 1;
  padding: 6px;
  background: #011;
  color: #0ff;
  border: none;
}
.chat-input button {
  padding: 6px;
  background: #0ff;
  color: #011;
  border: none;
}
.chat-input button:hover {
  background: #0f0;
  color: #011;
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  main {
    margin-left: 0;
    margin-top: 120px;
  }
  .tool-row .card {
    flex: 0 0 90%;
  }
}

.sidebar {
  z-index: 900;
  box-shadow: none;
  background: rgba(0, 0, 30, 0.85); /* subtle but clear */
}

.card {
  background: rgba(0, 0, 30, 0.6);
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 0 8px #0ff; /* reduced glow */
  backdrop-filter: blur(3px);
}

main {
  margin-left: 200px; /* already clears sidebar */
  z-index: 1;
}
.sidebar {
  position: fixed;
  z-index: 2;
}

.title-animate {
  font-size: 2rem;
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
  letter-spacing: 1px;
  font-family: "Share Tech Mono", monospace;
  animation: flicker 2s infinite alternate;
}
@keyframes flicker {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
    text-shadow: 0 0 20px #0f0;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 10px #0ff;
  }
}

* {
  box-sizing: border-box;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  background: #021;
  color: #0ff;
  border: 1px solid #0ff;
  margin-bottom: 10px;
  border-radius: 4px;
}

.card {
  padding: 12px;
  overflow: hidden; /* Ensures nothing leaks out visually */
}

@media (max-width: 600px) {
  input[type="text"],
  input[type="file"] {
    font-size: 0.9rem;
  }
}

.result-box {
  /* base styling */
}
.result-box.safe {
  /* green neon border & background*/
}
.result-box.warn {
  /* yellow warning theme */
}
.result-box.danger {
  /* red danger theme, pulsating shadow */
}
.indicator.safe/warn/danger {
  /* header indicator styles */
}
.user-msg,
.bot-msg {
  /* chat message styling */
}

.sidebar a.active-tab {
  background: #0f0;
  color: #000;
  font-weight: bold;
}

.assistant-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: #101820;
  border: 1px solid #00bfff;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.5);
  flex-direction: column;
  z-index: 9999;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0a0a;
  color: #00bfff;
  padding: 10px 14px;
  font-weight: bold;
  border-bottom: 1px solid #00bfff;
}

.assistant-header button {
  background: none;
  border: none;
  color: #00bfff;
  font-size: 1.2rem;
  cursor: pointer;
}

.assistant-body {
  padding: 15px;
}

.assistant-body input {
  width: 100%;
  padding: 8px;
  background: #000;
  color: #0f0;
  border: 1px solid #00bfff;
  margin-bottom: 10px;
}

.assistant-body .btn {
  background: #00bfff;
  color: #000;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  font-family: "Share Tech Mono", monospace;
}

.assistant-body button {
  margin-bottom: 8px;
}

.assistant-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #00bfff;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
  padding: 20px;
  width: 320px;
  z-index: 9999;
  flex-direction: column;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  color: #00bfff;
  font-weight: bold;
  margin-bottom: 10px;
}

.assistant-body input {
  width: 100%;
  padding: 8px;
  background: #000;
  color: #0f0;
  border: 1px solid #00bfff;
  margin-bottom: 10px;
}

.assistant-body .btn {
  background: #00bfff;
  color: #000;
  padding: 6px 10px;
  border: none;
  cursor: pointer;
  font-family: "Share Tech Mono", monospace;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ================= Base & Body ================= */
/* 🌐 Ultra Mobile Responsiveness */

@media (max-width: 768px) {
  /* Shrink sidebar and make icon-only */
  .sidebar {
    width: 60px;
    padding: 8px 0;
    background: rgba(0, 0, 30, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
  }

  .sidebar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    color: #0ff;
    font-size: 1.4rem;
    text-decoration: none;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s;
  }

  .sidebar a .nav-label {
    display: none; /* Hide label */
  }

  .sidebar a i {
    font-size: 1.6rem;
    color: #0ff;
    text-shadow: 0 0 6px #0ff;
    transition:
      color 0.3s,
      transform 0.3s;
  }

  .sidebar a:hover i {
    color: #0f0;
    transform: scale(1.15);
  }

  /* Adjust main content padding */
  main {
    margin-left: 60px;
    padding: 10px;
  }

  /* Header size */
  header h1 {
    font-size: 1.2rem;
  }

  .theme-btn {
    top: 14px;
    right: 12px;
    font-size: 1rem;
  }

  /* Tool grid stacks vertically */
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  input[type="text"],
  input[type="file"],
  .chat-input input,
  .assistant-body input {
    font-size: 0.9rem;
    padding: 8px;
  }

  .qr-display,
  .result-box,
  .history-wrapper {
    font-size: 0.85rem;
    padding: 10px;
  }

  .assistant-modal {
    width: 95%;
    top: 56%;
    transform: translate(-50%, -50%);
    padding: 12px;
  }

  #historyTable th,
  #historyTable td {
    font-size: 0.75rem;
    padding: 6px 4px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1rem;
  }

  .assistant-modal {
    font-size: 0.9rem;
  }

  .assistant-body input,
  .assistant-body .btn {
    font-size: 0.85rem;
  }
}

/*  Cut css*/

/* Mobile Slide-In Panel */
.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: #000;
  border-left: 2px solid #00bfff;
  box-shadow: -2px 0 15px rgba(0, 191, 255, 0.3);
  display: none;
  flex-direction: column;
  z-index: 99999;
  animation: slideInRight 0.3s ease-out;
}

.mobile-panel-header {
  background: #0a0a0a;
  color: #00bfff;
  padding: 12px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #00bfff;
}

.mobile-panel-header button {
  background: none;
  border: none;
  color: #00bfff;
  font-size: 1.4rem;
  cursor: pointer;
}

.mobile-panel iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* adaptive changes  */

/* --------------------- Small Devices UI --------------------- */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    padding: 0;
  }

  header h1 {
    font-size: 1.2rem;
    text-align: center;
  }

  .sidebar {
    flex-direction: row;
    position: fixed;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 50px;
    z-index: 999;
    background: #111;
    justify-content: space-around;
    border-top: 1px solid #444;
  }

  .sidebar a {
    flex-grow: 1;
    justify-content: center;
    font-size: 18px;
  }

  .sidebar .nav-label {
    display: none;
  }

  .tool-grid {
    display: block;
    padding: 10px;
  }

  .card {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .controls {
    flex-direction: column;
    gap: 8px;
  }

  .controls button {
    width: 100%;
  }

  #historyTable thead {
    display: none;
  }

  #historyTable td {
    display: block;
    text-align: left;
    padding: 4px 0;
    border-bottom: 1px solid #333;
  }

  #historyTable tr {
    margin-bottom: 10px;
    display: block;
    border: 1px solid #444;
    padding: 10px;
    background: #1b1b1b;
    border-radius: 8px;
  }

  .chat-modal,
  .assistant-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    border-radius: 0;
    bottom: 0;
    right: 0;
  }

  .chat-content {
    height: calc(100% - 100px);
    overflow-y: auto;
  }
}

/* --------------------- button more toucahble --------------------- */

input[type="text"],
input[type="file"] {
  font-size: 16px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

.btn {
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 8px;
}

footer {
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.title-animate {
  font-size: 1.5rem;
  text-align: center;
}

/* ==== Improve Main Tool Cards Look ==== */
.card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.15);
  border: 1px solid #333;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  text-align: center;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 255, 255, 0.2);
}

.card h2 {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.card p {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 12px;
}

.card .btn {
  font-size: 1rem;
  padding: 10px 20px;
  margin-top: 10px;
}

/* ============================================================
   ML Engine Result Styles (added Day 2)
   ============================================================ */

.result-header {
  margin-bottom: 6px;
}

.verdict-label {
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.result-url {
  word-break: break-all;
  margin-bottom: 10px;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ML probability bar */
.ml-score-block {
  margin: 10px 0;
}

.ml-label {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 5px;
}

.ml-conf {
  font-size: 0.78rem;
  opacity: 0.75;
}

.ml-bar-track {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  height: 10px;
  width: 100%;
  overflow: hidden;
}

.ml-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Reasons list */
.result-reasons {
  margin-top: 10px;
}

.reasons-title {
  font-size: 0.8rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reasons-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reason-item {
  font-size: 0.85rem;
  padding: 3px 0;
  line-height: 1.4;
}

.safe-msg {
  color: #44ff88;
  opacity: 0.9;
}

.ml-warn {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #ffcc00;
  opacity: 0.8;
}

/* ============================================================
   ML Model Info Panel (added Day 3)
   ============================================================ */
.ml-info-card {
  margin-bottom: 1rem;
}

.ml-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.ml-stat {
  background: rgba(0, 255, 0, 0.05);
  border: 1px solid rgba(0, 255, 0, 0.15);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ml-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.55;
}

.ml-stat-value {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent, #0f0);
}

/* Talk Mode active state */
#talkModeBtn.active {
  background: rgba(255, 50, 50, 0.15);
  border-color: #ff4444;
  color: #ff4444;
  animation: pulse-red 1.2s ease-in-out infinite;
}

@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 68, 68, 0);
  }
}
