/* PureCoin Widget Complete Styles */

/* CSS Variables for base positions */
:root {
  --base-bottom: 95px;
  --base-right: 25px;
  --base-bottom-mobile: 85px;
  --base-right-mobile: 20px;
}

/* Floating Widget Styles */
.purecoin-floating-icon {
  position: fixed;
  z-index: 9999;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.3));
}

/* Position Classes - Updated for WhatsApp positioning */
.purecoin-floating-icon.position-bottom-right {
  bottom: 30px;
  right: 30px;
}

.purecoin-floating-icon.position-bottom-left {
  bottom: 30px;
  left: 30px;
}

.purecoin-floating-icon.position-top-right {
  top: 30px;
  right: 30px;
}

.purecoin-floating-icon.position-top-left {
  top: 30px;
  left: 30px;
}

.purecoin-floating-icon.position-right-center {
  top: 50%;
  right: 25px;
  transform: translateY(-50%);
}

.purecoin-floating-icon.position-left-center {
  top: 50%;
  left: 25px;
  transform: translateY(-50%);
}

/* Above WhatsApp positioning - with CSS variables for pixel adjustments */
.purecoin-floating-icon.position-above-whatsapp {
  bottom: var(--base-bottom);
  right: var(--base-right);
}

.purecoin-floating-icon.position-above-whatsapp-close {
  bottom: 85px; /* Close above WhatsApp */
  right: 25px;
}

.purecoin-floating-icon.position-above-whatsapp-normal {
  bottom: var(--base-bottom); /* Normal spacing above WhatsApp */
  right: var(--base-right);
}

.purecoin-floating-icon.position-above-whatsapp-far {
  bottom: 105px; /* More spacing above WhatsApp */
  right: 25px;
}

/* Conflict prevention with WhatsApp widget - FIXED */
.purecoin-floating-icon[class*="above-whatsapp"] {
  z-index: 99999 !important; /* Higher than WhatsApp's typical z-index of 9999 */
}

/* Ensure PureCoin widget is always on top when positioned above WhatsApp */
.purecoin-floating-icon.position-above-whatsapp,
.purecoin-floating-icon.position-above-whatsapp-close,
.purecoin-floating-icon.position-above-whatsapp-normal,
.purecoin-floating-icon.position-above-whatsapp-far {
  z-index: 99999 !important;
}

/* Size Classes */
.purecoin-floating-icon.size-small .coin-container {
  width: 50px;
  height: 50px;
}

.purecoin-floating-icon.size-medium .coin-container {
  width: 65px;
  height: 65px;
}

.purecoin-floating-icon.size-large .coin-container {
  width: 80px;
  height: 80px;
}

/* Coin Container */
.coin-container {
  position: relative;
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coin-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 30% 30%, #fff, transparent 50%);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6), inset 0 0 15px rgba(255, 215, 0, 0.2);
}

.purecoin-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.coin-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(-45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(-45deg);
  }
  50% {
    transform: translateX(0%) translateY(0%) rotate(-45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(-45deg);
  }
}

.coin-glow-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: #c89b3c;
  opacity: 0.7;
  z-index: -1;
  animation: rotate 4s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.coin-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.particle {
  position: absolute;
  font-size: 10px;
  opacity: 0;
  animation: particleFloat 2s infinite ease-in-out;
}

.particle-1 {
  top: 10%;
  left: 80%;
  animation-delay: 0s;
}

.particle-2 {
  top: 70%;
  left: 10%;
  animation-delay: 0.7s;
}

.particle-3 {
  top: 30%;
  left: 90%;
  animation-delay: 1.4s;
}

@keyframes particleFloat {
  0%,
  100% {
    opacity: 0;
    transform: translateY(0px) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateY(-15px) scale(1);
  }
}

/* Animation Styles */
.purecoin-floating-icon.animation-float-glow {
  animation: floatGlow 3s ease-in-out infinite;
}

@keyframes floatGlow {
  0%,
  100% {
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 15px 25px rgba(255, 215, 0, 0.5));
  }
}

.purecoin-floating-icon.position-right-center.animation-float-glow,
.purecoin-floating-icon.position-left-center.animation-float-glow {
  animation: floatGlowCenter 3s ease-in-out infinite;
}

