/* Basic layout styles for YARA Playground */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
  background: #1e1e1e; /* dark theme */
  color: #e0e0e0;
}

/* Header */
header.app-header {
  padding: 0.5rem 1rem;
  background: #282c34;
  color: #61dafb;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
}

#app.yara-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.editors-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  box-sizing: border-box;
}

.editor-section {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
}

.editor-section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9cdcfe;
}

/* Header row with title + small controls (e.g. Text/File toggle) */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Adjust toggle container now that it sits inline */
.mode-toggle {
  display: flex;
  gap: 0.4rem;
  padding: 0;
}

.editor {
  flex: 1 1 auto;
  min-height: 240px;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

.controls {
  padding: 0 1rem 1rem;
}

.run-btn {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  background: #0e639c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.run-btn:hover:not(:disabled) {
  background: #1177bb;
}
.run-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.results-section {
  flex: none;
  padding: 0 1rem 1rem;
}

.results-section h2 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9cdcfe;
}

.results-pre {
  max-height: 300px;
  overflow: auto;
  background: #1e1e1e;
  color: #dcdcdc;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #333;
  font-family: monospace;
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .editors-wrap {
    flex-direction: column;
  }
}

/* Pretty results */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rule-card {
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem 1rem 1rem;
  background: #222;
}

.rule-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #4fc1ff;
}

.meta-list {
  margin: 0 0 0.5rem 0;
  padding-left: 1.2rem;
  font-size: 0.8rem;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.match-table th,
.match-table td {
  border: 1px solid #444;
  padding: 0.2rem 0.4rem;
  text-align: left;
}
.match-table th {
  background: #333;
}

.json-details {
  margin-top: 1rem;
}

.mode-btn {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #2d2d2d;
  color: #e0e0e0;
  cursor: pointer;
  user-select: none;
}
.mode-btn.active {
  background: #0e639c;
  border-color: #0e639c;
}

.file-select {
  border: 2px dashed #555;
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
  color: #aaa;
  cursor: pointer;
}
.file-info {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #ccc;
}

header.app-header .nav-right {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.about-link {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.about-link:hover {
  background: #0e639c;
}

.coffee-link {
  margin-left: 0.75rem;
  color: #ffe97d;
  background: #323232;
  padding: 0.25rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.coffee-link:hover {
  background: #ffdd55;
  color: #000;
  transform: translateY(-1px);
}

.app-title {
  font-weight: 600;
  color: #61dafb;
  text-decoration: none;
  margin-right: 1rem;
}
.app-title:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.faq-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}
.faq-section h2 {
  color: #9cdcfe;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.faq-section details {
  background: #222;
  border: 1px solid #333;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  padding: 0.6rem 1rem;
}
.faq-section summary {
  cursor: pointer;
  font-weight: 600;
  color: #61dafb;
}
