/* Chart palette variables (light theme defaults) */
:root {
  --cp-chart-bg: #f5f7fa;
  --cp-chart-card: #ffffff;
  --cp-chart-text: #1f2937;
  --cp-chart-grid: #e4e7ef;
  --cp-chart-accent: #78c043;
  --cp-chart-accent-2: #f0a500;
  --cp-chart-accent-danger: #d94343;
  --cp-chart-muted: #9aa4b2;
}

/* Global */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f9fbfd;
  color: #333;
}

h1, h2 {
    font-size: 22px;
}

/* ===================== */
/*       Login Page      */
/* ===================== */

/* Login page overrides (for the body only on the login page) */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh; /* Full viewport height */
  margin: 0;
  background: #f5f9fc; /* Subtle background color */
}

/* The login container box */
.login-container {
  width: 400px;
  max-width: 90%;
  padding: 30px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

/* Logo styling */
.login-container img {
  max-width: 160px;
  margin-bottom: 20px;
}

/* Error message styling if login fails */
.login-container .error-message {
  color: #dc3545;
  margin-bottom: 10px;
  font-weight: 500;
}

/* The form wrapper for better control over spacing */
.login-form {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  padding: 14px;
  margin-top: 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

/* Focus outline for inputs */
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Submit button */
.login-form input[type="submit"] {
  border: none;
  border-radius: 6px;
  background: #007bff;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 20px; /* Extra space above the button */
  padding: 14px;
}

/* Hover and focus state for submit button */
.login-form input[type="submit"]:hover,
.login-form input[type="submit"]:focus {
  background: #0056b3;
  outline: none;
}

/* ===================== */
/*       Sidebar         */
/* ===================== */

.sidebar {
  width: 250px;
  background: #1f2b3a;
  color: #fff;
  height: 100vh;
  position: fixed;
  padding: 20px 0;
  transition: width 0.3s ease;
  overflow-x: hidden;
  font-size: 13px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 0 20px;
}

.sidebar-logo {
    max-height: 35px;
    margin: 10px 0;
    max-width: 140px;
    padding-bottom: 10px;
}

/* Hamburger (toggle) button styling */
.sidebar-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  margin-left: -13px;
}

/* Sidebar Navigation */
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #ddd;
  text-decoration: none;
  transition: background 0.2s ease;
}

.sidebar nav a:hover {
  background: #2e3d50;
  color: #fff;
}

.sidebar nav a.active {
  background: #2e3d50;
  color: #fff;
  font-weight: bold;
}

/* Icons inside nav links */
.sidebar nav a i {
  min-width: 20px;
  text-align: center;
  font-size: 20px;
}
.sidebar nav a svg {
  width: 20px;
  height: 20px;
}

/* ===================== */
/*    Collapsed Sidebar  */
/* ===================== */

.sidebar.collapsed {
  width: 40px;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.sidebar.collapsed nav a {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed nav a span {
  display: none;
}

.sidebar.collapsed nav a i {
  margin: 0 auto;
}

/* Optional tooltip for collapsed items */
.sidebar.collapsed nav a {
  position: relative;
}

.sidebar.collapsed nav a::after {
  content: attr(data-title);
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: #2e3d50;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  font-size: 13px;
  z-index: 999;
}

.sidebar.collapsed nav a:hover::after {
  opacity: 1;
}

/* ===================== */
/*      Main Content     */
/* ===================== */

.main-content {
  margin-left: 250px;
  padding:  0px 30px 30px 30px;
  transition: margin-left 0.3s ease;
}

.main-content.collapsed {
  margin-left: 60px;
}

/* ===================== */
/*   Server Dropdown     */
/* ===================== */

.sidebar.collapsed .server-dropdown {
  display: none;
}

.server-dropdown {
  margin: 16px 20px;
  padding: 10px 12px;
  background: #2e3d50;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.server-dropdown label {
  font-size: 13px;
  color: #ccc;
  font-weight: 500;
}

.server-dropdown select {
  width: 100%;
  background: #1f2b3a;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 36px 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23fff" d="M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.server-dropdown input {
  width: 100%;
  background: #1f2b3a;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

/* Slide in from below */
@keyframes fadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Slide out upwards */
@keyframes fadeOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-20px); opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s forwards ease;
}

.fade-out {
  animation: fadeOut 0.3s forwards ease;
}

/* ========== Multi-Screen Menu Layout ========== */

.menu-screen {
  display: none;
  padding: 15px 0px 30px 0px;
}

@media (min-width: 800px) { 
  #configFilesScreen.menu-screen {
    padding: 15px 30px 30px 0px !important;
  }
}

