/* --- 1. CORE VARIABLES --- */
:root {
  --shaolin-red: #FF0000;
  --shaolin-black: #000000;
  --shaolin-gray: #1a1a1a;
  --text-dim: #888;
}

/* --- 2. BASE RESET --- */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background-color: var(--shaolin-black);
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav-bar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 65px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  background: rgba(0,0,0,0.95);
  border-bottom: 1px solid var(--shaolin-red);
  z-index: 1000;
  box-sizing: border-box;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  margin-left: 25px;
  font-size: 0.85rem;
  letter-spacing: 2px;
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--shaolin-red); }

/* Main Centerpiece (The 70-80% Zone) */
main {
  flex: 1;
  margin-top: 65px;
  margin-bottom: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

#about-card {
  width: 100%;
  max-width: 900px;
  background: var(--shaolin-gray);
  border: 1px solid #333;
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 50px rgba(0,0,0,1);
  position: relative;
}

/* Forced Dimensions Image Box */
.hero-strike-zone {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 1px solid var(--shaolin-red);
  overflow: hidden;
}

#hero-featured-img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--shaolin-red));
}

h1 {
  color: var(--shaolin-red);
  font-size: 1.6rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 25px;
}

.description {
  color: #ccc;
  line-height: 1.8;
  font-size: 1rem;
  text-align: left;
  margin-bottom: 40px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 15px;
}

.cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: transparent;
  color: var(--shaolin-red);
  border: 2px solid var(--shaolin-red);
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 3px;
  transition: all 0.3s;
}

.cta-button:hover {
  background: var(--shaolin-red);
  color: #000;
  box-shadow: 0 0 20px var(--shaolin-red);
}

/* Footer */
.main-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 60px;
  background: #050505;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-top: 1px solid #222;
  z-index: 1000;
}

.footer-text { font-size: 0.7rem; color: #555; margin-bottom: 5px; }
.footer-links a { color: #444; text-decoration: none; margin: 0 10px; font-size: 0.65rem; }
.footer-links a:hover { color: var(--shaolin-red); }

@media (max-width: 768px) {
  #about-card { padding: 20px; }
  h1 { font-size: 1.2rem; }
  .nav-links { display: none; } /* Simplified for mobile strike */
}

#service-rail-wrapper {
  max-width: 900px;
  margin: 40px auto;
  width: 100%;
}

.rail-header {
  color: var(--shaolin-red);
  font-size: 0.9rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  border-left: 3px solid var(--shaolin-red);
  padding-left: 15px;
}

#command-center {
  width: 100%;
  max-width: 1000px; /* Slightly wider to let the rail breathe */
  display: flex;
  flex-direction: column;
  gap: 40px;
}

#about-card {
  background: var(--shaolin-gray);
  border: 1px solid #333;
  padding: 40px;
  text-align: center;
}

#service-rail {
  display: flex; /* Forces side-by-side */
  flex-wrap: nowrap; /* Prevents stacking/wrapping */
  overflow-x: auto; /* Enables the slide */
  gap: 20px;
  padding-bottom: 15px;
  scroll-snap-type: x mandatory;
}

/* Ensure the cards themselves don't shrink to fit the screen */
.service-preview-card {
  flex: 0 0 300px; /* 0 shrink, 0 grow, 300px base width */
  background: #111;
  border: 1px solid #222;
  padding: 20px;
  scroll-snap-align: start;
}

.service-preview-card:hover {
  border-color: var(--shaolin-red);
}

.service-preview-card h3 {
  color: #fff;
  font-size: 1rem;
  margin-top: 0;
}

.service-preview-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}

#service-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.card-img-container {
  width: 100%;
  height: 120px;
  background: #000;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #222;
}

.card-img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-transition {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Scrollbar styling for the legal area */
.legal-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.legal-scroll-area::-webkit-scrollbar-track {
  background: #000;
}
.legal-scroll-area::-webkit-scrollbar-thumb {
  background: var(--shaolin-red);
}

.triage-option:hover {
  border-color: var(--shaolin-red) !important;
  background: #161616 !important;
  transform: translateX(5px);
}

/* TRIAGE & DETAIL VIEW STYLING */
#about-card {
  transition: opacity 0.3s ease-in-out;
}

.view-transition {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  text-align: left;
}

.detail-col h4.label, 
.legal-shield-box h4.label {
  color: var(--shaolin-red);
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.detail-col p, .detail-col li {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.6;
}

.legal-shield-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--shaolin-red);
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.legal-shield-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: #888;
}

.legal-shield-box li {
  margin-bottom: 0.5rem;
}

.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.back-link {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--shaolin-red);
}

/* Responsive adjustment for small screens */
@media (max-width: 600px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* The Tactical Loading Shield */
#loading-shield {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: #ff0000; /* Shaolin Red */
    z-index: 10000;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    letter-spacing: 5px;
    font-weight: bold;
}

/* Smooth View Transitions */
.view-transition {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ensure the Service Rail cards look like triggers */
.service-preview-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.service-preview-card:hover {
    border-color: #ff0000;
    transform: scale(1.02);
}


/* Bibliography */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.references-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    border-top: 1px solid #222;
}

.apa7-citation {
    padding-left: 2em;
    text-indent: -2em;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #999;
    line-height: 1.4;
}

.apa7-citation em {
    color: #eee;
}

/* Blog Post and Typography */
.blog-post h1, .blog-post h2 {
    color: var(--shaolin-red);
    text-transform: uppercase;
    margin-top: 1.5rem;
}

.blog-post p {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 1.2rem;
}

