/* ============================================================
   Webmap Voice Reader — Frontend Player CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ── */
.wvr-player {
  --wvr-radius:    16px;
  --wvr-font:      'DM Sans', sans-serif;
  --wvr-transition: 0.2s ease;
}

/* Dark theme (default) */
.wvr-player.wvr-theme-dark {
  --wvr-bg:         #111318;
  --wvr-border:     rgba(255,255,255,0.07);
  --wvr-text:       #e8eaf0;
  --wvr-text-muted: #778090;
  --wvr-accent:     #4f8ef7;
  --wvr-accent2:    #7b61ff;
  --wvr-progress-track: rgba(255,255,255,0.10);
  --wvr-select-bg:  #1c2030;
  --wvr-bar-color:  #4f8ef7;
}

/* Light theme */
.wvr-player.wvr-theme-light {
  --wvr-bg:         #ffffff;
  --wvr-border:     rgba(0,0,0,0.08);
  --wvr-text:       #1a1d2e;
  --wvr-text-muted: #7a829a;
  --wvr-accent:     #2563eb;
  --wvr-accent2:    #7c3aed;
  --wvr-progress-track: rgba(0,0,0,0.08);
  --wvr-select-bg:  #f4f6fb;
  --wvr-bar-color:  #2563eb;
}

/* ── Player wrapper ── */
.wvr-player {
  font-family: var(--wvr-font);
  background: var(--wvr-bg);
  border: 1px solid var(--wvr-border);
  border-radius: var(--wvr-radius);
  padding: 14px 18px;
  margin: 20px 0 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ── Inner layout — single row ── */
.wvr-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* ── Waveform ── */
.wvr-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  flex-shrink: 0;
}
.wvr-bar {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--wvr-bar-color);
  opacity: 0.3;
  transition: height 0.1s ease, opacity 0.1s ease;
}
.wvr-wave-active .wvr-bar {
  opacity: 1;
  animation: wvrWave 1s ease-in-out infinite alternate;
}
@keyframes wvrWave {
  0%   { height: 3px; }
  25%  { height: 16px; }
  50%  { height: 8px; }
  75%  { height: 20px; }
  100% { height: 5px; }
}

/* ── Label ── */
.wvr-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wvr-icon { font-size: 16px; line-height: 1; }
.wvr-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--wvr-text);
  white-space: nowrap;
}

/* ── Controls ── */
.wvr-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Circle play/pause/resume button */
.wvr-btn-circle {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: var(--wvr-accent) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: background 0.18s, transform 0.15s !important;
  flex-shrink: 0 !important;
}
.wvr-btn-circle:hover { background: var(--wvr-accent2) !important; transform: scale(1.08) !important; }
.wvr-btn-circle:active { transform: scale(0.95) !important; }
.wvr-btn-circle svg { width: 18px; height: 18px; }