.menu-list,
.sub-menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.menu-button,
.menu-sub-btn,
.back-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  max-width: 270px; /* Button Width */
}

/* narrower param buttons */
.param-btn {
  width: auto;
  min-width: 80px;
  max-width: 170px;
  white-space: nowrap;
}

.menu-button:hover,
.menu-sub-btn:hover,
.back-btn:hover {
  background: #8cc63f;
}

.menu-button[aria-disabled="true"],
.menu-button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.menu-button[aria-disabled="true"]:hover,
.menu-button.is-disabled:hover {
  background: #6c757d;
}

.edit-conf-tip {
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: #e6f7d9;
  border-left: 4px solid #8cc63f;
  color: #2d5830;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.edit-conf-tip strong {
  display: block;
  margin-bottom: 4px;
}

.back-btn {
  margin-top: 20px;
  background: #6c757d; /* Slightly gray for distinction */
}
.back-btn:hover {
  background: #8cc63f;
}

/* Input groups (for email, IP, etc.) */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 350px; /* Adjust as desired */
}

.input-group label {
  font-weight: 500;
  color: #333;
}

.input-group input {
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.input-group select {
  padding: 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%23666" d="M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 36px;
}

.input-group select:disabled {
  background-color: #f5f5f5;
  color: #777;
  cursor: not-allowed;
}

.custom-scan-account-group {
  margin-top: 18px;
}

.custom-scan-account-group select {
  max-width: 350px;
}

.custom-scan-note {
  font-size: 12px;
  color: #555;
  line-height: 1.5;
  margin-top: 4px;
  max-width: 350px;
}

/* Output screen elements */
#outputTitle {
  margin-bottom: 10px;
}

#serverStatus {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 15px;
}

#outputText {
  width: 100%;
  min-height: 300px;
  background: #141729;        /* dark terminal background */
  color: #1DB55E;             /* bright green text */
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 15px 0px 15px 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: monospace;  
}

/* Footer styling */
footer {
  border-top: 1px solid #ddd;          /* softer light border */
  background: #f9f9f9;                 /* light neutral background */
  padding-top: 1rem;                   /* spacing similar to dark theme */
  padding-bottom: 1rem;
  text-align: center;                  /* same alignment as your original */
  font-size: 13px;
}

/* Stats styling */
/* Container layout */
.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  /* padding: 0 1rem; */
}

/* All stat cards */
.stat-card {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

/* Content container inside each card */
.stat-content {
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Main number - now larger and bold */
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #de980d;
}

/* Label below the number */
.stat-label {
  font-size: 0.85rem;
  color: #4a9a15;
  margin-top: 0.60rem;
}

/* Wide cards span full width */
.stat-card.wide {
  grid-column: span 3;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 1rem 1.5rem;
  text-align: left;
}

/* .stat-card.chart-card {
  align-items: stretch;
  grid-column: span 3;
}

.stat-card.chart-card .stat-content {
  align-items: stretch;
  justify-content: flex-start;
} */

/* Wide card content aligned to top-left */
.stat-card.wide .stat-content {
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

#homeScreen .stat-card.wide .stat-content {
  width: 85%;
}

#homeScreen .stat-card.wide .stat-label {
  width: 85%;
}

#homeScreen .stat-card.chart-card .stat-content,
#homeScreen .stat-card.chart-card .stat-label {
  width: 100%;
}

@media (max-width: 768px) { /* Adjust the max-width as needed for your mobile breakpoint */
  #homeScreen .stat-card.wide .stat-label {
    margin-left: 20px;
  }
  #top-ddos-ips, #top-ipdb-ips {
  width: 230px;
  }
}

/* ICONS (left-aligned default) */
.stat-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

/* ICONS for wide cards */
.stat-card.wide::before {
  left: auto;
  right: -12px;       
  top: 55px;         
  opacity: 0.08;    
}

