
/* slate color scheme */
[data-md-color-scheme="slate"] {
  --gradient-start: #1b2735;
  --gradient-end: #3a6073;
  --text-color: #e0e6ed;
  --highlight-color: #047180;
  --button-hover: #008ba3;
  --button-bg: #243b4a;
  --button-bg-hover: #345d6f;
  --modal-bg: #1e2e39;
  --command-bg-color: white;
  --command-text-color: black;
  --code-text-color: #e0e6ed;
  --code-bg-color: #0f1a1d; /* Dark green-blue-gray for command examples */
  --notification-success-bg: rgb(75, 117, 90);
  --notification-error-bg: rgb(139, 60, 60);
  --notification-warning-bg: rgb(151, 151, 47);
}

/* light color scheme */
[data-md-color-scheme="light"] {
  --gradient-start: white;
  --gradient-end: #4D81A7;
  --text-color: #102a43; /* Dark blue with high contrast for legibility */
  --highlight-color: #4D81A7; /* Vibrant sea green for accents */
  --button-hover: #78bef0; /* Light sea green for hover states */
  --button-bg: #dfeffa; /* Bright orange for buttons */
  --button-bg-hover: #f7eae9; /* Darker orange for button hover states */
  --modal-bg: #ffffff; /* Pure white for a clean modal background */
  --command-bg-color: #f0fff4; /* Very pale green, almost white */
  --command-text-color: #234e52; /* Dark slate green */
  --code-text-color: #1a202c; /* Very dark gray-blue */
  --code-bg-color: #cbd5e0; /* Light blue-gray for code blocks */
  --notification-success-bg: rgb(158, 240, 158);
  --notification-error-bg: rgb(245, 158, 158);
  --notification-warning-bg: lightyellow;
}




/* only applies to slate theme unless marked !important */
.md-content h1, 
.md-content h2,
.md-content h3,
.md-content h4,
.md-content h5,
.md-content h6,
.md-tabs,
.md-header,
.md-footer,
.md-nav__title {
  color: var(--text-color) !important;
}


/* BEGIN CUSTOM SLATE THEME */
.md-main {
  background: linear-gradient(120deg, var(--gradient-start), var(--gradient-end)) !important;
  color: var(--text-color) !important;
}
  

/* slate color scheme borders */
.md-tabs,
.md-header,
.md-footer,
.md-nav,
.md-nav__title {
  background-color: var(--gradient-start) !important;  /* Force override */
}


.md-source{
  background-color: var(--gradient-start) !important;
}

.md-clipboard.md-icon {
  color: var(--text-color);
}
/* END SLATE CUSTOM THEME, BEGIN LIGHT THEME CUSTOMIZATION */
[data-md-color-scheme="light"] .logo {
  opacity: 0.7; 
}


.md-clipboard.md-icon {
  display: block;
  margin-top: -25px;
  margin-right: -23px;
}

#toc-toggle {
  width: 100%;
  padding: 4px;
  margin-top: 10px;
  background-color: var(--button-bg); 
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
  text-transform: uppercase;
}


/* no longer needed, gets applied to modal directly in js */
/* .content-custom{
  text-align: center;
  padding: 20px;
  color: var(--text-color);
  position: relative;
} */


.content table {
  margin-left: auto;
  margin-right: auto;
}


.button-container {
  display: flex;
  justify-content: center; /* This will center the buttons within the container */
  flex-wrap: wrap; /* Allows buttons to wrap to the next line on smaller screens */
  position: relative;
}

.btn-cyber {
  background-color: var(--button-bg);
  color: var(--text-color) !important;
  border: none;
  padding: 12px 25px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s;
  margin: 10px;
}



/* .btn-close {
  display: inline-block; 
  float: right;
  margin-right: -15px;
  margin-top: -15px;
} */

.btn-cyber.btn-close {
  float: right; /* Aligns the icon to the right */
  margin-right: -20px;
  margin-top: -20px;
  color: inherit; /* Inherits color from parent, or specify your desired color */
  font-size: 18px; /* Adjust the font size smaller or as needed */
}


/* Media queries to adjust button sizing on smaller screens */
@media (max-width: 830px) {
  .btn-cyber {
    padding: 0px 10px;  /* Slightly smaller padding */
    font-size: 14px;  /* Smaller font size to fit more easily */
  }
}

.btn-cyber:hover {
  background-color: var(--button-bg-hover);
}

/* BEGIN MODALS */
.modal-content {
  display: none;
  background: var(--modal-bg);
  color: var(--text-color);
  max-width: none; /* Remove width constraint to match MkDocs grid */
  overflow: auto; /* This will contain the floated elements */
  /* text-align: center; */
}

