/* GelSöz extra features: history, favorites, review, speech speed, voice search */

/* ---------- Voice search button (inside the search bar) ---------- */
.dig-shell .gx-mic {
  background: none;
  color: var(--slate);
  border-radius: 50%;
  padding: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}
.dig-shell .gx-mic:hover { background: var(--line-soft); color: var(--paper); }
.dig-shell .gx-mic svg { width: 18px; height: 18px; }
.dig-shell .gx-mic.listening {
  color: #fff;
  background: var(--clay);
  animation: gx-pulse 1.2s ease-in-out infinite;
}
@keyframes gx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(193, 68, 58, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(193, 68, 58, 0); }
}

/* ---------- Favorite star ---------- */
.action-btn.gx-star.gx-on { color: var(--gold); border-color: var(--gold); }
.action-btn.gx-star.gx-on svg { fill: currentColor; }

/* ---------- Home: favorites & history ---------- */
.gx-home { width: 100%; max-width: 720px; margin: 8px auto 24px; }
.gx-home.gx-hidden { display: none !important; }
.gx-block { margin-bottom: 22px; }
.gx-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.gx-block-head .section-title { margin: 0; flex: 1 1 auto; }
.gx-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--slate);
  vertical-align: middle;
}
.gx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-fav-chips { max-height: 132px; overflow: hidden; }
.gx-home.gx-favs-open .gx-fav-chips { max-height: none; }
.gx-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  overflow: hidden;
}
.gx-chip a {
  color: var(--paper);
  text-decoration: none;
  padding: 6px 4px 6px 12px;
  font-size: 14px;
}
.gx-chip a:hover { color: var(--gold); }
.gx-chip-x {
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px 6px 6px;
}
.gx-chip-x:hover { color: var(--clay); }

.gx-btn {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--paper);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.gx-btn:hover { border-color: var(--gold); color: var(--gold); }
.gx-btn-primary { background: var(--clay); border-color: var(--clay); color: #fff; }
.gx-btn-primary:hover { background: #a83a31; border-color: #a83a31; color: #fff; }
.gx-link {
  background: none;
  border: none;
  color: var(--slate);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gx-link:hover { color: var(--gold); }

/* ---------- Review overlay ---------- */
.gx-review {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg, rgba(10,11,16,0.72));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1100;
}
.gx-review.show { display: flex; }
.gx-review-card {
  width: 100%;
  max-width: 560px;
  max-height: min(88vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.gx-review-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gx-review-top .modal-close { position: static; }
.gx-review-counts { display: flex; gap: 12px; font-family: ui-monospace, 'Roboto Mono', monospace; font-size: 14px; font-weight: 600; }
.gx-n { color: var(--tag-blue); }
.gx-l { color: var(--clay); }
.gx-r { color: #22a06b; }
.gx-review-body { overflow-y: auto; flex: 1 1 auto; padding: 8px 2px 16px; }
.gx-front { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px 0 8px; }
.gx-word { margin: 0; font-size: clamp(28px, 7vw, 40px); color: var(--paper); font-family: Georgia, 'Times New Roman', serif; text-align: center; }
.gx-back { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.gx-meanings { margin: 0; padding-left: 22px; color: var(--paper); line-height: 1.55; }
.gx-meanings li { margin-bottom: 10px; }
.gx-quote { color: var(--slate); font-style: italic; font-size: 14px; margin-top: 4px; }
.gx-muted { color: var(--slate); }
.gx-review-foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gx-review-foot .gx-wide, .gx-review-foot .gx-btn-primary:only-child { grid-column: 1 / -1; padding: 12px; font-size: 15px; }
.gx-rate { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; }
.gx-rate small { font-size: 11px; color: var(--slate); }
.gx-rate-1 { border-color: rgba(193, 68, 58, 0.5); }
.gx-rate-2 { border-color: rgba(201, 162, 75, 0.5); }
.gx-rate-3 { border-color: rgba(34, 160, 107, 0.5); }
.gx-rate-4 { border-color: rgba(96, 165, 250, 0.5); }
.gx-review kbd {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 4px;
  opacity: 0.6;
  margin-left: 4px;
}
.gx-done { text-align: center; padding: 28px 8px; color: var(--paper); }
.gx-done-big { font-size: 26px; font-family: Georgia, serif; color: var(--gold); margin-bottom: 8px; }
@media (hover: none) { .gx-review kbd { display: none; } }
@media (max-width: 420px) {
  .gx-review-foot { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Speech speed pill ---------- */
.gx-speed {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  color: var(--paper);
  font-size: 13px;
  z-index: 1200;
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0;
  pointer-events: none;
}
.gx-speed.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.gx-speed label { color: var(--slate); }
.gx-speed input { width: 130px; accent-color: var(--clay); }
.gx-speed output { min-width: 42px; font-family: ui-monospace, monospace; text-align: right; }

/* ---------- Toast ---------- */
.gx-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -150%);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 1300;
  transition: transform .25s ease;
  max-width: calc(100vw - 32px);
}
.gx-toast.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .gx-speed, .gx-toast { transition: none; }
  .dig-shell .gx-mic.listening { animation: none; }
}

/* let the input shrink so the mic + search button always fit on narrow phones */
.dig-shell input { min-width: 0; }

/* ---------- Offline word list (in the "Çevrimdışı Sözlük" panel) ---------- */
.btn-list { background: var(--ink); color: var(--paper); border: 1px solid var(--line); }
.btn-list:hover { border-color: var(--gold); color: var(--gold); }
.offline-list { margin-top: 14px; }
.offline-filter {
  width: 100%;
  box-sizing: border-box;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}
.offline-filter:focus { outline: none; border-color: var(--gold); }
.offline-list-info { font-size: 12.5px; color: var(--slate); margin: 8px 0; }
.offline-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.offline-words a {
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13.5px;
}
.offline-words a:hover { border-color: var(--gold); color: var(--gold); }
.offline-more { margin-top: 10px; }

.storage-actions + .cache-info { margin-top: 12px; font-size: 13px; color: var(--slate); }
