
/* LOADER OVERLAY */
.ts-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s;
  backdrop-filter: blur(8px);
}

.ts-loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* LOADER CONTAINER */
.ts-loader-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* THE SPINNING RING */
.ts-loader-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, #ff8000, transparent 60%);
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spinner-rotate 1.2s linear infinite;
}

/* Secondary subtle ring */
.ts-loader-spinner-bg {
  position: absolute;
  inset: 0;
  border: 4px solid #f3f4f6;
  border-radius: 50%;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* THE LIGHTBULB (AMPOULE) */

/* THE LIGHTBULB (AMPOULE) */
.ts-loader-bulb {
  width: 100px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-loader-bulb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 128, 0, 0.4));
  animation: bulb-glow 1.5s ease-in-out infinite alternate;
}

/* GEAR SPINNING EFFECT (Simulation) */
/* Adding a pseudo-element to simulate the gear glow */
.ts-loader-bulb::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255, 128, 0, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: gear-pulse 1s ease-in-out infinite alternate;
}

@keyframes bulb-glow {
  from {
    filter: drop-shadow(0 0 10px rgba(255, 128, 0, 0.3));
    transform: scale(1);
  }
  to {
    filter: drop-shadow(0 0 25px rgba(255, 128, 0, 0.8));
    transform: scale(1.02);
  }
}

@keyframes gear-pulse {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 0.8; transform: scale(1.2); }
}

/* LOADING TEXT */
.ts-loader-text {
  margin-top: 32px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ts-loader-subtext {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}

/* DOTS ANIMATION */
.ts-loader-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* PROGRESS BAR */
.ts-loader-progress-wrap {
    width: 200px;
    height: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.ts-loader-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff8000, #ff9933);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Shine effect on progress bar */
.ts-loader-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
