/**
 * Canlı Tema & Renk Değiştirici (Theme Switcher / Palette Customizer)
 * Müşteriye sunum için anlık renk değiştirme sistemi
 */

/* ================= YÜZEN TETİKLEYİCİ BUTON ================= */
.theme-switcher-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 9999;
  background: var(--primary, #2F5D50);
  color: #FFFFFF;
  border: none;
  border-radius: 14px 0 0 14px;
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: -4px 6px 20px rgba(0, 0, 0, 0.18);
  font-family: var(--font-heading, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.theme-switcher-toggle:hover {
  padding-left: 20px;
  box-shadow: -6px 8px 24px rgba(0, 0, 0, 0.25);
  background: var(--primary-hover, #24493F);
}

.theme-switcher-toggle .toggle-icon {
  font-size: 1.25rem;
  display: inline-flex;
  animation: spinSlow 8s linear infinite;
}

.theme-switcher-toggle:hover .toggle-icon {
  animation: spinFast 1.5s linear infinite;
}

.theme-switcher-toggle .toggle-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 1px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinFast {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ================= ARKA PLAN KARARTMASI ================= */
.theme-switcher-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.theme-switcher-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ================= YAN PANEL (DRAWER) ================= */
.theme-switcher-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10001;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-body, sans-serif);
  color: #1E293B;
}

.theme-switcher-panel.active {
  transform: translateX(0);
}

/* Panel Başlığı */
.theme-switcher-header {
  padding: 22px 24px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

.theme-switcher-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switcher-title i {
  font-size: 1.4rem;
  color: var(--primary, #2F5D50);
}

.theme-switcher-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #0F172A;
  font-family: var(--font-heading, sans-serif);
}

.theme-switcher-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.theme-switcher-close:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
  transform: rotate(90deg);
}

/* Panel İçeriği (Kaydırılabilir) */
.theme-switcher-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.theme-switcher-body::-webkit-scrollbar {
  width: 6px;
}
.theme-switcher-body::-webkit-scrollbar-track {
  background: #F1F5F9;
}
.theme-switcher-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* Bilgi Kartı */
.theme-info-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.theme-info-box i {
  color: #16A34A;
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.theme-info-box p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #166534;
  margin: 0;
}

/* Bölüm Başlıkları */
.theme-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748B;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-section-label .badge {
  background: #E2E8F0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
}

/* Palet Izgarası */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.palette-card {
  position: relative;
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.palette-card:hover {
  transform: translateY(-2px);
  border-color: #94A3B8;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.palette-card.active {
  border-color: var(--primary, #2F5D50);
  background: #FFFFFF;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.palette-card.active::after {
  content: '\eb7b'; /* ri-check-line remix icon */
  font-family: 'remixicon';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--primary, #2F5D50);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Renk Önizleme Daireleri */
.palette-preview {
  display: flex;
  align-items: center;
  gap: -6px;
}

.palette-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.palette-circle.accent {
  margin-left: -8px;
}

.palette-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1E293B;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-desc {
  font-size: 0.72rem;
  color: #64748B;
  margin: 0;
  line-height: 1.3;
}

/* ================= ÖZEL RENK SEÇİCİ ALANI ================= */
.custom-color-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
}

.color-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.color-input-row:last-child {
  margin-bottom: 0;
}

.color-input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  border: 1px solid #CBD5E1;
}

.color-picker-wrapper input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-hex-text {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

/* ================= PANEL ALT BUTONLARI ================= */
.theme-switcher-footer {
  padding: 16px 24px;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-btn-reset {
  width: 100%;
  padding: 11px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.theme-btn-reset:hover {
  background: #E2E8F0;
  color: #1E293B;
}

.theme-btn-copy {
  width: 100%;
  padding: 11px;
  background: var(--primary, #2F5D50);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.theme-btn-copy:hover {
  background: var(--primary-hover, #24493F);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Kopyalandı Bildirimi (Toast) */
.theme-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 100000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.theme-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
  .theme-switcher-toggle {
    top: auto;
    bottom: 90px;
    transform: none;
    padding: 10px 12px 10px 14px;
    border-radius: 12px 0 0 12px;
  }
  
  .theme-switcher-toggle .toggle-text {
    display: none;
  }

  .theme-switcher-panel {
    width: 100%;
    max-width: 100%;
  }

  .palette-grid {
    grid-template-columns: 1fr;
  }
}
