/* =====================================================================
   fixes.css — round 4 (final polish)
   - Purple-filled checkboxes (white tick)
   - Radios show a circled checkmark when selected
   - Edit profile horizontal multi-column layout
   - Background effects on edit page
   - More cursor effects + smoothing
   - Numeric px input next to username size slider
   - Username + bio extra animations
   - Hidden remove buttons after content removal
   ===================================================================== */

/* ---------- 1) PURPLE checked checkboxes (was white) -------------- */
input[type="checkbox"]:not(.nativeCheck):checked,
.toggleLabel input[type="checkbox"]:checked,
.field input[type="checkbox"]:checked,
.signupExtras input[type="checkbox"]:checked,
.discordToggleGrid input[type="checkbox"]:checked,
.checkbox input[type="checkbox"]:checked {
  background: #a78bfa !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.35), 0 0 12px -2px rgba(167,139,250,0.6) !important;
}

/* WHITE checkmark (override the dark one from enhancements3.css) */
input[type="checkbox"]:not(.nativeCheck):checked::before,
.toggleLabel input[type="checkbox"]:checked::before,
.field input[type="checkbox"]:checked::before,
.signupExtras input[type="checkbox"]:checked::before,
.discordToggleGrid input[type="checkbox"]:checked::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") !important;
}

/* Also override style.css legacy ::after dark check */
input[type="checkbox"]:not(.nativeCheck):checked::after,
.toggleLabel input[type="checkbox"]:checked::after,
.checkLabel input[type="checkbox"]:checked::after {
  display: none !important;
}

/* ---------- 2) RADIO buttons: circled checkmark when selected ---- */
input[type="radio"]:not(.nativeCheck),
.toggleLabel input[type="radio"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border: 1.5px solid rgba(255,255,255,0.35) !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.05) !important;
  position: relative !important;
  cursor: pointer !important;
  display: inline-grid !important;
  place-content: center !important;
  vertical-align: middle !important;
  flex: 0 0 20px !important;
  margin: 0 8px 0 0 !important;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 200ms ease;
}
input[type="radio"]:not(.nativeCheck):hover,
.toggleLabel input[type="radio"]:hover {
  border-color: rgba(167,139,250,0.65) !important;
  background: rgba(167,139,250,0.10) !important;
}
input[type="radio"]:not(.nativeCheck):checked,
.toggleLabel input[type="radio"]:checked {
  background: #a78bfa !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 1px rgba(167,139,250,0.35), 0 0 12px -2px rgba(167,139,250,0.6) !important;
}
/* Kill any old dot inside radio */
input[type="radio"]:not(.nativeCheck)::after,
.toggleLabel input[type="radio"]::after {
  display: none !important;
}
/* Inject a checkmark via ::before on radios */
input[type="radio"]:not(.nativeCheck)::before,
.toggleLabel input[type="radio"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 80% 80%;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(0);
  opacity: 0;
  transition: transform 160ms cubic-bezier(.34,1.56,.64,1), opacity 120ms ease;
}
input[type="radio"]:not(.nativeCheck):checked::before,
.toggleLabel input[type="radio"]:checked::before {
  transform: scale(1);
  opacity: 1;
}

/* ---------- 3) Horizontal/multi-column edit profile layout -------- */
@media (min-width: 980px) {
  #view-edit .editCard {
    max-width: 1180px !important;
  }
  /* Side tabs layout: tabs vertical on left, content area on right */
  #view-edit .editCard[data-tabbed="1"] {
    display: grid !important;
    grid-template-columns: 200px 1fr;
    gap: 22px;
    align-items: start;
  }
  #view-edit .editCard[data-tabbed="1"] > h2,
  #view-edit .editCard[data-tabbed="1"] > h3,
  #view-edit .editCard[data-tabbed="1"] > .editHead {
    grid-column: 1 / -1;
  }
  #view-edit .editCard[data-tabbed="1"] .editTabsBar {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    position: sticky;
    top: 12px;
    align-self: start;
    padding: 10px !important;
  }
  #view-edit .editCard[data-tabbed="1"] .editTabsBar button {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    text-align: left;
  }
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] {
    grid-column: 2;
  }
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab].active {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
    align-items: start;
  }
  /* Full-width cells for textareas, big previews, controls */
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] textarea,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .fieldGridTwo,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .connectionsGrid,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .discordToggleGrid,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .textPreview,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] #discordVerifyBox,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] #discordSyncCardV2,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .fullSpan,
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .posControls {
    grid-column: 1 / -1;
  }
  /* Bio (textarea field) takes full row */
  #view-edit .editCard[data-tabbed="1"] [data-edit-tab] .field:has(textarea) {
    grid-column: 1 / -1;
  }
  /* Save / status bar pinned bottom of content area */
  #view-edit .editCard[data-tabbed="1"] .editActions,
  #view-edit .editCard[data-tabbed="1"] .editStatusRow,
  #view-edit .editCard[data-tabbed="1"] #editStatus,
  #view-edit .editCard[data-tabbed="1"] #editSaveBtn {
    grid-column: 1 / -1;
  }
}

