/* Custom Spin the Wheel Styling */
:root {
  --wheel-primary: #E8470A;
  --wheel-secondary: #1A3FA3;
  --wheel-text: #ffffff;
}

.wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.wheel-container {
  position: relative;
  background: white;
  padding: 40px;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 500px;
  width: 90%;
  transform: scale(0.8) translateY(20px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wheel-overlay.active .wheel-container {
  transform: scale(1) translateY(0);
}

.wheel-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--wheel-secondary);
  margin-bottom: 10px;
}

.wheel-header p {
  color: #64748b;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.wheel-box {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto 30px;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 10px solid #f8fafc;
  box-shadow: 0 0 0 5px var(--wheel-primary), 0 15px 35px rgba(0,0,0,0.2);
  transition: transform 5s cubic-bezier(0.15, 0, 0.15, 1);
}

.wheel-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.segment {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  transform-origin: 100% 100%;
}

.segment:nth-child(1) { transform: rotate(0deg); background: #E8470A; } /* 5% */
.segment:nth-child(2) { transform: rotate(90deg); background: #1A3FA3; } /* 10% */
.segment:nth-child(3) { transform: rotate(180deg); background: #F7931E; } /* 20% */
.segment:nth-child(4) { transform: rotate(270deg); background: #0D1B3E; } /* 50% */

.segment span {
  position: absolute;
  left: 30%;
  top: 30%;
  transform: rotate(45deg);
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.wheel-pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: white;
  z-index: 10;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.2));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.wheel-center img {
  width: 35px;
  height: auto;
}

.spin-btn {
  background: linear-gradient(to right, var(--wheel-primary), #F7931E);
  color: white;
  border: none;
  padding: 15px 50px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(232, 71, 10, 0.4);
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

.spin-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 15px 25px -5px rgba(232, 71, 10, 0.5);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.close-wheel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f1f5f9;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
  border: none;
}

.close-wheel:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Result Modal */
.wheel-result {
  display: none;
  margin-top: 20px;
  animation: fadeIn 0.5s ease forwards;
}

.wheel-result.active {
  display: block;
}

.congrats-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--wheel-primary);
  margin-bottom: 15px;
}

.coupon-code {
  background: #f8fafc;
  border: 2px dashed var(--wheel-secondary);
  padding: 12px 25px;
  border-radius: 12px;
  display: inline-block;
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wheel-secondary);
  margin-bottom: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .wheel-box {
    width: 260px;
    height: 260px;
  }
  .wheel-container {
    padding: 30px 20px;
  }
  .wheel-header h2 {
    font-size: 2rem;
  }
}
