/**
 * 3D Medical Pill Spinner - Siam Healthy Theme
 * Минимальная версия только с 3D таблеткой
 */

/* ===== БАЗОВЫЙ ОВЕРЛЕЙ ===== */
.siam-spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.siam-spinner-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== 3D СПИННЕР ТАБЛЕТКА ===== */
.siam-spinner-pill-3d {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.siam-spinner-pill-3d .content {
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.siam-spinner-pill-3d .pill {
  background: transparent;
  width: 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transform: rotate(180deg);
  animation: pillSpin3D 4s linear 0s infinite;
}

@keyframes pillSpin3D {
  100% { transform: rotate(-540deg); }
}

.siam-spinner-pill-3d .pill .side {
  background: #04B4A6;
  position: relative;
  overflow: hidden;
  width: 18px;
  height: 24px;
  border-radius: 9px 9px 0 0;
}

.siam-spinner-pill-3d .pill .side + .side {
  background: #027a6f;
  border-radius: 0 0 9px 9px;
  border-top: 1.5px solid #03988e;
  animation: pillOpen3D 2s ease-in-out 0s infinite;
}

@keyframes pillOpen3D {
  0%, 20%, 80%, 100% { margin-top: 0; }
  30%, 70% { margin-top: 16px; }
}

.siam-spinner-pill-3d .pill .side:before {
  content: "";
  position: absolute;
  width: 3px;
  height: 16px;
  bottom: 0;
  right: 2.5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 1.5px 1.5px 0 0;
  animation: pillShine3D 1s ease-out -1s infinite alternate-reverse;
}

.siam-spinner-pill-3d .pill .side + .side:before {
  bottom: inherit;
  top: 0;
  border-radius: 0 0 1.5px 1.5px;
}

.siam-spinner-pill-3d .pill .side:after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  bottom: 0;
  left: 0;
  border-radius: 9px 9px 0 0;
  border: 2.8px solid rgba(0, 0, 0, 0.15);
  border-bottom-color: transparent;
  border-bottom-width: 0;
  border-top-width: 1.5px;
  animation: pillShadow3D 1s ease -1s infinite alternate-reverse;
}

.siam-spinner-pill-3d .pill .side + .side:after {
  bottom: inherit;
  top: 0;
  border-radius: 0 0 9px 9px;
  border-top-color: transparent;
  border-top-width: 0;
  border-bottom-width: 1.5px;
}

@keyframes pillShine3D {
  0%, 46% { right: 2.5px; }
  54%, 100% { right: 12px; }
}

@keyframes pillShadow3D {
  0%, 49.999% { transform: rotateY(0deg); left: 0; }
  50%, 100% { transform: rotateY(180deg); left: -4.8px; }
}

.siam-spinner-pill-3d .medicine {
  position: absolute;
  width: calc(100% - 9.6px);
  height: calc(100% - 19.2px);
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.siam-spinner-pill-3d .medicine i {
  width: 1.6px;
  height: 1.6px;
  background: #27AE60;
  border-radius: 100%;
  position: absolute;
  animation: medicineParticles3D 1.75s ease 0s infinite alternate;
}

.siam-spinner-pill-3d .medicine i:nth-child(2n+2) {
  width: 2.4px;
  height: 2.4px;
  margin-top: -8px;
  margin-right: -8px;
  background: #04B4A6;
  animation-delay: -0.2s;
}

.siam-spinner-pill-3d .medicine i:nth-child(3n+3) {
  width: 3.2px;
  height: 3.2px;
  margin-top: 6.4px;
  margin-right: 4.8px;
  background: #F39C12;
  animation-delay: -0.33s;
}

.siam-spinner-pill-3d .medicine i:nth-child(4) {
  margin-top: -8px;
  margin-right: 6.4px;
  animation-delay: -0.4s;
}

.siam-spinner-pill-3d .medicine i:nth-child(5) {
  margin-top: 8px;
  margin-right: -6.4px;
  animation-delay: -0.5s;
}

.siam-spinner-pill-3d .medicine i:nth-child(6) {
  margin-top: 0;
  margin-right: -5.6px;
  animation-delay: -0.66s;
}

.siam-spinner-pill-3d .medicine i:nth-child(7) {
  margin-top: -1.6px;
  margin-right: 11.2px;
  animation-delay: -0.7s;
}

.siam-spinner-pill-3d .medicine i:nth-child(8) {
  margin-top: 9.6px;
  margin-right: -1.6px;
  animation-delay: -0.8s;
}

.siam-spinner-pill-3d .medicine i:nth-child(9) {
  margin-top: 6.4px;
  margin-right: -11.2px;
  animation-delay: -0.99s;
}

.siam-spinner-pill-3d .medicine i:nth-child(10) {
  margin-top: -9.6px;
  margin-right: 0;
  animation-delay: -1.11s;
}

.siam-spinner-pill-3d .medicine i:nth-child(1n+10) {
  width: 1px;
  height: 1px;
}

.siam-spinner-pill-3d .medicine i:nth-child(11) {
  margin-top: 9.6px;
  margin-right: 9.6px;
  animation-delay: -1.125s;
}

.siam-spinner-pill-3d .medicine i:nth-child(12) {
  margin-top: -11.2px;
  margin-right: -11.2px;
  animation-delay: -1.275s;
}

.siam-spinner-pill-3d .medicine i:nth-child(13) {
  margin-top: -1.6px;
  margin-right: 4.8px;
  animation-delay: -1.33s;
}

.siam-spinner-pill-3d .medicine i:nth-child(14) {
  margin-top: -4.8px;
  margin-right: -1.6px;
  animation-delay: -1.4s;
}

.siam-spinner-pill-3d .medicine i:nth-child(15) {
  margin-top: -1.6px;
  margin-right: -11.2px;
  animation-delay: -1.55s;
}

.siam-spinner-pill-3d .medicine i:nth-child(16) {
  margin-top: 4.8px;
  margin-right: 7.2px;
  animation-delay: -1.6s;
}

.siam-spinner-pill-3d .medicine i:nth-child(17) {
  margin-top: -7.2px;
  margin-right: 3.2px;
  animation-delay: -1.7s;
}

.siam-spinner-pill-3d .medicine i:nth-child(18) {
  margin-top: 2.4px;
  margin-right: -8.8px;
  animation-delay: -1.8s;
}

.siam-spinner-pill-3d .medicine i:nth-child(19) {
  margin-top: -2.4px;
  margin-right: 8.8px;
  animation-delay: -1.9s;
}

.siam-spinner-pill-3d .medicine i:nth-child(20) {
  margin-top: 7.2px;
  margin-right: -3.2px;
  animation-delay: -2s;
}

@keyframes medicineParticles3D {
  0%, 100% { transform: translate3d(0, 0, -0.16px); }
  25% { transform: translate3d(0.4px, 8px, 0); }
  75% { transform: translate3d(-0.16px, -6.4px, 0.4px); }
}

/* ===== ТЕМНАЯ ТЕМА ===== */
body.dark-theme .siam-spinner-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* ===== ДОСТУПНОСТЬ ===== */
@media (prefers-reduced-motion: reduce) {
  .siam-spinner-pill-3d .pill,
  .siam-spinner-pill-3d .pill .side + .side,
  .siam-spinner-pill-3d .pill .side:before,
  .siam-spinner-pill-3d .pill .side:after,
  .siam-spinner-pill-3d .medicine i {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
} 