/* Make field cards a touch denser */
#view-edit .field {
  padding: 2px 0;
}

/* ---------- 4) Background effects on edit page -------------------- */
#view-edit { position: relative; isolation: isolate; }
#editBgFx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}
#editBgFx::before, #editBgFx::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: editBlobFloat 18s ease-in-out infinite;
}
#editBgFx::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #a78bfa 0%, transparent 70%);
  top: -120px; left: -120px;
}
#editBgFx::after {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  bottom: -180px; right: -160px;
  animation-delay: -9s;
}
@keyframes editBlobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(60px,-30px) scale(1.08); }
  66%     { transform: translate(-40px,40px) scale(0.95); }
}
#editBgFx .star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.7;
  animation: editStarTwinkle 3.5s ease-in-out infinite;
  box-shadow: 0 0 6px #fff;
}
@keyframes editStarTwinkle {
  0%,100% { opacity: 0.2; transform: scale(0.8); }
  50%     { opacity: 0.95; transform: scale(1.2); }
}
#editBgFx.fx-grid::after { display: none; }
#editBgFx.fx-grid::before { display: none; }
#editBgFx.fx-grid {
  background-image:
    linear-gradient(rgba(167,139,250,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167,139,250,0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: 0.4;
}
#editBgFx.fx-aurora::before { background: radial-gradient(circle, #06b6d4 0%, transparent 70%); }
#editBgFx.fx-aurora::after  { background: radial-gradient(circle, #22c55e 0%, transparent 70%); }
#editBgFx.fx-sunset::before { background: radial-gradient(circle, #f59e0b 0%, transparent 70%); }
#editBgFx.fx-sunset::after  { background: radial-gradient(circle, #ef4444 0%, transparent 70%); }
#editBgFx.fx-none { display: none; }

/* Edit-page background picker */
.editBgPicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.editBgPicker button {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #e5e7eb;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}
.editBgPicker button:hover { background: rgba(167,139,250,0.18); }
.editBgPicker button.active {
  background: linear-gradient(135deg, rgba(167,139,250,0.35), rgba(236,72,153,0.25));
  border-color: rgba(167,139,250,0.55);
  color: #fff;
}

/* ---------- 5) More cursor effect classes ------------------------ */
/* Sparkle cursor (drawn via JS spawning .cursorSpark elements) */
.cursorSpark {
  position: fixed;
  width: 6px; height: 6px;
  pointer-events: none;
  border-radius: 50%;
  background: var(--ct-color, #a78bfa);
  box-shadow: 0 0 10px var(--ct-color, #a78bfa);
  animation: cursorSparkFade 700ms ease-out forwards;
  z-index: 99999;
}
@keyframes cursorSparkFade {
  0%   { transform: scale(1) translate(-50%,-50%); opacity: 1; }
  100% { transform: scale(0.2) translate(calc(-50% + var(--dx,0px)), calc(-50% + var(--dy,0px))); opacity: 0; }
}
.cursorBubble {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  border: 1.5px solid var(--ct-color, #a78bfa);
  background: transparent;
  width: 12px; height: 12px;
  transform: translate(-50%,-50%);
  animation: cursorBubbleGrow 900ms ease-out forwards;
  z-index: 99999;
}
@keyframes cursorBubbleGrow {
  0%   { width: 6px; height: 6px; opacity: 0.95; }
  100% { width: 60px; height: 60px; opacity: 0; }
}
.cursorHeart {
  position: fixed;
  pointer-events: none;
  width: 16px; height: 16px;
  transform: translate(-50%,-50%);
  z-index: 99999;
  animation: cursorHeartFloat 900ms ease-out forwards;
  font-size: 16px;
  line-height: 1;
  color: var(--ct-color, #ec4899);
  text-shadow: 0 0 8px currentColor;
}
@keyframes cursorHeartFloat {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(0.8); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 30px)) scale(1.2); }
}
.cursorEmoji {
  position: fixed;
  pointer-events: none;
  font-size: 18px;
  z-index: 99999;
  transform: translate(-50%, -50%);
  animation: cursorEmojiPop 900ms ease-out forwards;
}
@keyframes cursorEmojiPop {
  0%   { opacity: 1; transform: translate(-50%,-50%) scale(0.6) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 26px)) scale(1.3) rotate(40deg); }
}

/* ---------- 6) Username size: numeric px input -------------------- */
.usernameSizeBlock .sizeRow .pxNumberInput {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 64px;
  background: rgba(167,139,250,0.10);
  border: 1px solid rgba(167,139,250,0.35);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
}
.usernameSizeBlock .sizeRow .pxNumberInput:focus {
  border-color: rgba(167,139,250,0.7);
  box-shadow: 0 0 0 2px rgba(167,139,250,0.25);
}
.usernameSizeBlock .sizeRow .pxNumberInput::-webkit-outer-spin-button,
.usernameSizeBlock .sizeRow .pxNumberInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.usernameSizeBlock .sizeRow .pxLabel {
  font-size: 11px;
  opacity: 0.6;
  margin-left: -4px;
}

/* ---------- 7) Username + bio extra animations -------------------- */
.profileName.fx-bounce  { animation: nameBounce 1.6s ease-in-out infinite; }
.profileName.fx-wave    { animation: nameWave 3.5s ease-in-out infinite; }
.profileName.fx-shake   { animation: nameShake 0.7s ease-in-out infinite; }
.profileName.fx-flip    { animation: nameFlip 4s ease-in-out infinite; }
.profileName.fx-zoom    { animation: nameZoom 2.4s ease-in-out infinite; }
@keyframes nameBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nameWave   { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes nameShake  { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes nameFlip   { 0%,40%,100% { transform: rotateY(0deg); } 50%,90% { transform: rotateY(360deg); } }
@keyframes nameZoom   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.bio-anim-bounce   { animation: bioBounce 2s ease-in-out infinite; display: inline-block; }
.bio-anim-shake    { animation: bioShake 0.9s ease-in-out infinite; display: inline-block; }
.bio-anim-rainbow  { animation: bioRainbow 5s linear infinite; background: linear-gradient(90deg, #ff5757, #ffbd59, #7ed957, #38b6ff, #5e17eb, #ff66c4); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.bio-anim-pulse    { animation: bioPulse 2.4s ease-in-out infinite; display: inline-block; }
.bio-anim-flicker  { animation: bioFlicker 3s linear infinite; display: inline-block; }
@keyframes bioBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bioShake  { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
@keyframes bioRainbow{ from { background-position: 0% 0%; } to { background-position: 200% 0%; } }
@keyframes bioPulse  { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.85; transform: scale(1.02); } }
@keyframes bioFlicker { 0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; text-shadow: 0 0 8px currentColor; } 20%, 24%, 55% { opacity: 0.4; text-shadow: none; } }

/* ---------- 8) Hidden remove buttons (already supported, reinforce)*/
.removeBtn[hidden],
.removeBtn[data-empty="1"],
[data-removed="1"] .removeBtn {
  display: none !important;
}

/* ---------- 9) Smoothness — global polish ------------------------- */
button, .btn, a.connIcon, .toggleLabel, .field input, .field select, .field textarea,
.editTabsBar button, .removeBtn {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
              transform 120ms ease, box-shadow 220ms ease, opacity 160ms ease !important;
}
.editTabsBar button:active,
.btn:active,
.removeBtn:active { transform: scale(0.97); }

/* ---------- 10) Discord verify card (own server) ----------------- */
#discordVerifyBox.ownServer .verifyRow {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
#discordVerifyBox.ownServer .joinLine {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}
#discordVerifyBox.ownServer .joinLine a {
  color: #c7d2fe;
  font-weight: 600;
  text-decoration: underline;
}
#discordVerifyBox.ownServer .idRow {
  display: flex;
  gap: 8px;
  align-items: center;
}
#discordVerifyBox.ownServer .idRow input {
  flex: 1;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(88,101,242,0.35);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  outline: none;
}
#discordVerifyBox.ownServer .idRow input:focus {
  border-color: rgba(88,101,242,0.85);
  box-shadow: 0 0 0 2px rgba(88,101,242,0.25);
}
#discordVerifyBox.ownServer .syncStatus {
  font-size: 12px;
  margin: 6px 0 0;
  color: rgba(255,255,255,0.7);
}
#discordVerifyBox.ownServer .syncStatus.ok    { color: #86efac; }
#discordVerifyBox.ownServer .syncStatus.error { color: #f87171; }

