/* ==========================================================================
   DorukCRM — 08-theme.css
   Ayarlar › Tema ekranı: palet sekmeleri, renk grupları, kaydırıcılar, önizleme.

   SIRA ÖNEMLİ. Bu dosyalar tek bir app.css'ten bölündü ve kaskad hâlâ o
   sıraya bağlı: addaki sayı yüklenme sırasıdır. Sırayı belirleyen tek yer
   pages/_partials/styles.php.

   Parçalar 16 KB'ın ALTINDA tutuluyor ve bu ölçü keyfî değil: barındırmanın
   FTP yazması büyük dosyalarda 16384'ün katlarında kesiliyor, 91 KB'lık tek
   parça hâlindeki app.css bu yüzden günlerce sunucuya tam gidemedi. Buraya
   bölüm eklerken dosyayı büyütmek yerine yeni bir parça açın.
   ========================================================================== */

/* --- tema özellikleri ekranı ---------------------------------------------- */
/* Bu ekran kendi ayarladığı tokenların içinde yaşıyor: bir renk seçtiğinizde
   seçicinin kendisi de o renge göre yeniden çiziliyor. Bu yüzden aşağıda
   sabit renk yok, hepsi token. */

.theme-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.theme-mode {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "icon help";
  column-gap: .75rem;
  row-gap: .125rem;
  align-items: center;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.theme-mode:hover { border-color: var(--border-strong); }

.theme-mode--active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

/* Radyo düğmesi görsel olarak kaldırılıyor ama erişilebilirlik ağacında ve
   klavye sırasında kalıyor: display:none olsaydı ok tuşlarıyla mod
   değiştirilemezdi. */
.theme-mode input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-mode:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

.theme-mode__icon {
  grid-area: icon;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-muted);
}

.theme-mode__icon svg { width: 17px; height: 17px; }
.theme-mode--active .theme-mode__icon { background: var(--brand); color: #fff; }

.theme-mode__label { grid-area: label; font-weight: 600; font-size: .875rem; }
.theme-mode__help  { grid-area: help;  font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

/* --- açık/koyu palet sekmeleri -------------------------------------------- */

.theme-scheme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .1875rem;
  margin-bottom: .875rem;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
}

.theme-scheme-tab {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .75rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.theme-scheme-tab svg { width: 14px; height: 14px; }

.theme-scheme-tab--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Adlandırılmış temanın sekmesinde simge yerine kendi marka rengi duruyor:
   adı okumadan hangisinin hangisi olduğu görülebilsin. */
.theme-scheme-tab__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

.theme-scheme-tab--add { color: var(--brand); }
.theme-scheme-tab--add:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

/* Yalnızca adlandırılmış bir tema düzenlenirken görünür: adını değiştirme ve
   silme, çekirdek açık/koyu paletlerde yapılamayacak iki iş. */
.theme-preset-bar {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .875rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

/* --- renk grupları -------------------------------------------------------- */

.theme-group { margin-top: 1.5rem; }
.theme-group:first-of-type { margin-top: .5rem; }

.theme-group__head {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding-bottom: .75rem;
  margin-bottom: .875rem;
  border-bottom: 1px solid var(--border);
}

.theme-group__head > svg { width: 17px; height: 17px; color: var(--text-muted); margin-top: 2px; }
.theme-group__title { margin: 0; font-size: .875rem; }
.theme-group__help  { margin: .125rem 0 0; font-size: .75rem; color: var(--text-muted); line-height: 1.45; }

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .625rem;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* Değiştirilmiş bir token işaretli duruyor: "varsayılana dön" düğmesi
   hangilerinin geri alınacak bir şeyi olduğunu göstermeden anlamsız. */
.theme-swatch--changed { border-color: var(--brand); }

/* Tarayıcının renk seçicisi kendi çerçevesini ve iç boşluğunu çiziyor;
   ikisi de kaldırılmazsa kutu içinde küçük bir kare gibi duruyor. */
.theme-swatch__picker {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.theme-swatch__picker::-webkit-color-swatch-wrapper { padding: 2px; }
.theme-swatch__picker::-webkit-color-swatch { border: none; border-radius: calc(var(--radius-sm) - 2px); }
.theme-swatch__picker::-moz-color-swatch    { border: none; border-radius: calc(var(--radius-sm) - 2px); }

.theme-swatch__body { min-width: 0; flex: 1; }

.theme-swatch__label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.theme-swatch__hex {
  padding: .25rem .5rem;
  height: auto;
  font-size: .8125rem;
  text-transform: lowercase;
}

.input--invalid { border-color: var(--danger); }

.theme-swatch__reset {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}

.theme-swatch__reset svg { width: 15px; height: 15px; }
.theme-swatch__reset:hover { background: var(--surface-3); color: var(--text); }

/* --- ölçü kaydırıcıları --------------------------------------------------- */

.theme-range {
  width: 100%;
  margin: .375rem 0 0;
  accent-color: var(--brand);
}

.theme-range__value {
  float: right;
  font-weight: 400;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- önizleme ------------------------------------------------------------- */

.theme-preview {
  padding: 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.theme-preview__chat {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-top: .875rem;
  padding: .875rem;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.theme-preview__chat .bubble { max-width: 78%; margin: 0; }

/* Şablon gönderme paneli.
   Yalnızca 24 saatlik pencere kapalıyken açılır; kilitli composer'ın altında,
   onun yerine değil, çünkü kilidin GEREKÇESİ ekranda kalmalı. */
/* Değişken adları bu dosyanın geri kalanıyla aynı olmak zorunda: --space-4 ve
   --color-border hiçbir yerde tanımlı değil ve tanımsız bir var() yedeksiz
   kullanıldığında kuralın tamamı düşüyordu — panel dolgusuz ve çerçevesiz
   çiziliyordu. */
.composer-template {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.composer-template .field { margin-bottom: .75rem; }

.composer-locked__actions { margin-top: .75rem; }