.modal-content .modal-pdf {
  width: 90%;
  height: 70vh;
  max-width: 90%;
  min-width: 90%;
  display: block;
  margin: 0 auto;
  border: none;
}

.modal-content.markdown-modal {
  overflow: hidden !important;
}

.modal-content.markdown-modal .markdown-modal-body {
  max-height: calc(75vh - 72px);
  overflow: auto;
  margin-top: 32px;
  padding-right: 10px;
  box-sizing: border-box;
}

/* For simple-markdown-modals, easy reference to markdown files. Iframe variant used by simple-markdown-modal.js (works on file://) */
.modal-content.markdown-modal .markdown-modal-iframe {
  width: 100%;
  height: calc(75vh - 72px);
  margin-top: 32px;
  border: none;
  border-radius: 4px;
  background: var(--md-default-bg-color, #fff);
}

@media (min-width: 992px) { /* Desktops and up */
  .modal-content {
    width: 98%;  /* Match the wider layout */
  }
}

@media (min-width: 1200px) { /* Large desktops */
  .modal-content {
    width: 98%;  /* Match the wider layout */
    max-width: none;  /* Remove constraint */
  }
}

@media (min-width: 1600px) { /* Extra large desktops */
  .modal-content {
    width: 98%;  /* Match the wider layout */
    max-width: none;  /* Remove constraint */
  }
}

/* Style for displaying code snippets */
.modal-content code {
  display: block;
  white-space: pre; /* Maintains whitespace formatting */
  background-color: var(--code-bg-color); /* Light background to highlight code */
  color: var(--code-text-color); /* Ensures text is easily readable */
  padding: 10px;
  margin: 10px 0; /* Adds space above and below the code block */
  border-radius: 5px;
  font-family: 'Courier New', Courier, monospace; /* Monospaced font for code */
  overflow-x: auto; /* Adds horizontal scrolling if code is too long */
}

.event-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--highlight-color);
}

.event-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 135%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  color: #ffffff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity 0.15s ease;
}

.event-tooltip:hover::after {
  opacity: 1;
}

.modal-content p.command-example {
  font-style: italic;
  background-color: var(--command-bg-color);
  padding: 10px;
  border-radius: 5px;
  color: var(--command-text-color);
}

.code-script-left-align {
  text-align: left !important; /* Aligns the text to the left */
}

/* horizontal line */
.styled-hr {
  border: 0;
  height: 2px;
  background-image: linear-gradient(to right, var(--gradient-end), var(--gradient-start), var(--gradient-start));
  margin-top: 20px;
  margin-bottom: 20px;
}


.section-title {
  text-align: left;
  font-style: italic;
}


button {
  display: block;
  margin-top: 20px;
}

/* modify logo */
.logo {
  width: 15vw; /* vw units represent a percentage of the viewport width */
  height: auto; /* maintains the aspect ratio */
  opacity: 0.4; 
  border-radius: 50%;
}
.md-logo svg {
  display: none !important; /* Hides the SVG */
}
.md-logo {
  display: inline-block; /* Ensures the anchor behaves like an image */
  width: 1.5vw; /* vw units represent a percentage of the viewport width */
  height: 1.5vw; /* maintains the aspect ratio */
  background-image: url('../images/logo.png'); /* Path to new logo image */
  background-size: cover; /* Cover the entire area of the tag */
  background-position: center; /* Center the background image */
  opacity: 0.7; 
  border-radius: 50%;
}
/* end modify logo */


/* BEGIN NOTIFCATIONS */

.feedback-notification {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 300px;
  color: var(--text-color);
  text-align: center;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  font-size: 15px;
  background-color: var(--gradient-start);
  opacity: 0; /* Start invisible */
  visibility: hidden; /* Ensures it doesn't interfere when not active */
  transition: visibility 0s, opacity 0.6s linear;
}

.feedback-notification.show {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s 0s, opacity 0.1s linear;
}

.feedback-notification.hide {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 3s, opacity 0.6s linear;
}

.feedback-notification.success {
  background-color: var(--notification-success-bg);
}

.feedback-notification.error {
  background-color: var(--notification-error-bg);
}

.feedback-notification.warning {
  background-color: var(--notification-warning-bg);
}

/* END NOTIFCATIONS */

/* icons */
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(./MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px; /* You can adjust the size as needed */
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  vertical-align: middle;
}