.stat-card.chart-card::before {
  display: none;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: clamp(220px, 32vw, 280px);
  margin-top: 0.75rem;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.95rem;
  color: var(--cp-chart-muted);
  text-align: center;
  padding: 0 1rem;
  display: none;
}

.chart-wrapper.is-empty canvas {
  opacity: 0;
  pointer-events: none;
}

.chart-wrapper.is-empty .chart-empty-message {
  display: block;
}

@media (max-width: 768px) {
  .chart-wrapper {
    height: 220px;
  }
}

/* Map icons to SVGs */
.icon-shield::before       { background-image: url("/static/icons/shield.svg"); }
.icon-zap::before          { background-image: url("/static/icons/zap.svg"); }
.icon-globe::before        { background-image: url("/static/icons/globe.svg"); }
.icon-shield-off::before   { background-image: url("/static/icons/shield-off.svg"); }
.icon-bug::before          { background-image: url("/static/icons/bug.svg"); }
.icon-activity::before     { background-image: url("/static/icons/activity.svg"); }
.icon-target::before       { background-image: url("/static/icons/target.svg"); }
.icon-crosshair::before    { background-image: url("/static/icons/crosshair.svg"); }
.icon-layers::before       { background-image: url("/static/icons/layers.svg"); }
.icon-wordpress::before    { background-image: url("/static/icons/wordpress.svg"); }
.icon-server::before       { background-image: url("/static/icons/server.svg"); left: -16px !important; }

/* Responsive layout */
@media (max-width: 992px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
  .stat-card.wide {
    grid-column: span 1;
  }
}

/* Smaller page heading */
.dashboard-title {
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}

/* Section title above buttons */
.tool-section-title {
  font-size: 1rem;
  font-weight: 500;
  color: #444;
  text-align: left;
}

/* Slightly smaller title font for wide card headers */
.stat-card.wide .stat-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2B2B2B;
  text-align: left;
}

/* Style for the blocked IP lists */
#top-ddos-ips,
#top-ipdb-ips {
  font-family: 'Courier New', monospace;
  /*font-size: 0.95rem;*/
  color: #333;
  background: #f6f8fa;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow-y: auto;
  white-space: pre-line;
  line-height: 1.5;
}

/* Optional: Emphasize hit count */
#top-ddos-ips span,
#top-ipdb-ips span {
  color: #4a9a15;
  font-weight: 600;
}

/* Align Top IP lists side-by-side on wider screens */
@media (min-width: 1100px) {
  .stats-container {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: row dense;
  }

  .stats-container .stat-card {
    grid-column: span 2;
  }

  .stats-container .stat-card.wide.icon-target,
  .stats-container .stat-card.wide.icon-crosshair {
    grid-column: span 3;
    align-self: stretch;
  }

  .stats-container .stat-card.chart-card {
    grid-column: span 3;
  }

  .stats-container .stat-card.wide.icon-target #top-ddos-ips,
  .stats-container .stat-card.wide.icon-crosshair #top-ipdb-ips {
    width: 100%;
  }
}

/* Optional: Add hover for clarity */
#top-ddos-ips div:hover,
#top-ipdb-ips div:hover {
  background-color: #eef2f6;
  border-radius: 4px;
}

.nice-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.nice-table th,
.nice-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 14px;
}

.nice-table th {
  width: 25%;
  background: #f8fafc;
  color: #333;
  font-weight: 600;
  border-right: 1px solid #eee;
}

.nice-table tr:nth-child(even) {
  background: #fcfcfc;
}

.nice-table tr:hover {
  background: #f1f5f9;
}

.nice-table input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nice-table input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

/* textarea style */
textarea#manualTextarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px 0px 14px 14px;
  border: 1px solid #ccd1d9;
  margin-top:2em;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 600px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea#manualTextarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Improve config textarea styling */
textarea.config-textarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px;
  border: 1px solid #ccd1d9;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 500px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-top: 1.2em;
}

textarea.config-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Center button group and add spacing */
.button-group {
  display: flex;
  gap: 10px;
  margin-top: 1em;
  margin-bottom: 1em;
}

/* Improved dropdown styling for config file selection */
.config-select {
  width: 100%;
  max-width: 400px;
  padding: 10px 36px 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 6px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23333' d='M1.41 0L6 4.58 10.59 0 12 1.41 6 7.41 0 1.41z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.config-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
  outline: none;
}

