/* ══════════════════════════════════════════════════════════════════════
   COLOR-POP — native renk diyaloğunun yerine tema uyumlu portal panel
   ----------------------------------------------------------------------
   <input type="color"> işletim sisteminin renk diyaloğunu açar: sayfa
   temasıyla hiç ilgisi olmayan, ağır ve platforma göre bambaşka görünen
   bir pencere. Yerine sayfa içinde doygunluk/ton alanı, hex girişi,
   Discord rol paleti ve son kullanılan renkler.

   Alan öğesinin KENDİSİ tetikleyicidir — gizlenmez, sarmalanmaz; sayfalarda
   verilmiş inline width/height/border stilleri aynen kalır.
   ══════════════════════════════════════════════════════════════════════ */

/* Native swatch'ın iç dolgusunu kaldır ki renk kutunun tamamını doldursun */
input.colorpop-on { cursor: pointer; }
input.colorpop-on::-webkit-color-swatch-wrapper { padding: 0; }
input.colorpop-on::-webkit-color-swatch { border: none; border-radius: inherit; }

.colorpop {
  position: fixed;
  left: 0; top: 0;
  z-index: 2147482900;
  box-sizing: border-box;
  width: 244px;
  padding: 12px;
  border-radius: 14px;
  background: #1c1a30;                /* OPAK */
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.35);
  font-family: inherit;
  color: rgba(255,255,255,0.88);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
  user-select: none;
}
.colorpop.visible { opacity: 1; transform: none; }

/* Doygunluk / parlaklık alanı — arka plan rengi JS'ten (saf ton) gelir */
.colorpop-sv {
  position: relative;
  height: 132px;
  border-radius: 10px;
  cursor: crosshair;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
}
.colorpop-sv::before, .colorpop-sv::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
}
.colorpop-sv::before { background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.colorpop-sv::after  { background: linear-gradient(to top, #000, rgba(0,0,0,0)); }
.colorpop-knob {
  position: absolute; z-index: 2;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Ton şeridi */
.colorpop-hue {
  position: relative;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  cursor: ew-resize;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(to right,
    #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}
.colorpop-hue-knob {
  position: absolute; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.45);
  pointer-events: none;
}

.colorpop-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.colorpop-preview {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.colorpop-hex {
  flex: 1; min-width: 0; box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
  outline: none;
}
.colorpop-hex:focus { border-color: rgba(147,104,233,0.6); }

.colorpop-label {
  margin: 12px 0 6px;
  font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: rgba(255,255,255,0.42) !important;
}
.colorpop-swatches { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.colorpop-sw {
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
}
.colorpop-sw:hover { transform: scale(1.18); border-color: rgba(255,255,255,0.6); }
.colorpop-sw.sel { box-shadow: 0 0 0 2px #1c1a30, 0 0 0 3.5px rgb(147,104,233); }

.colorpop-foot { display: flex; gap: 6px; margin-top: 12px; }
.colorpop-btn {
  flex: 1; padding: 8px 10px; border-radius: 9px;
  font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.07) !important;
  color: rgba(255,255,255,0.85) !important;
  box-shadow: none !important; backdrop-filter: none !important; transform: none !important;
}
.colorpop-btn::after { display: none !important; }
.colorpop-btn:hover:not(.idx-slider-btn) { background: rgba(255,255,255,0.13) !important; transform: none !important; box-shadow: none !important; }
.colorpop-btn.primary, .colorpop-btn.primary:hover:not(.idx-slider-btn) {
  background: rgba(147,104,233,0.28) !important;
  border-color: rgba(147,104,233,0.55) !important;
  color: #e9e2ff !important;
}

/* ── AÇIK TEMA ─────────────────────────────────────────────────────── */
body.light-theme .colorpop {
  background: #ffffff;
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 18px 44px rgba(30,27,51,0.16), 0 2px 8px rgba(30,27,51,0.10);
  color: #1e293b;
}
body.light-theme .colorpop-sv,
body.light-theme .colorpop-hue { border-color: rgba(0,0,0,0.12); }
body.light-theme .colorpop-preview { border-color: rgba(0,0,0,0.14); }
body.light-theme .colorpop-hex { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); color: #1e293b; }
body.light-theme .colorpop-hex:focus { border-color: rgba(109,77,196,0.55); }
body.light-theme .colorpop-label { color: rgba(30,41,59,0.5) !important; }
body.light-theme .colorpop-sw { border-color: rgba(0,0,0,0.12); }
body.light-theme .colorpop-sw:hover { border-color: rgba(0,0,0,0.45); }
body.light-theme .colorpop-sw.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgb(109,77,196); }
body.light-theme .colorpop-btn {
  background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.12) !important; color: #1e293b !important;
}
body.light-theme .colorpop-btn:hover:not(.idx-slider-btn) { background: rgba(0,0,0,0.08) !important; }
body.light-theme .colorpop-btn.primary, body.light-theme .colorpop-btn.primary:hover:not(.idx-slider-btn) {
  background: rgba(109,77,196,0.16) !important; border-color: rgba(109,77,196,0.45) !important; color: #3b2a80 !important;
}

@media (prefers-reduced-motion: reduce) {
  .colorpop { transition: none; transform: none; }
  .colorpop-sw:hover { transform: none; }
}