/* Mini navigation container */
.mini-nav {
    display: flex; /* Aligns items in a row */
    justify-content: flex-end; /* Aligns content to the right */
    background-color: var(--gradient-start); /* Inherit background color from primary foreground color */
    border-radius: 8px; /* Rounded corners for the box */
    padding: 10px; /* Padding inside the box */
    margin-top: 20px; /* Space from the top or other elements */
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); /* Subtle shadow for depth */
    color: var(--text-color);
    flex-wrap: wrap;
}

/* Style for individual navigation items */
.mini-nav a {
    display: flex;
    align-items: center; /* Center items vertically */
    padding: 5px 10px; /* Padding around links */
    text-decoration: none; /* Remove underline */
    color: var(--md-primary-bg-color); /* Text color inherits from primary background color */
    font-size: 0.75rem; /* Smaller font size for compact appearance */
    margin: 0 5px; /* Spacing between items */
    color: var(--text-color);
    height: 20px; /* Adjust height as needed */
}

.mini-nav .material-icons {
    font-size: 16px; /* Icon size */
    margin-right: 5px; /* Space between icon and text */
    color: var(--text-color);
}

.mini-nav .nav-title {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.65rem;
  margin-right: auto; /* Pushes all other items to the right */
  height: 20px;
  font-weight: bold;
  color: gray;
}

/* temporary for table */
.custom-table {
  width: 90%; /* Full width to use up all available space */
  /* center content */
  text-align: center;
  /* center table */
  margin-left: auto;
  margin-right: auto;
}

/* Make  overall MkDocs layout about 5% wider */
.md-grid {
  max-width: 73rem !important; /* Default is ~65-ishrem, this adds ~5% width */
}

/* Ensure content uses the available space */
.md-main__inner {
  max-width: none;
}

/* Keep tables and code blocks responsive within the wider layout */
.md-typeset table {
  display: table;
  width: 100%;
}

/* ================================================================
   ADVANCED GUIDE — overlay, panel, sections, callouts
   ================================================================ */

/* --- Button inside modal --- */
.btn-advanced-guide {
  background: linear-gradient(135deg, #1a6b3c, #2ecc71);
  color: #fff !important;
  border: none;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.35);
  transition: all 0.25s ease;
  margin: 6px 0 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-advanced-guide:hover {
  background: linear-gradient(135deg, #239b56, #58d68d);
  box-shadow: 0 4px 14px rgba(46, 204, 113, 0.5);
  transform: translateY(-1px);
}

/* --- Overlay --- */
#advanced-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 2000;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.15s ease;
}
#advanced-guide-overlay.ag-visible { opacity: 1; }

/* --- Panel --- */
#advanced-guide-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2001;
  width: 96%;
  max-width: 1650px;
  max-height: 92vh;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.15s ease;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  contain: layout style;
}
#advanced-guide-panel.ag-visible {
  opacity: 1;
}

/* Colour scheme — inherits from modal / slate theme vars */
[data-md-color-scheme="slate"] #advanced-guide-panel {
  background: #1e2a35;
  color: #d4dce4;
}
[data-md-color-scheme="light"] #advanced-guide-panel,
[data-md-color-scheme="default"] #advanced-guide-panel {
  background: #f8f9fa;
  color: #1e2a35;
}

body.ag-no-scroll { overflow: hidden !important; }

/* --- Header bar --- */
.ag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.ag-header h3 {
  margin: 0;
  font-size: 1.25rem;
}
.ag-close {
  font-size: 28px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
  line-height: 1;
}
.ag-close:hover { color: #ff4444; }

/* --- Scrollable body --- */
.ag-body {
  padding: 18px 22px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.ag-description {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.ag-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 10px 0 14px;
}

/* --- Collapsible sections --- */
.ag-section {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.ag-section.expanded {
  border-color: rgba(46, 204, 113, 0.35);
}
.ag-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
[data-md-color-scheme="slate"] .ag-section-header { background: rgba(255,255,255,0.04); }
[data-md-color-scheme="light"] .ag-section-header,
[data-md-color-scheme="default"] .ag-section-header { background: rgba(0,0,0,0.03); }
.ag-section-header:hover {
  background: rgba(46, 204, 113, 0.1);
}
.ag-arrow {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.ag-section-title {
  font-weight: 600;
  font-size: 1rem;
}
.ag-section-body {
  padding: 14px 18px 18px;
  line-height: 1.65;
}
.ag-section-body h5 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: #2ecc71;
}
.ag-section-body pre {
  margin: 8px 0 14px;
  border-radius: 5px;
  overflow-x: auto;
}
.ag-section-body code {
  display: block;
  white-space: pre;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 5px;
  line-height: 1.55;
}
[data-md-color-scheme="slate"] .ag-section-body code {
  background: #141e27;
  color: #c9d8e6;
}
[data-md-color-scheme="light"] .ag-section-body code,
[data-md-color-scheme="default"] .ag-section-body code {
  background: #eef1f5;
  color: #1e2a35;
}

/* --- Callouts --- */
.ag-callout {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 14px 0 6px;
  font-size: 0.92rem;
  line-height: 1.55;
  border-left: 4px solid;
}
.ag-callout-info {
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.1);
}
.ag-callout-warning {
  border-color: #f39c12;
  background: rgba(243, 156, 18, 0.1);
}
.ag-callout-critical {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.12);
}

/* --- Tables inside advanced guide --- */
.ag-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 0.9rem;
}
.ag-table th,
.ag-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.08);
}
[data-md-color-scheme="slate"] .ag-table th { background: rgba(255,255,255,0.06); }
[data-md-color-scheme="light"] .ag-table th,
[data-md-color-scheme="default"] .ag-table th { background: rgba(0,0,0,0.05); }