.blog-post blockquote {
    border-left: 3px solid var(--shaolin-red);
    padding-left: 20px;
    font-style: italic;
    background: #111;
    margin: 20px 0;
}

.blog-post code {
    background: #222;
    color: #fff;
    padding: 2px 5px;
    font-family: 'Courier New', monospace;
}

.post-content {
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

#blog-search::placeholder {
    color: #444;
    letter-spacing: 2px;
    font-size: 0.7rem;
}

#blog-search:focus {
    border-color: var(--shaolin-red);
    box-shadow: 0 0 10px rgba(255, 62, 62, 0.1);
}

.sds-evolution-note {
    color: var(--shaolin-red);
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 2px;
    border: 1px solid var(--shaolin-red);
    padding: 2px 6px;
    margin-right: 10px;
    display: inline-block;
}

/* --- BLOG SEARCH & GRID OPTIMIZATION --- */

.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

#blog-search {
    width: 100%;
    background: transparent;
    border: none;
    border-left: 3px solid var(--shaolin-red); /* Visual indicator of active input */
    padding: 15px 20px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
}

#blog-search:focus {
    background: #0a0a0a;
    border-left-width: 8px; /* Kinetic feedback on focus */
    outline: none;
}

/* Tag visualization inside the cards */
.blog-card .tag-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.blog-tag {
    font-size: 0.65rem;
    color: var(--shaolin-red);
    border: 1px solid #333;
    padding: 2px 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: #050505;
}

/* Ensure the grid handles the search results cleanly */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    animation: fadeIn 0.5s ease;
}

/* Ensure the 'Classified information...' excerpt doesn't look like an error */
.blog-card p {
    font-style: italic;
    opacity: 0.7;
}


/* TRIAGE / FAQ Container */
.triage-base {
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    color: #fff;
    font-family: 'Inter', sans-serif; /* Or your preferred sans-serif */
}

/* Category Headers - Strategic Intelligence */
.faq-category {
    color: var(--shaolin-red, #FF0000);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin: 40px 0 20px 0;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

/* The Strike Item */
.faq-item {
    border-bottom: 1px solid #111;
    transition: all 0.3s ease;
}

/* Question - The Trigger */
.faq-question {
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    color: #ccc;
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

/* The Eye-Glow Effect on Active/Hover */
.faq-question:hover, 
.faq-item.active .faq-question {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.faq-question::after {
    content: '+';
    color: var(--shaolin-red, #FF0000);
    font-family: monospace;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
    content: '+'; /* Turns into an X strike */
}

/* Answer - The Extraction */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: #050505;
}

.faq-answer-inner {
    padding: 0 0 25px 0;
    color: #888;
    line-height: 1.6;
    font-size: 1rem;
    border-left: 2px solid var(--shaolin-red, #FF0000);
    padding-left: 20px;
    margin-left: 5px;
}

.faq-answer b {
    color: #eee;
}

/* =========================================================
   DIAGNOSTIC TRIAGE UI (SPA OVERRIDES)
   ========================================================= */

.triage-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}

/* Service Preview Cards */
.service-preview-card {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-preview-card:hover {
    border-color: var(--shaolin-red);
    background: #111;
    transform: translateX(5px);
}

.service-preview-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 1px;
}

.service-preview-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Diagnostic Inputs */
.diag-input {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 12px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    box-sizing: border-box;
}

.diag-input:focus {
    outline: none;
    border-color: var(--shaolin-red);
}

textarea.diag-input {
    min-height: 100px;
    resize: vertical;
}

/* Transitions */
.view-transition {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Labels for the Triage */
.triage-shell .label {
    display: block;
    font-size: 0.7rem;
    color: var(--shaolin-red);
    letter-spacing: 3px;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Triage Telemetry & Plane Indicators */
.triage-telemetry {
    margin-top: 20px;
    height: 10px;
    background: #111;
    border: 1px solid #333;
    position: relative;
}
.telemetry-bar {
    height: 100%;
    transition: width 0.4s ease-in-out;
}
.status-code {
    color: var(--shaolin-red);
    font-size: 0.7rem;
    font-weight: bold;
}
.plane-indicator {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
}

/* =========================================================
   SDS_SOVEREIGN_PARSER_STYLES
   High-Contrast Forensic UI for Markdown & LaTeX
   ========================================================= */

/* 1. Ticker Highlighting: $AAPL, $TSLA */
.sds-ticker {
    color: var(--shaolin-red);
    font-weight: bold;
    background: rgba(255, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    letter-spacing: 1px;
}

/* 2. Tactical Table Multipliers */
.sds-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid var(--border-dim);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-transform: uppercase;
}

td, th {
    padding: 12px 15px;
    border: 1px solid var(--border-dim);
    text-align: left;
}

tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

tr:hover {
    background: rgba(255, 0, 0, 0.05);
}

/* 3. LaTeX Math Container */
.sds-math-block {
    display: block;
    padding: 20px;
    margin: 20px 0;
    background: #000;
    border-left: 3px solid var(--shaolin-red);
    overflow-x: auto;
    font-family: serif; /* Better for Math characters */
}

.sds-math-inline {
    padding: 0 4px;
    color: #eee;
}

/* 4. Surgical Call-to-Action (CTA) */
.sds-cta-button {
    display: inline-block;
    background: var(--shaolin-red);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 20px 0;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sds-cta-button:hover {
    background: transparent;
    border: 1px solid var(--shaolin-red);
    color: var(--shaolin-red);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* 5. Logic Blocks (Markdown formatting) */
h2, h3 {
    color: #fff;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 8px;
    margin-top: 40px;
    letter-spacing: 2px;
}

code {
    background: #1a1a1a;
    color: var(--shaolin-red);
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
}