/* Ensure mouse pointer is visible in all text inputs and textareas */
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select {
  cursor: pointer;
}

select {
  cursor: pointer;
}

/* ===================== */
/*  MonitorPro Table UI  */
/* ===================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

.data-table th {
  background-color: #f1f5f9;
  padding: 12px 10px;
  text-align: left;
  color: #333;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.data-table input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: monospace;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.data-table input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
  outline: none;
}

/* Buttons in actions */
.data-table button {
  background-color: #6c757d;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 5px;
  transition: background 0.2s ease;
}

.data-table button:hover {
  background-color: #8cc63f;
}

.data-table tfoot td {
  background: #f8fafc;
  font-weight: 500;
}

.data-table tr:hover {
  background: #f6f9fc;
}

/* ===================== */
/*     Error Message     */
/* ===================== */
.error-banner {
  background-color: #ffe5e5;
  color: #b30000;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #ffcccc;
  font-weight: 500;
}

/* ===================== */
/*    Success Message     */
/* ===================== */
.success-banner {
  background-color: #e6ffed;
  color: #176f3b;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid #c2f0d3;
  font-weight: 500;
}

/* MonitorPro: search box wrapper */
.search-wrapper {
  margin-bottom: 1rem;
  text-align: right;
}

/* Search wrapper for alignment and spacing */
.search-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

/* MonitorPro: styled search input */
#domainSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#domainSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.tools-page .menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  max-width: 900px;
  padding: 0 2rem;
  margin-top: 2rem;
}

.tools-page .menu-button {
  min-width: 320px;
  background: #007bff;
  color: #fff;
  border: none;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  text-align: center;
  white-space: nowrap;
  margin: 6px 8px;
}

.tools-page .menu-button:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.tools-page .menu-screen > p {
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 15px;
  color: #444;
  font-weight: normal;
}

.tools-page .sub-menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.tools-page .sub-menu-title {
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
  color: #444;
}

textarea.bulk-textarea {
  font-family: monospace;
  font-size: 14px;
  padding: 14px;
  border: 1px solid #ccd1d9;
  border-radius: 8px;
  background-color: #fefefe;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  width: 100%;
  height: 320px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-top: 1.2em;
}

textarea.bulk-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.tool-section {
  margin: 2.5rem auto;
  max-width: 680px;
  padding: 0 1rem;
}

.tool-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1f2b;
  text-align: left;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: #e6f7d9; /* light green tint */
  border-left: 4px solid #8cc63f;
  width: auto;
  max-width: 100%;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

/* only domain col gets fixed-width + ellipsis */
.domain-cell {
  display: inline-block;      /* shrink to content */
  max-width: 120px; 
  white-space: nowrap;        /* no line-wrap */
  overflow: hidden;           /* clip overflow */
  text-overflow: ellipsis;    /* show “…” */
  vertical-align: middle;     /* align nicely in the cell */
  cursor: default;            /* so title tooltip still works */
}

/* Cluster sites info table */
#sitesInfoTable th:nth-child(1),
#sitesInfoTable td:nth-child(1) {
  width: 60px; /* UID */
  white-space: nowrap;
}

#sitesInfoTable th:nth-child(3),
#sitesInfoTable td:nth-child(3) {
  width: 60px; 
}

#sitesInfoTable th:nth-child(4),
#sitesInfoTable td:nth-child(4),
#sitesInfoTable th:nth-child(5),
#sitesInfoTable td:nth-child(5) {
  width: 40px; /* User */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sitesInfoTable th:nth-child(6),
#sitesInfoTable td:nth-child(6),
#sitesInfoTable th:nth-child(7),
#sitesInfoTable td:nth-child(7) {
  width: 40px; /* Created + Status */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-down {
  color: red;
  font-weight: 500;
}
.status-up {
  color: green;
  font-weight: 500;
}

/* Cluster Sites Info styled search input */
#sitesSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#sitesSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Adjusted widths for wpSitesTable */
#wpSitesTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#wpSitesTable th,
#wpSitesTable td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  white-space: nowrap;
}

#wpSitesTable th:first-child,
#wpSitesTable td:first-child {
  width: 20px; /* Checkbox column */
  text-align: center;
}