/* --- Checklist --- */
.ag-checklist {
  list-style: none;
  padding-left: 4px;
}
.ag-checklist li {
  padding: 4px 0;
  font-size: 0.92rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  #advanced-guide-panel {
    width: 99%;
    max-height: 94vh;
  }
  .ag-header { padding: 10px 14px; }
  .ag-body   { padding: 12px 14px 18px; }
  .ag-section-header { padding: 10px 12px; }
  .ag-section-body   { padding: 10px 12px 14px; }
  .btn-advanced-guide { font-size: 13px; padding: 7px 14px; }
}


/* ================================================================
   MITRE ATT&CK — compact floating info panel
   ================================================================ */

/* --- Trigger button --- */
.btn-mitre {
  background: linear-gradient(135deg, #1a3a6b, #3b82f6);
  color: #fff !important;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: all 0.25s ease;
  margin: 4px 6px 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-mitre:hover {
  background: linear-gradient(135deg, #1e4a8a, #60a5fa);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

/* --- Floating panel --- */
.mitre-panel {
  position: fixed;
  z-index: 2100;
  width: 494px;
  max-height: 546px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-6px);
  will-change: opacity, transform;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  font-size: 0.88rem;
}
.mitre-panel.mitre-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Colour scheme */
[data-md-color-scheme="slate"] .mitre-panel {
  background: #172230;
  color: #d4dce4;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
[data-md-color-scheme="light"] .mitre-panel,
[data-md-color-scheme="default"] .mitre-panel {
  background: #f0f4fa;
  color: #1e2a35;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* --- Header --- */
.mitre-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  flex-shrink: 0;
}
.mitre-title {
  font-weight: 700;
  font-size: 0.9rem;
}
.mitre-close {
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
  line-height: 1;
}
.mitre-close:hover { color: #ff4444; }

/* --- Scrollable body --- */
.mitre-body {
  padding: 10px 14px 14px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.mitre-desc {
  font-size: 0.84rem;
  opacity: 0.8;
  margin: 0 0 8px;
  line-height: 1.45;
}

/* --- Tactic groups --- */
.mitre-tactic-group {
  margin-bottom: 10px;
}
.mitre-tactic-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
  padding: 4px 8px;
  border-radius: 4px;
}
[data-md-color-scheme="slate"] .mitre-tactic-label {
  background: rgba(59, 130, 246, 0.1);
}
[data-md-color-scheme="light"] .mitre-tactic-label,
[data-md-color-scheme="default"] .mitre-tactic-label {
  background: rgba(59, 130, 246, 0.07);
}
.mitre-tactic-label a {
  color: #60a5fa;
  text-decoration: none;
}
.mitre-tactic-label a:hover {
  text-decoration: underline;
}

/* --- Technique list --- */
.mitre-technique-list {
  list-style: none;
  padding-left: 12px;
  margin: 4px 0 0;
}
.mitre-technique-list li {
  padding: 3px 0;
  font-size: 0.84rem;
  line-height: 1.45;
}
.mitre-technique-list li::before {
  content: '▸ ';
  color: #3b82f6;
  font-size: 0.7rem;
  margin-right: 2px;
}
.mitre-technique-list a {
  color: #60a5fa;
  text-decoration: none;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
}
.mitre-technique-list a:hover {
  text-decoration: underline;
}
.mitre-tech-desc {
  opacity: 0.7;
  font-size: 0.82rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .mitre-panel {
    width: 95vw;
    max-height: 60vh;
    left: 2.5vw !important;
  }
  .btn-mitre { font-size: 12px; padding: 5px 10px; }
}

/* Hide main heading (e.g. hide default title) */
.md-typeset h1 { display: none !important; }