/* Stop button */
.wvr-btn-stop {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: var(--wvr-text-muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.18s;
  flex-shrink: 0;
}
.wvr-btn-stop:hover { background: rgba(255,255,255,0.20); }
.wvr-btn-stop svg { width: 14px; height: 14px; }

/* ── Progress ── */
.wvr-progress-wrap {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wvr-progress-bar {
  height: 3px;
  background: var(--wvr-progress-track);
  border-radius: 99px;
  overflow: hidden;
}
.wvr-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wvr-accent), var(--wvr-accent2));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.wvr-status {
  font-size: 10px;
  color: var(--wvr-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Speed ── */
.wvr-speed-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.wvr-speed-label {
  font-size: 10px;
  color: var(--wvr-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wvr-speed-select {
  background: var(--wvr-select-bg);
  border: 1px solid var(--wvr-border);
  color: var(--wvr-text);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: var(--wvr-font);
  cursor: pointer;
  outline: none;
}

/* ── Language selector ── */
.wvr-lang-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.wvr-lang-icon { font-size: 14px; }
.wvr-lang-select {
  background: var(--wvr-select-bg);
  border: 1px solid var(--wvr-border);
  color: var(--wvr-text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--wvr-font);
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.wvr-lang-select:focus { border-color: var(--wvr-accent); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .wvr-inner { flex-wrap: wrap; gap: 8px; }
  .wvr-title { display: none; }
  .wvr-speed-label { display: none; }
  .wvr-progress-wrap { min-width: 60px; }
}

/* ── Flag Language Switcher [wvr_language] ── */
.wvr-flag-switcher {
  position: relative;
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
}
.wvr-dd-trigger {
display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px 7px 14px;
    background: #fff;
    border: 1.5px solid #e2e6f0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1a1d2e;
    line-height: 1;
    transition: border-color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    min-width: 90px;
}
.wvr-dd-trigger:hover, .wvr-dd-trigger:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  outline: none;
}
.wvr-dd-flag { font-size: 18px; line-height: 1; }
.wvr-dd-label { font-size: 13px; font-weight: 600; color: #1a1d2e; }
.wvr-dd-arrow { width: 10px; height: 6px; color: #7a829a; transition: transform 0.18s; flex-shrink: 0; }
.wvr-flag-switcher .wvr-dd-trigger[aria-expanded="true"] .wvr-dd-arrow { transform: rotate(180deg); }
.wvr-dd-menu {
  display: none;
   position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 91px;
    background: #fff;
    border: 1.5px solid #e2e6f0;
    border-radius: 7px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
    list-style: none;
    margin: 0;
    padding: 5px;
    z-index: 99999;
}
.wvr-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s;
  font-size: 13px;
  font-weight: 500;
  color: #1a1d2e;
}
.wvr-dd-item:hover { background: #f0f4ff; }
.wvr-dd-item.wvr-dd-active { background: #eff4ff; color: #2563eb; font-weight: 600; }
.wvr-dd-item-flag { font-size: 18px; line-height: 1; }
.wvr-dd-item-label { flex: 1; }

/* ── Single Pill Button [wvr_voice] ── */
.wvr-btn-only {
  display: inline-block;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.wvr-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px 10px 18px;
  border-radius: 99px;
  border: 2px solid #e2e6f0;
  background: #ffffff;
  color: #1a1d2e;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wvr-pill-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 4px 16px rgba(37,99,235,0.15);
  transform: translateY(-1px);
}
.wvr-pill-btn:active { transform: translateY(0); }
.wvr-pill-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
/* When playing — show filled blue style */
.wvr-player.wvr-is-playing .wvr-pill-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.30);
}
.wvr-player.wvr-is-paused .wvr-pill-btn {
  background: #f4f6fb;
  border-color: #2563eb;
  color: #2563eb;
}

/* ══════════════════════════════════════════
   PILL BUTTON  [wvr_voice]
   Matches Image 1: waveform ▐▐ ⏸ Pause ▐▐
   ══════════════════════════════════════════ */
.wvr-pill-only {
  display: inline-block;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 6px 0 !important;
}

.wvr-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 99px;
  border: 1.5px solid #d0d5e0;
  background: #ffffff;
  color: #1a1d2e;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  line-height: 1;
}
.wvr-pill:hover {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 3px 12px rgba(37,99,235,0.15);
}
.wvr-pill:active { transform: scale(0.97); }

/* Icon */
.wvr-pill-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.wvr-pill-icon svg { width: 17px; height: 17px; }

/* Label */
.wvr-pill-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Waveform bars inside pill */
.wvr-pill-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 16px;
  flex-shrink: 0;
}
.wvr-pill-wave span {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.35;
  transition: height 0.1s ease, opacity 0.1s ease;
}
/* Static heights — alternating short/tall */
.wvr-pill-wave span:nth-child(1) { height: 6px; }
.wvr-pill-wave span:nth-child(2) { height: 12px; }
.wvr-pill-wave span:nth-child(3) { height: 8px; }
.wvr-pill-wave span:nth-child(4) { height: 14px; }

/* Playing state — animate bars + fill button */
.wvr-pill-only.wvr-is-playing .wvr-pill {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.30);
}
.wvr-pill-only.wvr-is-playing .wvr-pill-wave span {
  opacity: 0.9;
  animation: wvrPillWave 0.8s ease-in-out infinite alternate;
}
.wvr-pill-only.wvr-is-playing .wvr-pill-wave span:nth-child(1) { animation-delay: 0s; }
.wvr-pill-only.wvr-is-playing .wvr-pill-wave span:nth-child(2) { animation-delay: 0.15s; }
.wvr-pill-only.wvr-is-playing .wvr-pill-wave span:nth-child(3) { animation-delay: 0.3s; }
.wvr-pill-only.wvr-is-playing .wvr-pill-wave span:nth-child(4) { animation-delay: 0.45s; }

@keyframes wvrPillWave {
  0%   { height: 4px; }
  50%  { height: 14px; }
  100% { height: 6px; }
}

/* Paused state */
.wvr-pill-only.wvr-is-paused .wvr-pill {
  border-color: #2563eb;
  color: #2563eb;
}