/* Hide the legacy Discord OAuth card from enhancements2.js */
#discordSyncCardV2 { display: none !important; }

/* ---------- 11) Password re-auth modal --------------------------- */
.seeknReauthModal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: reauthFadeIn 200ms ease both;
}
@keyframes reauthFadeIn { from { opacity: 0; } to { opacity: 1; } }
.seeknReauthModal .card {
  background: linear-gradient(160deg, #18181b, #0a0a0f);
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 16px;
  padding: 22px;
  width: min(420px, 94vw);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(167,139,250,0.15);
  animation: reauthSlideIn 220ms cubic-bezier(.2,.9,.2,1) both;
}
@keyframes reauthSlideIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.seeknReauthModal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.seeknReauthModal p {
  margin: 0 0 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.seeknReauthModal input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 11px 13px;
  color: #fff;
  font-size: 14px;
  outline: none;
  margin-bottom: 8px;
}
.seeknReauthModal input:focus {
  border-color: rgba(167,139,250,0.7);
  box-shadow: 0 0 0 2px rgba(167,139,250,0.25);
}
.seeknReauthModal .err {
  font-size: 12px;
  color: #f87171;
  min-height: 16px;
  margin: 0 0 10px;
}
.seeknReauthModal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.seeknReauthModal button {
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 140ms ease;
}
.seeknReauthModal button.cancel {
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.12);
}
.seeknReauthModal button.confirm {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff;
  border-color: rgba(167,139,250,0.55);
}
.seeknReauthModal button.confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 22px -8px rgba(167,139,250,0.7); }
.seeknReauthModal button:disabled { opacity: 0.6; cursor: wait; }