@keyframes floatGlowCenter {
  0%,
  100% {
    transform: translateY(-50%) translateX(0px);
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.3));
  }
  50% {
    transform: translateY(-50%) translateX(-8px);
    filter: drop-shadow(0 15px 25px rgba(255, 215, 0, 0.5));
  }
}

/* Tooltip */
.coin-tooltip {
  position: absolute;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 10px;
  border-radius: 15px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10001;
}

.purecoin-floating-icon.position-right-center .coin-tooltip {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 12px;
}

.purecoin-floating-icon:hover .coin-tooltip {
  opacity: 1;
}

/* MODAL STYLES */

/* Modal Overlay */
.purecoin-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.4s ease;
  align-items: center;
  justify-content: center;
}

.purecoin-modal-overlay.show {
  opacity: 1;
}

/* Modal Container */
.purecoin-modal-container {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 30px;
  width: 95%;
  max-width: 1000px;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.3), 0 0 100px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: scale(0.8) translateY(50px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.purecoin-modal-overlay.show .purecoin-modal-container {
  transform: scale(1) translateY(0);
}

/* Close Button */
.modal-close-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ffd700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000000;
  transition: all 0.3s ease;
  color: #b8860b;
  font-size: 0;
  padding: 0;
}

.modal-close-btn:hover {
  background: #ffd700;
  color: #fff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.modal-close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

.modal-close-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 3;
}

/* Hero Section */
.modal-hero {
  position: relative;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
  padding: 60px 40px;
  border-radius: 30px 30px 0 0;
  text-align: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
}

