/*
 * Theme: Trobz × OCA
 * Trobz brand  — warm dark backgrounds, orange accent (#ec7315)
 * OCA brand    — clean, professional, minimal
 */

:root {
  --bg: #14100d; /* Trobz warm dark */
  --bg-card: #1e1710; /* slightly lighter warm dark for cards */
  --bg-input: #251c14; /* input background */
  --border: #3a2e24; /* warm dark border */
  --accent: #ec7315; /* Trobz primary orange */
  --accent-h: #f4801f; /* orange hover */
  --text: #e8e0d8; /* warm off-white */
  --text-dim: #8c7a6a; /* warm muted text */
  --text-sub: #c4b8aa; /* purpose text */
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2.5rem 1.25rem;
}

main {
  width: 100%;
  max-width: 800px;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.field {
  margin-bottom: 0.75rem;
}

#filters-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
#filters-row .field {
  flex: 1;
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}
input:focus,
select:focus {
  border-color: var(--accent);
}
select {
  cursor: pointer;
}
select option {
  background: var(--bg-input);
}

button {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:not(:disabled):hover {
  background: var(--accent-h);
}

#status {
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner.hidden {
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#results {
  margin-top: 1.25rem;
}

.result {
  border-left: 3px solid var(--accent);
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
  transition:
    border-left-color 0.15s,
    background 0.15s;
}
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.result .name {
  font-weight: 600;
  font-size: 0.95rem;
}
a.result {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.result:hover {
  border-left-color: var(--accent-h);
  background: #261e14;
}
.result .score {
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.8;
}
.result .meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.result .purpose {
  font-size: 0.88rem;
  margin-top: 0.35rem;
  color: var(--text-sub);
}

#pagination {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-bottom: 2rem;
}
#pagination button {
  width: auto;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  margin: 0;
}
#page-info {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- Trobzer link (public page tagline) --- */
a.trobzer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
a.trobzer-link:hover {
  color: var(--accent-h);
}

/* --- nav link (fixed top-right) --- */
.nav-link { position: fixed; top: 1rem; right: 1.5rem; font-size: 0.82rem; color: var(--accent); text-decoration: none; white-space: nowrap; z-index: 10; }
.nav-link:hover { color: var(--accent-h); text-decoration: underline; }

/* --- Trobzer corner ribbon (private page) --- */
.ribbon {
  position: fixed;
  top: 28px;
  right: -38px;
  width: 160px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 8px 0;
  transform: rotate(45deg);
  transform-origin: center;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}
