:root {
  --bg-color: #0a0a0a;
  --phos-orange: #FFB84D;
  --phos-orange-dim: rgba(255, 184, 77, 0.4);
  --phos-orange-hover: #FFD180;
  --phos-yellow: #FFD500;
  --phos-yellow-bright: #FFEE66;
  --text-color: #ffffff;
  --text-dark: #000000;
  --border-radius: 6px;
  --font-main: 'Courier New', Courier, monospace;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* CRT & Scanline Effects */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(255, 184, 77, 0.05) 0%, rgba(0, 0, 0, 0.0) 100%);
  pointer-events: none;
  z-index: 100;
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.08)
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 101;
}

/* Layout */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.title-text-group {
  display: flex;
  flex-direction: column;
}

.subtitle {
  font-family: var(--font-body);
  color: var(--phos-orange-dim);
  font-size: 0.85rem;
  margin-top: 5px;
  max-width: 800px;
  line-height: 1.4;
}

.title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title-bar h1 {
  color: var(--phos-orange);
  font-size: 1.8rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 184, 77, 0.4);
  font-family: var(--font-main);
}

.info-btn {
  background: transparent;
  border: 1px solid var(--phos-orange-dim);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--phos-orange);
  cursor: pointer;
  transition: all 0.2s;
}

.info-btn:hover {
  background: rgba(255, 184, 77, 0.1);
  border-color: var(--phos-orange);
  box-shadow: 0 0 8px rgba(255, 184, 77, 0.4);
}

header.top-nav {
  margin-bottom: 15px;
}

.search-container {
  margin-bottom: 20px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--phos-orange-dim);
  pointer-events: none;
  transition: color 0.2s;
  z-index: 2;
}

.search-container:focus-within .search-icon {
  color: var(--phos-orange);
}

#global-search {
  width: 100%;
  background-color: rgba(255, 184, 77, 0.06);
  border: 2px solid var(--phos-orange-dim);
  border-bottom: 3px solid var(--phos-orange);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
  color: var(--phos-orange);
  font-family: var(--font-main);
  font-size: 1.5rem;
  padding: 12px 15px 12px 50px;
  border-radius: var(--border-radius);
  outline: none;
  text-transform: uppercase;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

#global-search::placeholder {
  color: var(--phos-orange-dim);
}

#global-search:focus {
  background-color: rgba(255, 184, 77, 0.12);
  border-color: var(--phos-orange);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 184, 77, 0.3);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid var(--phos-orange);
  padding-left: 10px;
}

.tab-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--phos-orange-dim);
  border-bottom: none;
  color: var(--phos-orange);
  font-family: var(--font-main);
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-size: 1rem;
  text-transform: uppercase;
  transition: all 0.2s ease-in-out;
  margin-bottom: -2px;
  position: relative;
  z-index: 1;
}

.tab-btn:hover {
  background-color: rgba(255, 184, 77, 0.15);
}

.push-right {
  margin-left: auto;
}

.tab-btn.active {
  background-color: var(--bg-color);
  border: 2px solid var(--phos-orange);
  border-bottom: 2px solid var(--bg-color);
  color: var(--phos-orange);
  font-weight: bold;
  z-index: 2;
}

.tab-explanation {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--phos-yellow);
  padding: 12px 15px;
  min-height: 48px;
  background-color: rgba(255, 184, 77, 0.05);
  border-bottom: 1px dashed var(--phos-orange-dim);
  margin-bottom: 20px;
  font-style: italic;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.content-window {
  flex: 1;
}

/* Section Dividers */
.section-title {
  font-family: var(--font-main);
  font-size: 1.1rem;
  margin: 20px 0 10px 0;
  color: var(--phos-yellow);
  border-bottom: 1px dashed var(--phos-orange-dim);
  padding-bottom: 5px;
}

.section-title:first-child {
  margin-top: 0;
}

.section-divider {
  height: 2px;
  background-color: var(--phos-orange-dim);
  margin: 25px 0;
  border-radius: 2px;
}

/* Footer */
.app-footer {
  font-family: var(--font-body);
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px dashed var(--phos-orange-dim);
  font-size: 0.8rem;
}

