/* Voice SEO Reader Pro v2.0 */
:root {
  --vsr-primary: #1a73e8;
  --vsr-bg: #ffffff;
  --vsr-border: #e8eaed;
  --vsr-text: #202124;
  --vsr-muted: #5f6368;
  --vsr-shadow: 0 4px 24px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.08);
  --vsr-panel-w: 292px;
}

/* ── Widget container ── */
.vsr-widget {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Square toggle button — no padding, flush top-right ── */
.vsr-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0 0 0 10px;   /* only bottom-left rounded */
  background: var(--vsr-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: -2px 2px 10px rgba(26,115,232,0.35);
  transition: background 0.18s, box-shadow 0.18s;
  outline: none;
}
.vsr-toggle:hover { background: #1557b0; }
.vsr-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.vsr-toggle.vsr-active { background: #0d47a1; }
.vsr-toggle.vsr-reading {
  animation: vsr-pulse 1.6s ease-in-out infinite;
}
@keyframes vsr-pulse {
  0%,100% { background: var(--vsr-primary); }
  50%      { background: #42a5f5; }
}

/* ── Panel ── */
.vsr-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: var(--vsr-panel-w);
  background: var(--vsr-bg);
  border-radius: 0 0 0 14px;
  box-shadow: var(--vsr-shadow);
  border: 1px solid var(--vsr-border);
  border-top: none;
  animation: vsr-open 0.22s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
@keyframes vsr-open {
  from { opacity:0; transform: translateY(-8px) scale(0.98); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.vsr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--vsr-primary);
  color: #fff;
}
.vsr-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.vsr-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.vsr-close:hover { color: #fff; }

/* ── Body ── */
.vsr-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }

/* ── Sections ── */
.vsr-section { display: flex; flex-direction: column; gap: 5px; }
.vsr-section-label { font-size: 11px; font-weight: 600; color: var(--vsr-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Google Translate override styling ── */
.goog-te-gadget-simple {
  width: 100% !important;
  border: 1px solid var(--vsr-border) !important;
  border-radius: 8px !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  background: #f8f9fa !important;
  cursor: pointer !important;
}
.goog-te-gadget-simple .goog-te-menu-value span { color: var(--vsr-text) !important; }
.goog-te-gadget-simple img { display: none !important; }
.goog-logo-link, .goog-te-gadget span { display: none !important; }
.vsr-translate-hint { font-size: 11px; color: #9aa0a6; }

/* Google Translate top banner — hide it (keeps translation active) */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }

/* ── Voice select ── */
.vsr-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--vsr-border);
  border-radius: 8px;
  font-size: 13px;
  background: #f8f9fa;
  color: var(--vsr-text);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.vsr-select:focus { border-color: var(--vsr-primary); }
.vsr-no-voice { font-size: 11px; color: #fbbc04; background:#fffde7; border-radius:6px; padding:4px 8px; }

/* ── Divider ── */
.vsr-divider { height: 1px; background: var(--vsr-border); margin: 0 -14px; }

/* ── Sliders ── */
.vsr-sliders { display: flex; flex-direction: column; gap: 6px; }
.vsr-slider-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.vsr-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}
.vsr-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--vsr-primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.vsr-val { font-size: 11px; color: var(--vsr-muted); width: 32px; text-align: right; flex-shrink: 0; }

/* ── Progress ── */
.vsr-progress { height: 4px; background: #e8eaed; border-radius: 4px; overflow: hidden; }
.vsr-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--vsr-primary), #42a5f5);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Status ── */
.vsr-status { font-size: 12px; color: var(--vsr-muted); text-align: center; min-height: 15px; }

/* ── Controls ── */
.vsr-controls { display: flex; gap: 6px; }
.vsr-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid var(--vsr-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  background: #f8f9fa;
  color: var(--vsr-text);
  transition: all 0.15s;
}
.vsr-btn:hover:not(:disabled) { background: #e8f0fe; border-color: var(--vsr-primary); color: var(--vsr-primary); }
.vsr-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.vsr-btn-primary { background: var(--vsr-primary); color: #fff; border-color: var(--vsr-primary); }
.vsr-btn-primary:hover:not(:disabled) { background: #1557b0; border-color: #1557b0; }
.vsr-btn-stop { color: #d93025; border-color: #d93025; }
.vsr-btn-stop:hover:not(:disabled) { background: #fce8e6; }

/* ── Keyboard hint ── */
.vsr-shortcuts { font-size: 10.5px; color: #bdc1c6; text-align: center; }

/* ── Click target on paragraphs ── */
.vsr-clickable { cursor: pointer; border-radius: 3px; transition: background 0.15s; }
.vsr-clickable:hover { background: rgba(26,115,232,0.06) !important; outline: 1px dashed rgba(26,115,232,0.25); outline-offset: 2px; }
.vsr-clickable:focus-visible { outline: 2px solid var(--vsr-primary); outline-offset: 2px; }

/* ── Active highlight ── */
.vsr-reading-highlight {
  background: #fff176 !important;
  border-radius: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vsr-toggle { animation: none !important; }
  .vsr-panel  { animation: none !important; }
}
