/* ==========================================================
   SIRE GLOBAL STYLE SHEET
   Used by: index.html, search.html, upload.html, concept.html, legal.html
   ========================================================== */

/* ROOT + GLOBAL */
:root {
  --bg: #050814;
  --bg-elevated: #0c1020;
  --bg-chip: #151a2c;
  --accent: #7f5af0;
  --accent-soft: rgba(127, 90, 240, 0.12);
  --accent-strong: rgba(127, 90, 240, 0.22);
  --accent-alt: #2cb67d;
  --danger: #ff6b6b;
  --text: #e4e7ff;
  --muted: #8a91b8;
  --border: #232743;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: radial-gradient(circle at top, #141b3f 0, #050814 55%, #000 100%);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-top: 10px;
}

header {
  margin-bottom: 20px;
}

/* APP TITLE / BADGE / SUBTITLE (used on search / upload / concept / legal) */
.app-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-title h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(127, 90, 240, 0.2), rgba(44, 182, 125, 0.2));
  border: 1px solid rgba(138, 145, 184, 0.4);
  color: var(--muted);
}

.badge span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* GENERIC GRID LAYOUT (search.html layout) */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  body {
    padding: 16px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* CARD BASE */
.card {
  background: radial-gradient(circle at top left, rgba(127, 90, 240, 0.25), transparent 45%),
              radial-gradient(circle at bottom right, rgba(44, 182, 125, 0.18), transparent 55%),
              var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(35, 39, 67, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-header h2 {
  margin: 0;
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #f5f5ff;
}

/* CHIPS */
.chip {
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 0.72rem;
  border: 1px solid rgba(138, 145, 184, 0.45);
  background: rgba(12, 16, 32, 0.9);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.chip-pill {
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.72rem;
  border: 1px solid rgba(127, 90, 240, 0.7);
  background: var(--accent-soft);
  color: var(--accent-alt);
}

.chip-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* FORM LAYOUT (search / upload) */
.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.6fr);
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .input-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.field {
  display: flex;
  flex-direction: column;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(4, 8, 22, 0.9);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(138, 145, 184, 0.6);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(127, 90, 240, 0.45);
  background: rgba(5, 10, 26, 0.98);
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.small-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.small-row .field {
  flex: 1;
  min-width: 120px;
}

.hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* BUTTONS + STATUS */
.btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary {
  border-radius: var(--radius-pill);
  border: 0;
  padding: 8px 18px;
  background: linear-gradient(130deg, var(--accent), #4b8cff);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.65);
  transform: translateY(0);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s ease;
  white-space: nowrap;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
}

.btn-ghost {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(138, 145, 184, 0.5);
  background: rgba(5, 8, 22, 0.8);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-ghost span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.status-line {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-alt);
  box-shadow: 0 0 10px rgba(44, 182, 125, 0.8);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.9);
}

.status-dot.idle {
  background: #555b7d;
  box-shadow: none;
}

/* RESULTS LAYOUT (search.html) */
.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 16px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.panel-title span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(180, 186, 230, 0.9);
}

.hits-container {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(38, 44, 78, 0.9);
  background: rgba(4, 8, 20, 0.9);
  max-height: 420px;
  overflow: auto;
  padding: 8px 8px 8px;
}

.hit-group {
  border-radius: 12px;
  padding: 8px 9px 6px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, rgba(127, 90, 240, 0.15), rgba(7, 13, 32, 0.95));
  border: 1px solid rgba(139, 111, 242, 0.55);
}

.hit-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.hit-domain {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #f4f3ff;
}

.hit-label {
  font-size: 0.72rem;
  color: var(--accent-alt);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hit-item {
  border-radius: 9px;
  padding: 6px 7px 4px;
  margin-top: 4px;
  background: rgba(3, 7, 20, 0.95);
  border: 1px solid rgba(39, 45, 77, 0.8);
}

.hit-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.hit-text {
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(228, 231, 255, 0.9);
  white-space: pre-wrap;
}

.pill-score {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(127, 90, 240, 0.7);
  background: rgba(15, 20, 42, 0.95);
  font-size: 0.68rem;
  color: rgba(193, 199, 255, 0.95);
}

.pill-meta {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(51, 57, 99, 0.8);
  background: rgba(5, 9, 24, 0.95);
  font-size: 0.68rem;
}

/* MONO BLOCKS (dendrogram, raw JSON, upload output) */
.mono-block {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(46, 52, 92, 0.9);
  background: radial-gradient(circle at top left, rgba(127, 90, 240, 0.18), transparent 50%),
              rgba(5, 8, 20, 0.96);
  padding: 8px;
  color: rgba(225, 228, 255, 0.9);
  max-height: 420px;
  overflow: auto;
  white-space: pre;
}

/* META GRID (router/meta panel) */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.meta-item {
  border-radius: 10px;
  border: 1px solid rgba(49, 56, 102, 0.9);
  background: rgba(7, 11, 26, 0.96);
  padding: 6px 8px;
  font-size: 0.78rem;
}

.meta-item strong {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

/* DETAILS BLOCKS */
details {
  margin-top: 6px;
  font-size: 0.78rem;
}

details summary {
  cursor: pointer;
  color: var(--muted);
}

details pre {
  margin-top: 6px;
  max-height: 320px;
  overflow: auto;
  background: rgba(4, 7, 16, 0.98);
  border-radius: 10px;
  padding: 8px;
  border: 1px solid rgba(46, 52, 92, 0.9);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: rgba(218, 222, 255, 0.95);
}

.fade {
  opacity: 0.58;
}

/* ==========================================================
   UNIVERSAL SIRE HEADER
   ========================================================== */

.sire-header {
  width: 100%;
  margin-bottom: 28px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(70, 80, 125, 0.4);
  backdrop-filter: blur(4px);
}

.sire-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sire-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sire-logo-orb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7f5af0, #3a1f80);
  box-shadow: 0 0 14px rgba(127, 90, 240, 0.8);
}

.sire-title {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.sire-title-main {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sire-title-sub {
  font-size: 0.72rem;
  color: #8a91b8;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Navigation */
.sire-nav {
  display: flex;
  gap: 18px;
}

.sire-nav-item {
  color: #e4e7ff;
  text-decoration: none;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: 0.15s ease;
  opacity: 0.7;
}

.sire-nav-item:hover {
  opacity: 1;
  background: rgba(127, 90, 240, 0.18);
  box-shadow: 0 0 10px rgba(127, 90, 240, 0.25);
}

.sire-nav-item.active {
  opacity: 1;
  color: #7f5af0;
  background: rgba(127,90,240,0.25);
  border: 1px solid rgba(127, 90, 240, 0.5);
  box-shadow: 0 0 10px rgba(127,90,240,0.4);
}

/* Mobile header */
@media (max-width: 700px) {
  .sire-header-inner {
    flex-direction: column;
    gap: 14px;
  }
  .sire-nav {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==========================================================
   HERO (index.html)
   ========================================================== */
.hero {
  margin-top: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.55;
}

.hero-sub-sub {
  font-size: 2rem;
  color: var(--muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.55;
}

.hero-buttons {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================
   FEATURE CARDS (index.html)
   ========================================================== */
.features {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

/* (card base already defined above) */

/* ==========================================================
   UNIVERSAL FOOTER
   ========================================================== */

.sire-footer {
  width: 100%;
  margin-top: 40px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(70, 80, 125, 0.4);
  background: rgba(5, 8, 22, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.sire-footer-text {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0.8;
}

.sire-footer-text span {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(127, 90, 240, 0.4);
}

.woi-link {
  text-decoration: none;
  font-weight: bold;
  font-size: large;
  color:#2cb67d;
}