#wpSitesTable th:nth-child(2),
#wpSitesTable td:nth-child(2) {
  width: 120px; /* Server column */
}

#wpSitesTable th:nth-child(3),
#wpSitesTable td:nth-child(3) {
  width: 260px; /* Domain or Website ID */
}

#wpSitesTable th:nth-child(4),
#wpSitesTable td:nth-child(4) {
  width: 40px; /* Owner column */
}

#wpSitesTable th:nth-child(5),
#wpSitesTable td:nth-child(5) {
  width: auto; /* Path - allow to fill remaining space */
  word-break: break-all;
}

#wpSitesSearch, #domSearch {
  padding: 10px 14px;
  width: 340px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", sans-serif;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#wpSitesSearch:focus, #domSearch:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.pager{
  display:flex;               /* horizontal pills */
  gap:6px;
  justify-content:center;
  margin:14px 0;
}
.pager button{
  background:#6c757d;
  color:#fff;
  border:none;
  padding:6px 12px;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
}
.pager button[disabled]{        /* active page pill */
  opacity:.45;
  cursor:default;
}
.pager button:hover {
  background: #8cc63f;
}

/* Fix checkbox column width for domain selector */
.nice-table2 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.nice-table2 th,
.nice-table2 td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  font-size: 14px;
}

.nice-table2 th {
  background: #f8fafc;
  color: #333;
  font-weight: 600;
  border-right: 1px solid #eee;
}

.nice-table2 tr:nth-child(even) {
  background: #fcfcfc;
}

.nice-table2 tr:hover {
  background: #f1f5f9;
}

.nice-table2 input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  box-sizing: border-box;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nice-table2 input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

#domTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#domTable th,
#domTable td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  white-space: nowrap;
}

#domTable th:first-child,
#domTable td:first-child {
  width: 20px; /* Checkbox column */
  text-align: center;
}

.refresh-note {
  text-align: right;
  font-size: 0.9rem;
  margin-top: 4px;
  margin-right: 12px;
  width: 100%;
  box-sizing: border-box;
}

.refresh-note a {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

/* restore page */
#qTopControls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  max-width: 100%;
}

#qTopControls input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: monospace;
  background: #fff;
  flex: 1;
  max-width: 360px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#qTopControls input[type="text"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
  outline: none;
}

#qTopControls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}

#qHelperText {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  margin-top: -4px;
}

#qBtnWrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

#qRestoreBtn {
  background: #6c757d;
  color: white;
  padding: 10px 18px; /* reduced vertical padding */
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#quarantineScreen #qBackBtn {
  margin-top: 0 !important;
}

#qRestoreBtn:hover {
  background: #8cc63f;
}

#qBackBtn {
  background: #6c757d;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

#qBackBtn:hover {
  background: #5a6268;
}

#qTable {
  table-layout: fixed;
}

#qTable th {
  width: auto !important;
}
#qTable th:first-child,
#qTable td:first-child {
  width: 30px !important;
  max-width: 30px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

#qTable th:nth-child(2),
#qTable td:nth-child(2),
#qTable th:nth-child(3),
#qTable td:nth-child(3){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
}

/* Quarantine list: visually dim restored rows and emphasize status */
.nice-table tr.restored,
#qTable tr.restored {
  opacity: 0.55;
}

.nice-table tr.restored .status,
#qTable tr.restored .status {
  color: #1fb36b; /* green accent for restored */
  font-weight: 600;
}

#qTable tr.restored input[type="checkbox"],
.nice-table tr.restored input[type="checkbox"] {
  filter: grayscale(100%);
  opacity: 0.7;
}

