/* coralspeak Stüdyo — ortak tasarım dili (theme.css) üzerine kurulu panel.
   Beyaz zemin, ince dev başlıklar, buzlu cam kartlar, gökkuşağı saç çizgileri.
   Sınıf adları korundu: HTML'e dokunmadan görünüm yenilenir. */

/* Zemin her koşulda açık: tuval çizilmese bile panel kararmasın */
body { background: var(--wash); }

/* ------------------------------------------------------------------- giriş */

#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem; position: relative; z-index: 1;
}
.login-card {
  width: min(26rem, 100%); padding: 2.75rem;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-lg); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.07);
}
.login-card .wordmark { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.03em; display: block; margin-bottom: 0.4rem; text-decoration: none; color: var(--ink); }
.login-card .wordmark span { color: var(--c-blue); }
.login-card h1 { font-weight: 200; font-size: 1.6rem; letter-spacing: -0.02em; margin: 1.5rem 0 0.5rem; }
.login-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin-bottom: 1.75rem; }
#login-form { display: flex; flex-direction: column; gap: 0.7rem; }
.login-err { color: var(--bad); font-size: 0.85rem; min-height: 1.2em; }
.login-alt { margin-top: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.login-alt summary { cursor: pointer; }
.login-dev { display: flex; gap: 0.5rem; margin-top: 0.8rem; }

/* --------------------------------------------------------------- uygulama */

#app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

aside {
  width: 15.5rem; flex: none; padding: 2rem 1.25rem; display: flex; flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  position: sticky; top: 0; height: 100vh;
}
aside .wordmark {
  font-size: 1.4rem; font-weight: 500; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; padding: 0 0.75rem; margin-bottom: 2.5rem;
}
aside .wordmark span { color: var(--c-blue); }

aside nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
aside nav button, aside nav .nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border: none; border-radius: var(--r-pill);
  background: none; color: var(--muted); font-family: var(--sans); font-size: 0.92rem;
  text-align: left; text-decoration: none; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
aside nav button svg, aside nav .nav-link svg { width: 1.1rem; height: 1.1rem; flex: none; }
aside nav button:hover, aside nav .nav-link:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
aside nav button.active { background: var(--ink); color: #fff; }

.aside-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--line-soft);
  font-size: 0.82rem; color: var(--muted);
}
.aside-foot button {
  border: none; background: none; color: var(--muted); cursor: pointer;
  font-family: var(--sans); font-size: 0.82rem; text-decoration: underline;
}
.aside-foot button:hover { color: var(--ink); }

main { flex: 1; padding: 2.5rem 3rem 5rem; min-width: 0; }

.page { display: none; }
.page.active { display: block; animation: sayfaGir .45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sayfaGir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem;
  flex-wrap: wrap; margin-bottom: 2.25rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft);
}
.page-head h1 { font-weight: 200; font-size: max(1.9rem, 2.6vw); letter-spacing: -0.03em; line-height: 1.1; }
.page-head p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin-top: 0.5rem; max-width: 46rem; }

/* ------------------------------------------------------------------ kartlar */

.card {
  padding: 1.75rem; margin-bottom: 1.25rem; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.035);
}
.card h3 {
  font-size: 1.02rem; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.card h3 + .hint { margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row input, .row select { width: auto; flex: 1; min-width: 8rem; }
.inline-form input { width: auto; flex: 1; min-width: 10rem; }
.hint { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }
.hint code { background: rgba(0,0,0,0.05); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.92em; }

/* ------------------------------------------------------------- form alanları */

.fld { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; }
input, select, textarea {
  width: 100%;              /* kart içinde daralmasın (eski temada varsayılan genişti) */
  padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.75); color: var(--ink);
  font-family: var(--sans); font-size: 0.92rem; outline: none;
  transition: border-color .16s ease, background .16s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: #fff; }
textarea { resize: vertical; line-height: 1.55; }
select { cursor: pointer; }
label.check { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--ink); margin: 0.35rem 0; cursor: pointer; }
label.check input { width: 1rem; height: 1rem; accent-color: var(--ink); }
label.check small { color: var(--muted); }

/* sürgüler */
.slider-fld { margin-bottom: 1.4rem; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.5rem; }
.slider-top output { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 400; }
.slider-ends { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--faint); margin-top: 0.35rem; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 3px; padding: 0;
  background: linear-gradient(to right, var(--c-blue), var(--c-purple), var(--c-pink));
  border: none; border-radius: 2px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.05rem; height: 1.05rem; border-radius: 50%;
  background: var(--ink); border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.25); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--ink);
  border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.25); cursor: grab;
}

/* ------------------------------------------------------------------ listeler */

.list .item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem;
}
.list .item:last-child { border-bottom: none; }
.list .item .g { color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.list .item b { font-weight: 500; }
.list .item button {
  border: 1px solid transparent; background: none; color: var(--muted);
  font-family: var(--sans); font-size: 0.82rem; cursor: pointer;
  padding: 0.35rem 0.8rem; border-radius: var(--r-pill); transition: all .16s ease;
}
.list .item button:hover { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,0.7); }
.item-click { cursor: pointer; }