.floating-coins {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-coin {
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, #ffd700 30%, #ffed4e 70%);
  border: 2px solid #b8860b;
  border-radius: 50%;
  opacity: 0.3;
  animation: floatCoin 6s infinite ease-in-out;
}

.floating-coin::after {
  content: "₽";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #b8860b;
  font-weight: bold;
}

.floating-coin.coin-1 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.floating-coin.coin-2 {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}
.floating-coin.coin-3 {
  bottom: 30%;
  left: 20%;
  animation-delay: 2s;
}
.floating-coin.coin-4 {
  bottom: 20%;
  right: 25%;
  animation-delay: 3s;
}
.floating-coin.coin-5 {
  top: 50%;
  left: 5%;
  animation-delay: 4s;
}

@keyframes floatCoin {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-coin {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
}

.hero-coin-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  animation: heroSpin 4s linear infinite;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

@keyframes heroSpin {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

.hero-coin-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.hero-title {
  font-size: 42px;
  font-weight: 900;
  color: #b8860b;
  margin: 0 0 15px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 20px;
  color: #8b6914;
  margin: 0 0 40px 0;
  font-weight: 500;
}

/* Benefits Section */
.modal-benefits {
  padding: 60px 40px;
  background: #fff;
}

.benefits-title {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  color: #333;
  margin: 0 0 50px 0;
}

.benefits-container {
  display: grid;
  gap: 25px;
  max-width: 800px;
  margin: 0 auto;
}

.benefit-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 2px solid #ffd700;
  border-radius: 20px;
  padding: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.benefit-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
  transition: left 0.6s ease;
}

.benefit-card:hover::before {
  left: 100%;
}

.benefit-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(255, 215, 0, 0.3), 0 0 50px rgba(255, 215, 0, 0.2);
  border-color: #ffed4e;
}

.benefit-icon-wrapper {
  position: relative;
  margin-right: 25px;
  flex-shrink: 0;
}

.benefit-icon-bg {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border-radius: 50%;
  opacity: 0.2;
  animation: iconPulse 3s infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.benefit-icon {
  font-size: 48px;
  display: block;
  position: relative;
  z-index: 2;
  animation: iconBounce 2s infinite;
}

@keyframes iconBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.benefit-content {
  flex: 1;
}

.benefit-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin: 0 0 10px 0;
}

.benefit-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.benefit-arrow {
  font-size: 24px;
  color: #ffd700;
  margin-left: 20px;
  transition: transform 0.3s ease;
}

.benefit-card:hover .benefit-arrow {
  transform: translateX(10px);
}

/* CTA Section */
.modal-cta {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  padding: 60px 40px;
  border-radius: 0 0 30px 30px;
  text-align: center;
  overflow: hidden;
}

.cta-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.cta-pattern {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 25% 25%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
  animation: patternMove 10s infinite linear;
}

@keyframes patternMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

.cta-content {
  position: relative;
  z-index: 10;
}

.cta-coin-stack {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
  height: 80px;
}

.cta-coin {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.cta-coin-1 {
  z-index: 3;
  animation: stackFloat1 3s infinite ease-in-out;
}

.cta-coin-2 {
  z-index: 2;
  top: 15px;
  left: calc(50% - 20px);
  animation: stackFloat2 3s infinite ease-in-out 0.5s;
}

.cta-coin-3 {
  z-index: 1;
  top: 30px;
  left: calc(50% + 20px);
  animation: stackFloat3 3s infinite ease-in-out 1s;
}

@keyframes stackFloat1 {
  0%,
  100% {
    transform: translateX(-50%) translateY(0px) rotateY(0deg);
  }
  50% {
    transform: translateX(-50%) translateY(-10px) rotateY(180deg);
  }
}

@keyframes stackFloat2 {
  0%,
  100% {
    transform: translateY(0px) rotateY(0deg);
  }
  50% {
    transform: translateY(-8px) rotateY(180deg);
  }
}

@keyframes stackFloat3 {
  0%,
  100% {
    transform: translateY(0px) rotateY(0deg);
  }
  50% {
    transform: translateY(-6px) rotateY(180deg);
  }
}

.cta-title {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 15px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.cta-subtitle {
  font-size: 18px;
  color: #ccc;
  margin: 0 0 40px 0;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 200px;
  justify-content: center;
}

.cta-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.cta-btn:hover::before {
  left: 100%;
}

.cta-btn-primary {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
  color: #b8860b;
  border: 3px solid #ffd700;
  box-shadow: 0 15px 35px rgba(255, 215, 0, 0.4);
}

.cta-btn-primary:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 25px 50px rgba(255, 215, 0, 0.6);
  color: #8b6914;
  text-decoration: none;
}

.cta-btn-secondary {
  background: transparent;
  color: #ffd700;
  border: 3px solid #ffd700;
}

.cta-btn-secondary:hover {
  background: #ffd700;
  color: #b8860b;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 25px 50px rgba(255, 215, 0, 0.4);
  text-decoration: none;
}

.btn-icon {
  font-size: 20px;
}

.btn-text {
  flex: 1;
}

.btn-arrow {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.cta-btn:hover .btn-arrow {
  transform: translateX(5px);
}

.cta-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #999;
  font-size: 14px;
  margin-top: 20px;
}

.guarantee-icon {
  font-size: 16px;
  color: #ffd700;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .purecoin-floating-icon {
    bottom: var(--base-bottom-mobile) !important;
    right: var(--base-right-mobile) !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }

  .purecoin-floating-icon .coin-container {
    width: 45px !important;
    height: 45px !important;
  }

  .purecoin-floating-icon.size-small .coin-container {
    width: 40px !important;
    height: 40px !important;
  }

  .purecoin-floating-icon.size-medium .coin-container {
    width: 45px !important;
    height: 45px !important;
  }

  .purecoin-floating-icon.size-large .coin-container {
    width: 50px !important;
    height: 50px !important;
  }

  .purecoin-modal-container {
    width: 98%;
    max-height: 98vh;
    border-radius: 20px;
  }

  .modal-close-btn {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .modal-close-btn svg {
    width: 20px;
    height: 20px;
  }

  .modal-hero {
    padding: 40px 25px;
    border-radius: 20px 20px 0 0;
  }

  .hero-coin-image {
    width: 80px;
    height: 80px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .modal-benefits {
    padding: 40px 25px;
  }

  .benefits-title {
    font-size: 28px;
  }

  .benefit-card {
    flex-direction: column;
    text-align: center;
    padding: 25px 20px;
  }

  .benefit-icon-wrapper {
    margin-right: 0;
    margin-bottom: 20px;
  }

  .benefit-arrow {
    margin-left: 0;
    margin-top: 15px;
    transform: rotate(90deg);
  }

  .modal-cta {
    padding: 40px 25px;
    border-radius: 0 0 20px 20px;
  }

  .cta-title {
    font-size: 24px;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn {
    width: 100%;
    max-width: 300px;
  }

  .coin-tooltip {
    display: none;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .purecoin-modal-container {
    border: 3px solid #000;
  }

  .modal-close-btn {
    border: 3px solid #000;
    background: #fff;
    color: #000;
  }
}