/* Danger Button Style (for Cancel buttons) */
.menu-button.danger {
  background-color: #dc3545; /* Bootstrap Red */
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.menu-button.danger:hover {
  background-color: #c82333; /* Slightly darker red on hover */
}

/* === Mobile tweaks (≤768 px) ==================================== */
@media (max-width: 768px) {
	
  .tool-section-title {
    width: 85% !important;
    font-size: 14px;
  }	
  
	.param-btn {
		margin-top: 15px; }
	label {
		margin-top: 15px;
	}
	
	.data-table button {
		margin-top: 5px;
	}
	
  /* --- Sidebar --- */
  .sidebar.collapsed      { width: 40px; height: 100%;}
  .main-content.collapsed { margin-left: 60px; }

  /* hide labels, keep icons */
  .sidebar.collapsed nav a        { justify-content: center; padding: 12px 0; }
  .sidebar.collapsed nav a span,
  .sidebar.collapsed .sidebar-logo { display:none; }

  /* make toggle button always visible */
  #toggleSidebar { font-size: 21px;}

  /* — Stats cards — */
  .stats-container { grid-template-columns: 1fr; }
  .stat-card.wide  { grid-column: span 1; }

  /* smaller heading */
  .dashboard-title { font-size: 1.1rem; }
  
/* =========================================================
   Extra mobile-first tweaks – Tools & Utilities (≤ 768 px)
   ========================================================= */
   
  /* Sub-menus (menu-screen) gain breathing room */
  .menu-screen {
    padding: 12px 15px 32px 0px;
  }
  #outputText {
  padding: 15px 10px 15px 15px;
  }
  .tools-page .sub-menu-list {
    gap: 10px;
    margin: 1rem 0;
  }
  .menu-sub-btn,
  .back-btn {
    width: 100%;
    max-width: none;
    font-size: 13px;
  }

  /* Input groups: stretch to full width */
  .input-group,
  .input-group input,
  .input-group textarea,
  textarea.bulk-textarea {
    max-width: 95% !important;
    width: 95% !important;
  }

  /* Big textareas shrink to a saner height on phones */
  textarea.bulk-textarea,
  textarea#manualTextarea,
  textarea.config-textarea {
    height: 220px;
	width: 90%;
  }

  /* Data tables: make them horizontally scrollable instead of spilling off-screen */
  .nice-table,
  .nice-table2,
  .data-table,
  #wpSitesTable,
  #domTable,
  #sitesInfoTable,
  #qTable {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nice-table thead,
  .nice-table2 thead,
  .data-table thead,
  #wpSitesTable thead,
  #domTable thead,
  #sitesInfoTable thead,
  #qTable thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 1;
  }

  /* Output terminal box: allow horizontal pan if long lines exist */
  #outputText {
    overflow: auto;
    word-wrap: normal;     /* keep long hashed strings intact */
  }

  /* Hide Lucide icons’ titles in the off-canvas sidebar when collapsed */
  .sidebar.collapsed nav a::after {
    display: none;
  }
  
	#wpSitesSearch,
	#sitesSearch,
	#domSearch, 
	#domainSearch {
		width: 90% !important;
	}
	
	
  .main-content { 
    padding: 0 0px 0px !important;
  }

  .stat-card::before    { width: 60px; height: 60px; left: -21px; }
  .stat-card.wide::before {
    width: 60px; height: 60px; top: 40px; right: -25px;
  }

  .stat-number          { font-size: 1.55rem; }
  .stat-label           { font-size: 0.80rem; } 
  .stat-card.wide .stat-number { font-size: 1.0rem;padding-top: 15px;padding-bottom:8px;padding-left: 15px; }

  .stat-card.wide .stat-label {
    overflow-x: auto;
	-webkit-overflow-scrolling: touch;
  }
  
  #top-ddos-ips,
  #top-ipdb-ips {
    white-space: nowrap !important;           /* stop breaking lines */
    overflow-x: scroll !important;              /* enable scroll */
    display: block !important;
    padding-left: 8px !important;             /* reduce padding */
    padding-right: 8px !important;
    font-size: 0.85rem;	/* optional: tighter fit */
	  width: 85%;
	  max-width: 85%;
    -webkit-overflow-scrolling: touch;        /* smoother on iOS */
  }
  
  .stat-card.wide {
    padding: inherit !important;
    padding-bottom: 15px !important;
  }
  
  .stat-card.wide.icon-crosshair {
    padding-right: 2rem !important;
  }
  
	footer p {
	  font-size: 0.8rem !important;
	  color: #555;                         /* soft gray for readability */
      margin: 0;
	}  
  
  #outputText {
	width: 90% !important;
	white-space: pre !important;
  }
 
