/* ==========================================================================
   CoreV2 — Preloader (harici dosya)
   Renkler PHP tarafindan :root uzerine yazilan degiskenlerden gelir:
   --pl-bg, --pl-bg-dark, --pl-ring, --pl-ring-rgb, --pl-grad
   Onceden bu kurallar her sayfada ~8 KB satir ici <style> olarak basiliyordu.
   ========================================================================== */

html.cv2-preloader-active,
body.cv2-preloader-active { overflow: hidden; }
html.cv2-preloader-active { background: var(--pl-bg, #fafbfc); }
html.cv2-preloader-active.dark-mode,
html.cv2-preloader-active[data-theme="dark"] { background: var(--pl-bg-dark, #0B0F19); }
html.cv2-preloader-active:not(.dark-mode):not([data-theme="dark"]) { background: var(--pl-bg, #fafbfc); }
body.cv2-preloader-active { visibility: visible; background: inherit; }
html.cv2-preloader-active #corev2-preloader,
body.cv2-preloader-active #corev2-preloader { visibility: visible; display: flex; opacity: 1; pointer-events: auto; }

#corev2-preloader {
  position: fixed; inset: 0; width: 100%; height: 100%;
  background: var(--pl-bg, #fafbfc);
  z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  opacity: 1; pointer-events: auto;
  transition: opacity .22s ease, visibility .22s ease;
}
html[data-theme="dark"] #corev2-preloader,
[data-theme="dark"] #corev2-preloader { background: var(--pl-bg-dark, #0B0F19); }
#corev2-preloader.preloader-closing,
#corev2-preloader[data-closed] { opacity: 0; pointer-events: none; visibility: hidden; }

.preloader-inner { position: relative; display: flex; align-items: center; justify-content: center; min-width: 96px; min-height: 96px; }
.pl-logo-wrap { display: flex; align-items: center; justify-content: center; position: relative; width: 96px; height: 96px; }
.pl-logo-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: radial-gradient(circle at 32% 28%, rgba(var(--pl-ring-rgb), .85), var(--pl-ring) 52%, var(--pl-grad) 100%);
  z-index: 1; border: 2px solid rgba(255, 255, 255, .22);
  outline: 3px solid rgba(var(--pl-ring-rgb), .22); outline-offset: 4px; box-shadow: none;
}
.pl-logo-circle img {
  display: block; width: 36px; height: 36px; max-width: 52%; max-height: 52%;
  margin: 0; padding: 0; object-fit: contain; object-position: center;
  filter: brightness(0) invert(1); opacity: .96;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; line-height: 0;
}
.pl-wave-ring {
  position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; border: 2px solid var(--pl-ring);
  animation: plWave 1.4s ease-out infinite; pointer-events: none; z-index: 1;
}
.pl-wave-ring:nth-child(2) { animation-delay: .7s; }
.pl-gif { max-width: 96px; max-height: 96px; width: auto; height: auto; border-radius: var(--cv2-radius-input, 12px); }

/* Dots */
.pl-anim--dots { display: flex; gap: 14px; align-items: center; height: 56px; }
.pl-anim--dots span { width: 18px; height: 18px; background: var(--pl-ring); border-radius: 50%; animation: plDNA 1.3s ease-in-out infinite; box-shadow:none; }
.pl-anim--dots span:nth-child(2) { animation-delay: .2s; }
.pl-anim--dots span:nth-child(3) { animation-delay: .4s; }

/* Spinner ring */
.pl-anim--spinner { position: relative; width: 64px; height: 64px; }
.pl-anim--spinner::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid rgba(var(--pl-ring-rgb), .15); }
.pl-anim--spinner::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; border-top-color: var(--pl-ring); border-right-color: rgba(var(--pl-ring-rgb), .55); animation: plSpin .8s linear infinite; }

/* Pulse circle */
.pl-anim--pulse-circle { position: relative; width: 80px; height: 80px; }
.pl-anim--pulse-circle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--pl-ring); box-shadow:none; z-index: 1; }
.pl-anim--pulse-circle span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(var(--pl-ring-rgb), .35); animation: plSpin 1.5s linear infinite; }
.pl-anim--pulse-circle span:last-child { inset: 16px; border-color: rgba(var(--pl-ring-rgb), .55); animation-direction: reverse; animation-duration: 1.9s; }

