/* --- Modern Slider Toggle Widget (Minimalist) --- */
#svp-floating-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  left: auto;
  z-index: 99999;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  opacity: 0;
  animation: svpFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

@keyframes svpFadeIn { to { opacity: 1; } }

/* --- Wrapper --- */
.svp-floating-toggle {
  display: block;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Hide Checkbox */
.svp-floating-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

/* --- The Track (Pill Shape) --- */
.svp-slider-track {
  width: 72px; /* Sleeker width */
  height: 40px; /* Sleeker height */
  border-radius: 40px;
  position: relative;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  
  /* Minimalist Deep Navy Track */
  background: #0f172a; 
  /* Ultra-subtle border for definition */
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* Soft ambient shadow */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.svp-slider-track:hover {
  background: #1e293b; /* Slightly lighter on hover */
  border-color: rgba(255, 255, 255, 0.15);
}

/* --- The Thumb (Sliding Circle) --- */
.svp-slider-thumb {
  position: absolute;
  top: 3px; 
  left: 3px;
  width: 34px; /* Matches track height minus padding */
  height: 34px;
  border-radius: 50%;
  
  /* The "Jewel" - Dark Royal Blue */
  background: #1e3a8a; 
  
  /* Floating shadow, no border for minimalism */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* --- Bell Icon inside Thumb --- */
.svp-bell-icon {
  width: 16px;
  height: 16px;
  /* Minimalist Gold/Yellow */
  fill: #fbbf24; 
  transition: transform 0.4s ease;
}

/* --- Track Status Icons (Check & X) --- */
.svp-track-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  /* Pure White for sharp contrast */
  color: #ffffff; 
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.4s ease;
  opacity: 0.6; /* Slight transparency for minimalist look when idle */
}

.svp-icon-x {
  right: 10px;
  opacity: 0.8;
}

.svp-icon-check {
  left: 10px;
  opacity: 0;
  transform: scale(0.8);
}

/* --- STATE: ON (Checked) --- */

/* 1. Track Active State */
.svp-floating-toggle input:checked + .svp-slider-track {
  background: #0f172a; /* Keep dark background */
  border-color: #fbbf24; /* Thin Gold Border indicates active nicely */
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.15); /* Very subtle gold glow */
}

/* 2. Thumb moves Right */
.svp-floating-toggle input:checked + .svp-slider-track .svp-slider-thumb {
  left: calc(100% - 37px); 
  background: #172554; /* Deepest Blue */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); 
}

/* 3. Icon Visibility Swap */
.svp-floating-toggle input:checked + .svp-slider-track .svp-icon-x {
  opacity: 0;
  transform: scale(0.8);
}
.svp-floating-toggle input:checked + .svp-slider-track .svp-icon-check {
  opacity: 1;
  transform: scale(1);
  color: #fbbf24; /* Gold checkmark aligns with theme */
}

/* 4. Bell Animation on Active */
.svp-floating-toggle input:checked + .svp-slider-track .svp-slider-thumb .svp-bell-icon {
  transform: rotate(-15deg) scale(1.1); 
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

/* --- Tooltip --- */
.svp-tooltip {
  position: absolute;
  right: 84px; 
  top: 50%;
  transform: translateY(-50%) translateX(10px); 
  /* Minimalist Tooltip */
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.svp-floating-toggle:hover .svp-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* --- Mobile --- */
@media (max-width: 600px) {
  #svp-floating-widget { bottom: 20px; right: 20px; }
  
  /* Even more compact on mobile */
  .svp-slider-track { width: 64px; height: 36px; }
  .svp-slider-thumb { width: 30px; height: 30px; top: 3px; left: 3px; }
  
  .svp-floating-toggle input:checked + .svp-slider-track .svp-slider-thumb {
    left: calc(100% - 33px);
  }
  
  .svp-bell-icon { width: 14px; height: 14px; }
  .svp-track-icon { width: 14px; height: 14px; }
  .svp-icon-x { right: 8px; }
  .svp-icon-check { left: 8px; }
  
  .svp-tooltip { display: none; }
}