/* ===== Üst uygulama çubuğu (app bar) ===== */
.app-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 6px 8px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  position: sticky;
  top: 8px;
  z-index: 20;
}
.app-bar-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  flex-wrap: nowrap;
}
.app-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: background .15s, color .15s, border-color .15s;
}
.app-tab:hover:not(:disabled) {
  color: var(--text);
  background: var(--card-soft);
}
.app-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.app-tab:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.app-tab-icon { font-size: 1.2rem; line-height: 1; }
.app-tab-label {
  display: block;
  font-size: .6rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: -.01em;
}

@media (max-width: 380px) {
  .app-tab-label { display: none; }
}

/* ===== Metni Sese Çevir (TTS) sayfası ===== */
.tts-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.tts-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
/* Koyu temaya uygun kaydırma çubuğu */
.tts-textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tts-textarea::-webkit-scrollbar { width: 10px; }
.tts-textarea::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.tts-textarea::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
  border: 2px solid var(--card-soft);
}
.tts-textarea::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.tts-counter {
  text-align: right;
  font-size: .8rem;
  color: var(--muted);
  margin: 4px 2px 0;
}

/* Ses seçim kartları */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.voice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, transform .1s;
}
.voice-card:hover { transform: translateY(-1px); }
.voice-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .35);
}
.voice-card .voice-name { font-weight: 600; }
.voice-card .voice-desc { font-size: .75rem; color: var(--muted); }

/* Hazır tonlama örnekleri (çipler) */
.tts-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tts-preset {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--muted);
  font-size: .82rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tts-preset:hover { color: var(--text); border-color: var(--primary); }
.tts-preset.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.tts-presets-hint {
  font-size: .78rem;
  color: var(--muted);
  margin: 8px 2px 0;
  line-height: 1.5;
}

/* Ses oynatıcı kutusu */
.tts-output {
  margin-top: 18px;
}
.tts-output.hidden { display: none; }
.tts-output audio { display: none; }

/* Modern özel oynatıcı */
.player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--card-soft), var(--card));
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}

/* Oynat / Duraklat butonu */
.player-play {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .45);
}
.player-play:hover { transform: scale(1.06); }
.player-play:active { transform: scale(.96); }
.player-play-icon { line-height: 1; letter-spacing: 1px; }

/* Orta gövde: seek + zaman */
.player-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-time {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Seek çubuğu (range input — tarayıcılar arası) */
.player-seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  cursor: pointer;
  outline: none;
}
.player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  transition: transform .1s;
}
.player-seek::-webkit-slider-thumb:hover { transform: scale(1.15); }
.player-seek::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}

/* İndirme ikon butonu */
.player-download {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.15rem;
  color: var(--text);
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: background .15s, color .15s, transform .12s;
}
.player-download:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.tts-error {
  color: var(--danger);
  margin-top: 10px;
  min-height: 1em;
}