/* Bouncing balls */
.pl-anim--bounce { display: flex; gap: 12px; align-items: flex-end; height: 56px; }
.pl-anim--bounce span { width: 18px; height: 18px; background: var(--pl-ring); border-radius: 50%; animation: plBounce .65s cubic-bezier(.33, 1, .68, 1) infinite alternate; box-shadow:none; }
.pl-anim--bounce span:nth-child(2) { animation-delay: .15s; }
.pl-anim--bounce span:nth-child(3) { animation-delay: .3s; }

/* Wave bars */
.pl-anim--wave { display: flex; gap: 8px; align-items: flex-end; height: 64px; }
.pl-anim--wave span { width: 10px; height: 18px; background: var(--pl-ring); border-radius: 5px; animation: plBar 1s ease-in-out infinite; transform-origin: bottom center; }
.pl-anim--wave span:nth-child(2) { animation-delay: .1s; }
.pl-anim--wave span:nth-child(3) { animation-delay: .2s; }
.pl-anim--wave span:nth-child(4) { animation-delay: .3s; }
.pl-anim--wave span:nth-child(5) { animation-delay: .4s; }

/* Dual ring */
.pl-anim--dual-ring { position: relative; width: 72px; height: 72px; }
.pl-anim--dual-ring span { position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; }
.pl-anim--dual-ring span:first-child { border-top-color: var(--pl-ring); border-right-color: rgba(var(--pl-ring-rgb), .3); animation: plSpin .9s linear infinite; }
.pl-anim--dual-ring span:last-child { inset: 12px; border-bottom-color: rgba(var(--pl-ring-rgb), .6); animation: plSpin 1.35s linear infinite reverse; }

/* Square / infinity spin */
.pl-anim--square { position: relative; width: 88px; height: 44px; }
.pl-anim--square::before,
.pl-anim--square::after { content: ''; position: absolute; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--pl-ring); box-shadow:none; }
.pl-anim--square::before { left: 0; animation: plInfL 1.6s ease-in-out infinite; }
.pl-anim--square::after { right: 0; animation: plInfR 1.6s ease-in-out infinite; }

/* Gradient spinner */
.pl-anim--gradient-spinner {
  width: 72px; height: 72px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--pl-ring) 55% 100%);
  animation: plSpin .85s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 0);
}

/* Shimmer bar */
.pl-anim--shimmer-bar { width: 168px; height: 8px; border-radius: 99px; background: rgba(var(--pl-ring-rgb), .18); overflow: hidden; position: relative; }
.pl-anim--shimmer-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--pl-ring), var(--pl-grad), transparent); animation: plShimmer 1.1s ease-in-out infinite; }

/* Orbit dots */
.pl-anim--orbit-dots { position: relative; width: 72px; height: 72px; }
.pl-anim--orbit-dots span { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--pl-ring); animation: plOrbit 1.2s linear infinite; box-shadow:none; }
.pl-anim--orbit-dots span:nth-child(1) { animation-delay: 0s; }
.pl-anim--orbit-dots span:nth-child(2) { animation-delay: -.4s; }
.pl-anim--orbit-dots span:nth-child(3) { animation-delay: -.8s; }

@keyframes plWave { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.85); opacity: 0; } }
@keyframes plSpin { to { transform: rotate(360deg); } }
@keyframes plDNA { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22px) scale(.72); opacity: .5; } }
@keyframes plBounce { to { transform: translateY(-28px); } }
@keyframes plBar { 0%, 100% { height: 16px; } 50% { height: 48px; } }
@keyframes plInfL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(360deg); } }
@keyframes plInfR { 0%, 100% { transform: rotate(180deg); } 50% { transform: rotate(-180deg); } }
@keyframes plShimmer { 0% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes plOrbit { 0% { transform: rotate(0deg) translateX(28px) rotate(0deg); } 100% { transform: rotate(360deg) translateX(28px) rotate(-360deg); } }

@media (max-width: 480px) {
  .pl-logo-wrap { width: 84px; height: 84px; }
  .pl-logo-circle { width: 64px; height: 64px; }
  .pl-logo-circle img { height: 30px; width: 30px; }
  .pl-wave-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .pl-gif { max-width: 80px; max-height: 80px; }
  .pl-anim--spinner,
  .pl-anim--gradient-spinner,
  .pl-anim--dual-ring,
  .pl-anim--orbit-dots { width: 56px; height: 56px; }
  .pl-anim--pulse-circle { width: 70px; height: 70px; }
}