/* fix settings page on mobile */ 
  .settings-page #singleKeysContainer .nice-table,
  .settings-page #allKeysContainer    .nice-table{
    table-layout: fixed;              /* stop the first column hogging width   */
    width:100%;
  }

  /* Key column */
  .settings-page #singleKeysContainer .nice-table th:nth-child(1),
  .settings-page #singleKeysContainer .nice-table td:nth-child(1),
  .settings-page #allKeysContainer    .nice-table th:nth-child(1),
  .settings-page #allKeysContainer    .nice-table td:nth-child(1){
    width:40%;                        /* let it wrap if needed                 */
    word-break:break-all;
  }

  /* Value column */
  .settings-page #singleKeysContainer .nice-table th:nth-child(2),
  .settings-page #singleKeysContainer .nice-table td:nth-child(2),
  .settings-page #allKeysContainer    .nice-table th:nth-child(2),
  .settings-page #allKeysContainer    .nice-table td:nth-child(2){
    width:60%;
  }

  /* Make the input fill the cell */
  .settings-page .nice-table input[type="text"]{
    width:100%;
  }
}

/* === Very small screens (≤480 px) =============================== */
@media (max-width: 480px) {

  /* login box stretches almost full width */
  .login-container { width: 100%; max-width: 350px; padding: 24px 22px; }

  /* buttons & inputs slightly taller */
  .login-form input[type="text"],
  .login-form input[type="password"],
  .login-form input[type="submit"] {
    padding: 12px;
    font-size: 15px;
  }

  /* collapse server-dropdown nicely */
  .server-dropdown label { font-size: 12px; }
  .server-dropdown select{ font-size: 13px; padding: 6px 28px 6px 8px; }
}
.security-tip {
  display: flex;
  align-items: flex-start;   /* icon aligns at top of text */
  gap: .75rem;
  margin: .75rem 0 1.25rem;
  padding: 6px 10px;
  border-left: 4px solid #38a169;  /* emerald-500 */
  background: #d4edda;             /* emerald-50 */
  color: #155724;                  /* emerald-900 */
  font-size: .90rem;
  line-height: 1.5;
  border-radius: .4rem;
}
.security-tip svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: #10b981;
  margin-top: .2rem;  /* nudge it up a bit */
}
@media (prefers-color-scheme:dark) {
  .security-tip {
    background: #064e3b;           /* emerald-900 */
    border-color: #6ee7b7;         /* emerald-300 */
  }
  .security-tip svg {
    fill: #6ee7b7;
  }
}
.tool-tip-note {
  background: #d4edda;
  color: #155724;
  padding: 6px 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.45;
  border-left: 4px solid #38a169;
}
.tool-tip-note a {
  color: #0c5460;
  font-weight: 600;
}
.tool-tip-note code {
  color: inherit;
  background: transparent;
  font-weight: 600;
}
 /* visual cue for locked fields */
.locked-input {
	background: #f2f2f2;
	color: #666;
	cursor: not-allowed;
}

/* ─────────────────────────────────────────────
   Masonry-style responsive grid for WebUI
   (≤768 px → 1 col  |  ≥992 px → 2 cols  |  ≥1200 px → 3 cols  |  ≥1600 px → 4 cols)
   ───────────────────────────────────────────── */

.container      { max-width: 1600px; margin: 0 auto; }  /* centred, full-width on small screens */
.grid           { column-count: 1; column-gap: 20px; }

.card {
  background: #f2f2f2;                          /* darker than pure white */
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  /* === masonry overlap fix === */
  box-sizing: border-box;        /* width 100% now INCLUDES padding + border   */
  break-inside: avoid;           /* keep whole card in one column              */
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside:    avoid;
}

.card:hover {
  background: #e9e9e9;                          /* slightly darker on hover */
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}

/* make every button span full card width */
.card .menu-button,
.card .menu-sub-btn {
  width     : 100%;
  max-width : 100%;
  display   : block;
  text-align: center;
  margin-bottom: 10px;
}

/* 2 / 3 / 4 columns at wider break-points */
@media (min-width: 992px ) { .grid { column-count: 2; } }
@media (min-width: 1200px) { .grid { column-count: 3; } }
@media (min-width: 1600px) { .grid { column-count: 4; } }

/* @media (min-width: 1100px) {
  #homeScreen .grid {
    column-count: initial;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  #homeScreen .grid > .card {
    margin-bottom: 0;
  }
} */