.app-footer a {
  color: var(--phos-orange-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.app-footer a:hover {
  color: var(--phos-orange-hover);
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Accordions */
.category-container {
  margin-bottom: 15px;
}

.accordion-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--phos-orange);
  color: var(--phos-orange);
  font-family: var(--font-main);
  padding: 12px 20px;
  cursor: pointer;
  border-radius: var(--border-radius);
  font-size: 1.2rem;
  text-align: left;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-btn:hover {
  background-color: var(--phos-orange-dim);
}

.accordion-icon {
  font-size: 1rem;
  transition: transform 0.2s;
}

.accordion-btn.expanded .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  display: none;
  padding: 15px;
  border: 1px solid var(--phos-orange-dim);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  background-color: rgba(255, 184, 77, 0.05);
  font-size: 0.85rem;
}

.accordion-content.expanded {
  display: block;
}

ul {
  list-style-type: none;
}

li {
  font-family: var(--font-body);
  margin-bottom: 10px;
  position: relative;
  padding-left: 20px;
  font-size: 0.85rem;
}

li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--phos-orange);
}

/* Search Results Layout */
.search-results-section {
  margin-bottom: 25px;
}

.search-results-section h2 {
  font-family: var(--font-main);
  font-size: 1.1rem;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--phos-orange-dim);
  padding-bottom: 5px;
}

/* Nested Details / Summary */
details.sub-accordion {
  margin-top: 5px;
  margin-bottom: 5px;
  padding-left: 0;
}
details.sub-accordion > summary {
  cursor: pointer;
  color: var(--phos-orange);
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  font-weight: bold;
  list-style: none; /* Hide default triangle in some browsers */
}
details.sub-accordion > summary::-webkit-details-marker {
  display: none;
}
details.sub-accordion > summary::before {
  content: '+ ';
}
details.sub-accordion[open] > summary::before {
  content: '- ';
}
ul.sub-list {
  margin-top: 5px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px dashed var(--phos-orange-dim);
}
ul.sub-list li {
  margin-bottom: 5px;
  font-size: 0.85rem;
}
ul.sub-list li::before {
  content: '-';
}

/* Keywords and Tooltips */
.keyword {
  text-decoration: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  color: var(--phos-yellow-bright);
  cursor: help;
  position: relative;
}

.tooltip {
  font-family: var(--font-body);
  position: absolute;
  background-color: var(--bg-color);
  border: 1px solid var(--phos-yellow);
  color: var(--phos-yellow);
  padding: 10px;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  z-index: 1000;
  max-width: 450px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.tooltip.hidden {
  display: none;
}

.tooltip h4 {
  font-family: var(--font-main);
  margin-bottom: 5px;
  border-bottom: 1px solid var(--phos-yellow);
  padding-bottom: 3px;
}

.tooltip ul {
  margin-top: 5px;
}

.tooltip li {
  margin-bottom: 5px;
  font-size: 0.85rem;
}

.tooltip li::before {
  content: '-';
  color: var(--phos-yellow);
}

/* Multi-column layout */
.grid-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start; /* Prevents rows from stretching */
}

@media (max-width: 768px) {
  .grid-columns {
    grid-template-columns: 1fr;
  }
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: var(--bg-color);
  border: 2px solid var(--phos-orange);
  border-radius: var(--border-radius);
  padding: 25px 30px;
  max-width: 600px;
  width: 90%;
  position: relative;
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.2);
  color: var(--text-color);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-content h2 {
  font-family: var(--font-main);
  color: var(--phos-yellow);
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--phos-orange-dim);
  padding-bottom: 10px;
  flex-shrink: 0;
}

.modal-body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-y: auto;
  padding-right: 10px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 184, 77, 0.05);
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--phos-orange-dim);
  border-radius: 4px;
}

.modal-body p {
  margin-bottom: 15px;
}

.modal-body strong {
  color: var(--phos-yellow);
}

.modal-close-x {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: var(--phos-orange-dim);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-x:hover {
  color: var(--phos-orange);
}

.modal-close-btn {
  display: block;
  margin: 30px auto 0;
  background: transparent;
  border: 2px solid var(--phos-orange);
  color: var(--phos-orange);
  padding: 10px 25px;
  font-family: var(--font-main);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: var(--phos-orange);
  color: var(--bg-color);
}

.search-tip-footer {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--phos-orange-dim);
  font-style: italic;
  margin-top: 40px;
  margin-bottom: -20px;
  padding: 0 20px;
}
