/* Form styling */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--surface-color);
  color: var(--text-color);
  font-family: var(--font-main);
}

.form-group textarea {
  font-family: var(--font-mono);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Base styles and reset */
:root {
  --primary-color: #333333;
  --primary-dark: #1a1a1a;
  --primary-light: #666666;
  --secondary-color: #f0f0f0;
  --surface-color: #ffffff;
  --border-color: #e0e0e0;
  --text-color: #333333;
  --text-light: #666666;
  --text-inverse: #ffffff;
  --error-color: #d32f2f;
  --warning-color: #f57c00;
  --success-color: #388e3c;
  --highlight-color: rgba(255, 255, 0, 0.2);
  --highlight-secret: rgba(211, 47, 47, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --radius: 0;
  /* Angular look */
  --header-height: 60px;
  --metadata-height: 50px;
  --footer-height: 40px;
  --resize-handle-height: 8px;
  --min-editor-height: 100px;
  --default-editor-height: 300px;
  --font-mono: 'Fira Code', 'IBM Plex Mono', 'Source Code Pro', monospace;
  --font-main: 'IBM Plex Sans', 'Roboto Mono', monospace;
  --hover-brightness: 0.9;
  --button-hover-bg: #e0e0e0;
}

/* Dark mode variables */
.dark-mode .cm-s-idea span.cm-property {
  color: #9cdcfe;
}

body.dark-mode .cm-s-idea span.cm-atom {
  color: #569cd6;
}

body.dark-mode .cm-s-idea span.cm-keyword {
  color: #569cd6;
}

body.dark-mode .cm-s-idea span.cm-operator {
  color: #d4d4d4;
}

body.dark-mode .cm-s-idea span.cm-variable {
  color: #9cdcfe;
}

body.dark-mode .cm-s-idea span.cm-variable-2 {
  color: #9cdcfe;
}

body.dark-mode .cm-s-idea span.cm-def {
  color: #dcdcaa;
}

body.dark-mode .cm-s-idea span.cm-tag {
  color: #569cd6;
}

body.dark-mode .cm-s-idea span.cm-bracket {
  color: #d4d4d4;
}

body.dark-mode .cm-s-idea span.cm-link {
  color: #569cd6;
}

body.dark-mode .CodeMirror .highlight-yellow {
  background-color: rgba(255, 255, 0, 0.3) !important;
  color: #ffffff !important;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

body.dark-mode .CodeMirror .highlight-red {
  background-color: rgba(255, 99, 99, 0.3) !important;
  color: #ffffff !important;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

/* Improved Dark Mode Button Styles */
body.dark-mode .btn {
  background-color: #333333;
  color: #ffffff;
  border-color: #444444;
}

body.dark-mode .btn:hover {
  background-color: #444444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .btn-primary {
  background-color: #2c5282;
  color: #ffffff !important;
  border-color: #2a4365;
}

body.dark-mode .btn-primary:hover {
  background-color: #2a4365;
  color: #ffffff !important;
}

body.dark-mode .github-btn {
  background-color: #333333;
  color: #ffffff !important;
  border-color: #444444;
}

body.dark-mode .github-btn:hover {
  background-color: #2c5282;
  color: #ffffff !important;
}

body.dark-mode .sponsor-btn {
  background-color: rgba(211, 47, 47, 0.2);
  color: #ff8080 !important;
  border-color: #d32f2f;
}

body.dark-mode .sponsor-btn:hover {
  background-color: #d32f2f;
  color: #ffffff !important;
}

body.dark-mode .btn-sm {
  background-color: #333333;
  color: #ffffff;
}

body.dark-mode .btn-sm:hover {
  background-color: #444444;
  color: #ffffff !important;
}

body.dark-mode .btn-icon {
  background-color: #333333;
  color: #ffffff;
  border-color: #444444;
}

body.dark-mode .btn-icon:hover {
  background-color: #444444;
}

/* Special styling for loadDefaultConfig button and theme toggle */
#loadDefaultConfigBtn {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  height: 32px;
  min-width: 150px;
}

#loadDefaultConfigBtn:hover {
  background-color: var(--button-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#toggle-theme-btn {
  background-color: var(--secondary-color);
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#toggle-theme-btn:hover {
  background-color: var(--button-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Logo switching styles */
.logo-light {
  display: block;
}

.logo-dark {
  display: none;
}

body.dark-mode .logo-light {
  display: none;
}

body.dark-mode .logo-dark {
  display: block;
}

/* Responsive styles */
@media (max-width: 768px) {
  .app-header {
    justify-content: center;
    flex-direction: column;
    height: auto;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .logo h1 {
    font-size: 1.0rem;
    font-weight: 600;
  }

  .page-title-link {
    font-size: 1.0rem;
    margin-left: 0.5rem;
  }

  .tabs {
    overflow-x: auto;
    padding: 0;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }

  .metadata-bar {
    padding: 0.3rem 0.5rem;
    height: auto;
    min-height: 30px;
    max-height: 40px;
    gap: 0.25rem;
  }

  .entropy-calc {
    width: 100%;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #logLevelSelect {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    min-width: 80px;
  }

  /* Ensure the scan tab content shows the editor by default */
  .app-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
  }

  .tab-content-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }

  .tab-content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .editor-container {
    min-height: 40px;
    max-height: 300px;
    overflow: auto;
  }

  .results-container {
    overflow: auto;
    flex: 1;
  }

  /* Fix table overflow on mobile */
  .table-wrapper {
    overflow-x: auto;
    width: 100%;
  }

  /* Adjust button sizes on mobile for better touch targets */
  .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .btn-primary {
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
  }

  .btn-icon {
    font-size: 0.75rem;
    padding: 0.5rem 0.5rem;
  }

  .entropy-warning {
    display: none;
  }

  .entropy-calc {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    flex: 1;
  }

  .entropy-calc input {
    flex: 1;
    padding: 0.375rem 0.75rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 0.75rem;
  }

  #entropyOutput {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Adjust resize handle for mobile */
  .resize-handle {
    height: 16px;
  }

  .notification {
    max-width: 90%;
    font-size: 0.875rem;
    bottom: 0.5rem;
    right: 0.5rem;
  }

  .share-modal-content {
    width: 95%;
    padding: 1rem;
  }

  .share-modal-content h3 {
    font-size: 1.1rem;
  }

  .share-modal input {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .char-counter {
    padding: 1px 4px;
    font-size: 0.7rem;
  }
}

/* Small screen adjustments */
@media (max-width: 480px) {
  .header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .logo h1 {
    font-size: 0.75rem;
    font-weight: 600;
  }

  .tabs {
    justify-content: space-between;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
  }

  /* Ensure CodeMirror editors display properly on mobile */
  .CodeMirror {
    height: 200px;
    font-size: 11px;
  }

  .CodeMirror-linenumber {
    font-size: 9px;
    padding: 0 3px 0 3px;
  }

  /* Adjust findings table for mobile */
  .findings-table th,
  .findings-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .findings-table pre {
    font-size: 0.75rem;
    max-width: 150px;
    overflow-x: auto;
  }

  /* Make sure we can see the code AND the results */
  .tab-content#scan-tab {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
  }

  /* Make action buttons more accessible */
  .results-toolbar .btn {
    padding: 0.4rem;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  /* Scan button smaller on mobile */
  #scanBtn {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  /* Compact metadata bar */
  .metadata-bar {
    padding: 0.3rem 0.5rem;
  }
}

.dark-mode {
  --primary-color: #444444;
  --primary-dark: #222222;
  --primary-light: #666666;
  --secondary-color: #2a2a2a;
  --surface-color: #1a1a1a;
  --border-color: #444444;
  --text-color: #eeeeee;
  --text-light: #aaaaaa;
  --text-inverse: #1a1a1a;
  --highlight-color: rgba(255, 255, 0, 0.3);
  --highlight-secret: rgba(255, 99, 99, 0.3);
  --hover-brightness: 1.1;
  --button-hover-bg: #444444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--surface-color);
}

/* Headings */
h2 {
  margin-bottom: 0px;
}

H1 {
  margin-bottom: 0px;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Links */
a:link {
  color: var(--text-color);
  text-decoration: none;
}

a:visited {
  color: var(--text-color);
}

.description a:link,
.app-main a:link {
  text-decoration: underline;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.app-header {
  height: var(--header-height);
  background-color: transparent;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
  margin-bottom: 1rem;
}

/* Logo link styling */
.logo-link {
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-link:hover {
  opacity: 0.9;
  text-decoration: none;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Page title link */
.page-title-link {
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--primary-color);
  margin-left: 1rem;
  font-weight: 500;
  display: inline-block;
}

.page-title-link:hover {
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .app-header {
    height: auto;
    padding: 0.75rem 1rem;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .logo {
    flex-grow: 1;
    justify-content: center;
  }

  .logo img {
    height: 32px;
  }

  .logo h1 {
    font-size: 1.25rem;
  }

  .page-title-link {
    font-size: 1.25rem;
    margin-left: 0.5rem;
  }

  .mobile-menu-toggle {
    font-size: 1.25rem;
    padding: 0.25rem;
    order: 2;
  }

  .header-actions {
    display: none;
  }
}

/* Main area */
.app-main {
  flex: 1;
  overflow: auto;
  position: relative;
  padding: 0 1rem;
}

/* Specific style for the playground app-main */
.playground-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Layout elements */
.center {
  text-align: center;
}

.bottom {
  text-align: center;
  bottom: 0;
}

.box {
  display: flex;
}

.box>div {
  padding-left: 10px;
  padding-bottom: 10px;
  padding-right: 10px;
  background-color: var(--secondary-color);
  margin: 10px;
  text-align: left;
}

/* Buttons */
.button {
  border-radius: var(--radius);
  background-image: linear-gradient(to top, rgb(207, 207, 207) 16%, rgb(252, 252, 252) 79%);
  padding: 4px;
  border: 1px solid #000;
  color: black;
  text-decoration: none;
}

body.dark-mode .button {
  background-image: linear-gradient(to top, rgb(70, 70, 70) 16%, rgb(100, 100, 100) 79%);
  color: #eeeeee;
  border: 1px solid #666;
}

button {
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  background-color: var(--secondary-color);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

button:hover {
  background-color: var(--button-hover-bg);
}

/* Enhanced buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  font-family: var(--font-main);
  background-color: var(--secondary-color);
  color: var(--text-color);
  min-width: 100px;
  height: 38px;
}

.btn:hover {
  background-color: var(--button-hover-bg);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  text-decoration: none;
  background-color: var(--primary-color);
  color: var(--text-inverse) !important;
  border: 1px solid var(--primary-dark);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--text-inverse) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-sm:hover {
  background-color: var(--button-hover-bg);
  color: var(--text-color) !important;
}

.btn-icon {
  padding: 0.375rem;
  color: var(--text-color);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background-color: var(--secondary-color);
}

.btn-icon:hover {
  background-color: var(--button-hover-bg);
}

.icon {
  margin-right: 0.25rem;
}

.blog-btn {
  background-color: rgba(70, 70, 70, 0.1);
  color: var(--text-color) !important;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.blog-btn:hover {
  background-color: var(--primary-color);
  color: var(--text-inverse) !important;
}

/* GitHub button styles */
.github-btn {
  background-color: rgba(70, 70, 70, 0.1);
  color: var(--text-color) !important;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
}

.github-btn:hover {
  background-color: var(--primary-color);
  color: var(--text-inverse) !important;
}

.github-stars {
  margin-left: 0.5rem;
  height: 20px;
}

body.dark-mode .github-stars {
  filter: brightness(0.8);
}

/* Mobile navigation */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-color);
  align-self: center;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 250px;
  background-color: var(--surface-color);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateX(100%);
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--text-color);
  text-decoration: none;
}

.mobile-nav-link:hover {
  background-color: var(--secondary-color);
}

.mobile-nav-link .icon {
  margin-right: 0.75rem;
}

@media (max-width: 768px) {
  .header-actions {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-nav {
    display: block;
  }

  .mobile-nav-overlay.active {
    display: block;
  }
}

/* Sponsor button styles */
.sponsor-btn {
  background-color: rgba(211, 47, 47, 0.1);
  color: var(--error-color) !important;
  border: 1px solid var(--error-color);
}

.sponsor-btn:hover {
  background-color: var(--error-color);
  color: white !important;
}

/* Tabs */
.tabs-container {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--surface-color);
  flex-shrink: 0;
}

.tabs {
  display: flex;
  padding: 0 1rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Dark mode tab styling */
body.dark-mode .tab-btn {
  color: #aaaaaa;
}

body.dark-mode .tab-btn:hover {
  color: #ffffff;
  background-color: #444444;
}

body.dark-mode .tab-btn.active {
  color: #ffffff;
  border-bottom-color: #4a9eff;
}

/* Metadata bar */
.metadata-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  gap: 1rem;
  height: var(--metadata-height);
  border-bottom: 1px solid var(--border-color);
}

.version-label {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--text-inverse);
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
}

.entropy-calc {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.entropy-calc input {
  flex: 1;
  max-width: 350px;
  padding: 0.375rem 0.75rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-color);
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

#entropyOutput {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.entropy-warning {
  color: var(--error-color);
  font-size: 0.75rem;
}

/* Tab content */
.tab-content-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-content {
  display: none;
  height: 100%;
  overflow: auto;
  padding: 1rem;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Editor container */
.editor-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Editor toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

/* Action bar */
.action-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  gap: 0.5rem;
}

/* Log level select dropdown */
#logLevelSelect {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--surface-color);
  color: var(--text-color);
  min-width: 100px;
  font-family: var(--font-main);
}

/* Results container */
.results-container {
  margin-top: 1rem;
  overflow: auto;
  flex: 1;
  min-height: 100px;
}

/* Resizable sections */
.resizable-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.editor-section {
  display: flex;
  flex-direction: column;
  height: var(--default-editor-height);
  min-height: var(--min-editor-height);
  overflow: hidden;
}

.resize-handle {
  height: var(--resize-handle-height);
  background-color: var(--secondary-color);
  cursor: ns-resize;
  position: relative;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

.resize-handle::before {
  content: "";
  width: 30px;
  height: 2px;
  background-color: var(--border-color);
  border-radius: 0;
}

.resize-handle:hover {
  background-color: var(--primary-light);
}

.resize-handle:hover::before {
  background-color: var(--text-inverse);
}

.results-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Rule wizard */
.wizard-form {
  overflow: auto;
  max-height: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.wizard-inputs {
  flex: 1;
  min-width: 0;
  /* Prevents flex items from overflowing their container */
}

.generated-rule-container {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.generated-rule-container label {
  margin-bottom: 0.5rem;
}

.rule-output-container {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rule-output-container textarea {
  width: 100%;
  height: 100%;
  resize: vertical;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  flex-grow: 1;
  min-height: 300px;
}

/* Mobile layout for the wizard */
@media (max-width: 768px) {
  .wizard-form {
    flex-direction: column;
    gap: 1rem;
  }

  .rule-output-container textarea {
    min-height: 150px;
  }
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--secondary-color);
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
}

.copy-btn:hover {
  background-color: var(--button-hover-bg);
}

/* Footer */
.app-footer {
  height: var(--footer-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.app-footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: '▼';
  font-size: 0.5rem;
  margin-left: 0.25rem;
  display: inline-block;
  vertical-align: middle;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin-top: 0.25rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.875rem;
}

.dropdown-menu a:hover {
  background-color: var(--secondary-color);
}

/* CodeMirror customization */
.CodeMirror {
  height: 100% !important;
  font-family: var(--font-mono) !important;
  font-size: 14px;
  line-height: 1.6;
}

/* Findings table */
.findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-family: var(--font-main);
}

.findings-table th {
  background-color: var(--secondary-color);
  padding: 0.75rem;
  text-align: left;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}

.findings-table th.asc::after {
  content: ' ↑';
}

.findings-table th.desc::after {
  content: ' ↓';
}

.findings-table td {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  vertical-align: top;
}

.findings-table tr:nth-child(even) {
  background-color: var(--secondary-color);
}

.findings-table tr:hover td {
  background-color: var(--secondary-color);
}

.findings-table pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background-color: var(--secondary-color);
  padding: 0.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Results toolbar */
.results-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

/* Highlight colors for CodeMirror */
.CodeMirror .highlight-yellow {
  background-color: var(--highlight-color) !important;
}

.CodeMirror .highlight-red {
  background-color: var(--highlight-secret) !important;
}

/* Error and status messages */
.error {
  color: var(--error-color);
  padding: 1rem;
  background-color: rgba(211, 47, 47, 0.1);
  border-radius: var(--radius);
  margin: 1rem 0;
}

.scan-stats {
  font-size: 0.875rem;
  margin: 1rem 0;
  line-height: 1.5;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Table wrapper */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

/* Share feature styles */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
}

.share-btn .icon {
  font-size: 1.2rem;
}

/* Modal dialog for share link */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.share-modal-content {
  background-color: var(--surface-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow);
}

.share-modal-content h3 {
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.share-modal input {
  width: 100%;
  padding: 0.75rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: var(--surface-color);
  color: var(--text-color);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Notification system */
.notification {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--primary-color);
  color: var(--text-inverse);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-error {
  background-color: var(--error-color);
}

.notification-processing {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.notification-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--surface-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-message {
  font-size: 1.2rem;
  color: var(--text-color);
  text-align: center;
  max-width: 80%;
}

/* Hide content during loading */
.content-loading .app-main,
.content-loading .tabs-container,
.content-loading .editor-section {
  visibility: hidden;
}

/* Character counter styles */
.char-counter {
  position: absolute;
  bottom: 0;
  right: 0;
  background-color: var(--secondary-color);
  padding: 2px 8px;
  font-size: 0.75rem;
  border-top-left-radius: var(--radius);
  border: 1px solid var(--border-color);
  border-right: none;
  border-bottom: none;
  color: var(--text-light);
  font-family: var(--font-mono);
  z-index: 5;
  user-select: none;
  transition: opacity 0.3s ease;
  opacity: 0.8;
}

.char-counter:hover {
  opacity: 1;
}

/* About section styling */
.about-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--surface-color);
  border-radius: var(--radius);
  padding: 2rem;
}

.about-section {
  margin-bottom: 2rem;
}

.about-section h2 {
  color: var(--text-color);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.about-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-section ul,
.about-section ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.about-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.about-section a {
  color: var(--primary-color);
  text-decoration: none;
}

.about-section a:hover {
  text-decoration: underline;
}

body.dark-mode .about-section a {
  color: #999;
}

/* Special cases for dark mode */
html.dark-mode-preload,
html.dark-mode-preload body {
  background-color: var(--surface-color);
  color: var(--text-color);
}

html.dark-mode-preload .app-header {
  background-color: transparent;
  color: var(--text-color);
  border-bottom: 1px solid #444444;
}

html.dark-mode-preload .btn-primary {
  background-color: #333333;
  color: #fff;
  border-color: #444444;
}

html.dark-mode-preload .btn-icon {
  color: var(--text-color);
}

/* Dark mode specific overrides for CodeMirror */
body.dark-mode .CodeMirror {
  background-color: var(--surface-color);
  color: #d4d4d4;
}

body.dark-mode .CodeMirror-gutters {
  background-color: var(--secondary-color);
  border-right: 1px solid var(--border-color);
}

body.dark-mode .CodeMirror-linenumber {
  color: #858585;
}

body.dark-mode .CodeMirror-cursor {
  border-left: 1px solid #ffffff !important;
  width: 2px !important;
}

@keyframes cursor-blink-dark {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

body.dark-mode .CodeMirror.cm-fat-cursor .CodeMirror-cursor,
body.dark-mode .CodeMirror .CodeMirror-cursor {
  animation: cursor-blink-dark 1.2s infinite;
}

body.dark-mode .CodeMirror-focused .CodeMirror-selected {
  background-color: rgba(102, 102, 102, 0.3) !important;
}

/* CodeMirror Syntax Highlighting for Dark Mode */
body.dark-mode .cm-s-idea span.cm-comment {
  color: #6A9955;
}

body.dark-mode .cm-s-idea span.cm-string,
body.dark-mode .cm-s-idea span.cm-string-2 {
  color: #ce9178;
}

body.dark-mode .cm-s-idea span.cm-number {
  color: #b5cea8;
}