/* tablolar */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table th {
  text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--line);
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 400;
}
table td { padding: 0.85rem 0.6rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table tr:last-child td { border-bottom: none; }
table code { font-size: 0.78rem; background: rgba(0,0,0,0.04); padding: 0.25em 0.5em; border-radius: 4px; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.row-actions .btn { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ------------------------------------------------------------- ses kartları */

.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.voice-card {
  padding: 1.25rem; border-radius: var(--r-md); cursor: pointer;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.voice-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(0,0,0,0.07); }
.voice-top { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.voice-name { font-weight: 500; font-size: 0.98rem; }
.voice-meta, .voice-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
.voice-actions { display: flex; gap: 0.4rem; margin-top: 1rem; flex-wrap: wrap; }
.voice-filters { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* renkli ses "orb"u — gökkuşağı paletinden */
.orb { width: 2.25rem; height: 2.25rem; border-radius: 50%; flex: none; }

/* liste görünümü (Sesler) */
.vlist { display: flex; flex-direction: column; }
.vrow {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft);
}
.vrow:last-child { border-bottom: none; }
.vrow-main { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.vrow-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ rozetler */

.badge {
  display: inline-block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.15rem 0.55rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,0.6);
}
.tag { font-size: 0.75rem; color: var(--muted); }

/* Konuşma Üret: metin alanı kartın tamamını kaplasın, rahat yazılsın */
#preview-text {
  min-height: 9rem; font-size: 1.05rem; line-height: 1.6;
  border: none; background: none; padding: 0; resize: vertical;
}
#preview-text:focus { background: none; }
.char-row { justify-content: flex-end; font-size: 0.75rem; color: var(--faint);
            padding-top: 0.5rem; border-top: 1px solid var(--line-soft); margin-top: 0.75rem; }
.tts-bar { padding-top: 0.75rem; }

/* -------------------------------------------------------- bakiye / paketler */

/* Özet: referanstaki istatistik sütunu dili (ince dev sayı + küçük açıklama) */
#balance-summary { display: flex; gap: 3rem; flex-wrap: wrap; }
#balance-summary .stat-num { font-size: max(1.5rem, 2vw); white-space: nowrap; }

.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.pkg-card {
  padding: 1.5rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6);
  display: flex; flex-direction: column; gap: 0.35rem;
  transition: border-color .18s ease, transform .18s ease;
}
.pkg-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.pkg-name { font-size: 0.95rem; font-weight: 500; }
.pkg-desc { font-size: 0.78rem; color: var(--faint); }
.pkg-price { font-size: max(1.6rem, 2.1vw); font-weight: 200; letter-spacing: -0.03em; margin-top: 0.6rem; line-height: 1; }
.pkg-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }
.pkg-card .btn { margin-top: auto; }

/* --------------------------------------------------------------- oynatıcı */

.tts-grid { display: grid; grid-template-columns: 1fr 20rem; gap: 1.25rem; align-items: start; }
.tts-main { min-width: 0; }
.tts-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.player-row { display: flex; align-items: center; gap: 1rem; }
.play-btn {
  width: 3rem; height: 3rem; flex: none; border-radius: 50%;
  border: none; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .16s ease;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn:disabled { opacity: .45; cursor: wait; }
.wave-wrap { flex: 1; height: 2.75rem; min-width: 0; }
.wave-wrap canvas { width: 100%; height: 100%; display: block; }
.demo-time { font-size: 0.8rem; color: var(--faint); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- API kartı */

.api-card { }
.api-key-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.api-key-row code {
  flex: 1; min-width: 12rem; padding: 0.6rem 0.9rem; border-radius: var(--r-sm);
  background: rgba(0,0,0,0.04); font-size: 0.8rem; word-break: break-all;
}
.code-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
pre { background: #0d0d0f; color: #e9e7df; border-radius: var(--r-md); padding: 1.1rem 1.25rem; overflow-x: auto; font-size: 0.8rem; line-height: 1.6; }
pre code { background: none; color: inherit; padding: 0; }

/* --------------------------------------------------------------- grafikler */

.chart { width: 100%; }
.ch-line { fill: none; stroke: var(--c-blue); stroke-width: 2; }
.ch-dot { fill: var(--c-blue); }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; }
.ch-xtick, .ch-ytick { fill: var(--faint); font-size: 10px; }
.stat-row { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: 0.3rem; }
.stat b { font-size: max(1.6rem, 2.2vw); font-weight: 200; letter-spacing: -0.03em; line-height: 1; }
.stat span { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; margin: 0.4rem 0; }
.char-row { display: flex; align-items: center; gap: 0.6rem; }

/* kota çubuğu */
.quota-bar { height: 4px; border-radius: 2px; background: rgba(0,0,0,0.08); overflow: hidden; min-width: 6rem; }
.quota-bar > div { height: 100%; background: var(--rainbow); }
.quota-cell { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
#quota-badge { font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------------ diğer */

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ve-test-row, .ve-dene { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
#emotion-result { margin-top: 1rem; font-size: 0.9rem; }
#tel-info table { margin-top: 0.75rem; }
#usage-metric { max-width: 16rem; }

#toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translate(-50%, 5rem);
  padding: 0.85rem 1.5rem; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-size: 0.88rem;
  opacity: 0; transition: transform .3s cubic-bezier(0.2,0.8,0.2,1), opacity .3s ease;
  z-index: 999; pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

.brand-note {
  font-size: .68rem; line-height: 1.45; color: var(--faint);
  padding: 0 .75rem .9rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .9rem;
}

/* ------------------------------------------------------------------ mobil */

@media (max-width: 1000px) {
  .tts-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #app { flex-direction: column; }
  aside { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line-soft); padding: 1.25rem; }
  aside .wordmark { margin-bottom: 1rem; }
  aside nav { flex-direction: row; overflow-x: auto; gap: 0.35rem; }
  aside nav button, aside nav .nav-link { white-space: nowrap; }
  aside nav button svg, aside nav .nav-link svg { display: none; }
  main { padding: 1.5rem 1.25rem 4rem; }
}
