/* components.css — masthead, direction switch, tabs, translate + phrasebook. */

/* ---- Hazard stripe (signature element) ---- */
.hazard-bar {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg, var(--yellow) 0 22px, var(--asphalt) 22px 44px);
  border-bottom: 2px solid #000;
}

/* ---- Masthead ---- */
.masthead {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 2rem;
  background: var(--yellow);
  color: #000;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 2px #000;
  flex: none;
}
.brand-text h1 {
  font-weight: 800;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: .95;
  color: var(--dust);
  text-transform: uppercase;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--yellow);
  text-transform: uppercase;
  margin-top: 3px;
}
.tagline {
  margin-top: 10px;
  font-weight: 600;
  color: var(--dust);
  font-size: .95rem;
}
.tagline span { color: var(--dust-dim); font-style: italic; font-weight: 500; }

/* ---- Direction switch ---- */
.dir {
  max-width: 720px;
  margin: 4px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}
.dir-lane {
  background: var(--concrete);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex; flex-direction: column; justify-content: center;
}
.dir-lane--to { text-align: right; border-color: var(--orange); }
.dir-cap {
  font-family: var(--font-mono);
  font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dust-dim);
}
.dir-lane strong {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.35rem; line-height: 1;
  text-transform: uppercase;
}
.dir-lane--to strong { color: var(--orange); }
.swap {
  background: var(--yellow);
  color: #000;
  border-radius: var(--r-md);
  width: var(--tap);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px #000;
  transition: transform .25s ease;
}
.swap:hover { transform: rotate(180deg); }
.swap:active { transform: rotate(180deg) scale(.92); }
.swap-glyph { font-size: 1.6rem; font-weight: 800; }

/* ---- Tabs ---- */
.tabs {
  max-width: 720px;
  margin: 18px auto 14px;
  padding: 0 16px;
  display: flex; gap: 8px;
}
.tab {
  flex: 1;
  min-height: 46px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--dust-dim);
  background: var(--asphalt-2);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
}
.tab.is-active {
  color: #000;
  background: var(--yellow);
  border-color: var(--yellow);
}

/* ---- Panels ---- */
.panel { display: none; }
.panel.is-active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Translate ---- */
.tx-input-wrap {
  background: var(--asphalt-2);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-lg);
  padding: 14px;
}
#tx-input {
  width: 100%;
  background: transparent;
  border: none;
  resize: vertical;
  min-height: 84px;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--dust);
}
#tx-input::placeholder { color: var(--steel); }
.tx-input-tools {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.mic {
  min-height: var(--tap);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: var(--concrete);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
  font-weight: 600;
}
.mic-ic { font-size: 1.2rem; }
.mic.is-listening {
  background: var(--lime); color: #000; border-color: var(--lime);
  animation: pulse 1s infinite;
}
.mic.is-disabled { opacity: .4; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(182,227,0,.6);} 50% { box-shadow: 0 0 0 10px rgba(182,227,0,0);} }
.ghost {
  min-height: var(--tap);
  padding: 0 16px;
  color: var(--dust-dim);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
}
.go {
  margin-left: auto;
  min-height: var(--tap);
  padding: 0 22px;
  background: var(--orange);
  color: #000;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: .03em;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 2px #000;
}
.go:active { transform: translateY(1px); }

.tx-result {
  margin-top: 14px;
  background: linear-gradient(180deg, var(--concrete), var(--asphalt-2));
  border: 1px solid var(--orange);
  border-radius: var(--r-lg);
  padding: 16px;
  display: none;
}
.tx-result.is-shown { display: block; animation: fade .2s ease; }
.tx-output {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--yellow);
  min-height: 1.2em;
  word-break: break-word;
}
.tx-result-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
.tx-meta {
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .08em;
  color: var(--dust-dim); text-transform: uppercase;
}
.tx-result-actions { display: flex; gap: 8px; }

.hint {
  margin-top: 16px;
  color: var(--dust-dim);
  font-size: .9rem;
  border-left: 3px solid var(--yellow);
  padding-left: 12px;
}

/* ---- Icon buttons (speak/copy) ---- */
.icon-btn {
  position: relative;
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  font-size: 1.35rem;
  background: var(--concrete);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
}
.icon-btn:active { background: var(--concrete-2); }
.icon-btn.flashing::after {
  content: attr(data-flash);
  position: absolute; inset: auto auto 110%; left: 50%;
  transform: translateX(-50%);
  background: var(--lime); color: #000;
  font: 600 .7rem var(--font-mono);
  padding: 3px 8px; border-radius: var(--r-sm);
  white-space: nowrap;
}

/* ---- Phrasebook ---- */
.search-wrap { margin-bottom: 12px; }
#search {
  width: 100%;
  min-height: var(--tap);
  background: var(--asphalt-2);
  border: 1px solid var(--concrete-2);
  border-radius: var(--r-md);
  padding: 0 16px;
  font-size: 1.05rem;
}
.cat-rail {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 10px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 14px;
  background: var(--asphalt-2);
  border: 1px solid var(--concrete-2);
  border-radius: 999px;
  font-weight: 600; color: var(--dust);
  white-space: nowrap;
}
.chip-ic { font-size: 1.1rem; }
.chip.is-active {
  background: var(--yellow); color: #000; border-color: var(--yellow);
}

.phrase-heading {
  font-weight: 700; font-size: 1.1rem;
  color: var(--dust-dim);
  text-transform: uppercase; letter-spacing: .03em;
  margin: 8px 0 12px;
}
.phrase-list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--asphalt-2);
  border: 1px solid var(--concrete-2);
  border-left: 4px solid var(--orange);
  border-radius: var(--r-md);
  padding: 12px 12px 12px 14px;
}
.card-body { flex: 1; min-width: 0; }
.card-big {
  font-size: 1.35rem; font-weight: 700; line-height: 1.15;
  color: var(--dust);
}
.card-small {
  font-size: 1.1rem; font-weight: 600;
  color: var(--yellow); margin-top: 2px;
}
.card-ph {
  font-family: var(--font-mono);
  font-size: .8rem; color: var(--dust-dim); margin-top: 4px;
}
.card-actions { display: flex; flex-direction: column; gap: 8px; justify-content: center; }

.empty { color: var(--dust-dim); padding: 24px 4px; text-align: center; }

/* ---- Footer ---- */
.foot {
  max-width: 720px; margin: 0 auto; width: 100%;
  padding: 16px;
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  justify-content: space-between;
  border-top: 1px solid var(--concrete-2);
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .06em;
  color: var(--steel); text-transform: uppercase;
}

@media (max-width: 420px) {
  .go { margin-left: 0; flex: 1; }
  .tagline { font-size: .88rem; }
}
