:root {
  --primary-red: #d63031;
  --dark-red: #c0392b;
  --light-bg: #f8f9fa;
  --text-dark: #2d3436;
  --border-color: #dfe6e9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.spin-wheel-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  direction: rtl;
  min-height: 100vh;
  margin: 0px auto;
}

.wp-site-blocks {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%) !important;
}

/* قسم النموذج */
.spin-form-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spin-form-card {
  background: white;
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spin-title {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 700;
}

.spin-subtitle {
  font-size: 1.1rem;
  color: #636e72;
  margin-bottom: 2rem;
  text-align: center;
  line-height: 1.6;
}

.spin-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(214, 48, 49, 0.1);
}

.spin-submit-btn {
  padding: 1.2rem;
  background: var(--primary-red);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.spin-submit-btn:hover {
  background: var(--dark-red);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(214, 48, 49, 0.3);
}

/* قسم العجلة */
.spin-wheel-section {
  min-height: 100vh;
  background: var(--primary-red);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.wheel-container {
  position: relative;
  width: 500px;
  height: 500px;
  transition: transform 0.3s ease; /* Add transition for smooth scaling animation */
}

/* Add spinning animation class to scale up the wheel */
.wheel-container.spinning {
  transform: scale(1.15);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 40px solid white;
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

#wheelCanvas {
  display: block;
  margin: 0 auto;
}

.spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: white;
  border: 8px solid var(--primary-red);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-red);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.spin-button:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.spin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* قسم النتيجة */
.result-section {
  min-height: 100vh;
  background: var(--primary-red);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.confetti {
  position: absolute;
  width: 15px;
  height: 15px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.result-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
}

.result-wheel {
  flex-shrink: 0;
  /* إضافة position relative للمؤشر */
  position: relative;
}

/* إضافة مؤشر خاص بصفحة النتيجة */
.result-wheel .wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 40px solid white;
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

#resultWheelCanvas {
  display: block;
}

.result-info {
  color: white;
  max-width: 500px;
}

.result-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.result-text {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.prize-display {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  background: white;
  border-radius: 10px;
  padding: 0.5rem;
}

#prizeCode {
  flex: 1;
  padding: 1rem;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
}

.copy-button {
  padding: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  transition: all 0.3s ease;
  border-radius: 8px;
}

.copy-button:hover {
  background: var(--light-bg);
}

.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  padding: 1.2rem;
  background: white;
  color: var(--primary-red);
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.download-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.download-hint {
  text-align: center;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  opacity: 0.9;
  color: white;
}

/* إضافة تنسيق زر الواتساب */
.whatsapp-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  padding: 1.2rem;
  background: #25d366;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.whatsapp-button:hover {
  background: #128c7e;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* إضافة تنسيق رسالة عدم التفعيل */
.spin-wheel-inactive {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff !important;
  text-align: center;
  padding: 2rem;
}

/* إضافة تنسيقات للإشعارات الجميلة */
.spin-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.spin-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.spin-notification-content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-right: 5px solid var(--primary-red);
}

.spin-notification-error .spin-notification-content {
  border-right-color: #e74c3c;
}

.spin-notification-success .spin-notification-content {
  border-right-color: #27ae60;
}

.spin-notification-info .spin-notification-content {
  border-right-color: #3498db;
}

.spin-notification-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.spin-notification-message {
  flex: 1;
  color: var(--text-dark);
  font-size: 1rem;
  line-height: 1.5;
}

.spin-notification-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #95a5a6;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.spin-notification-close:hover {
  background: #ecf0f1;
  color: var(--text-dark);
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
  .spin-form-card {
    padding: 2rem;
  }

  .spin-title {
    font-size: 2rem;
  }

  .wheel-container {
    width: 350px;
    height: 350px;
  }

  /* Scale up more on mobile for better visibility */
  .wheel-container.spinning {
    transform: scale(1.2);
  }

  #wheelCanvas {
    width: 350px !important;
    height: 350px !important;
  }

  .result-content {
    flex-direction: column;
    gap: 2rem;
  }

  .result-title {
    font-size: 2rem;
  }

  #resultWheelCanvas {
    width: 300px !important;
    height: 300px !important;
  }

  .download-section {
    padding: 2rem 1.5rem;
    border-width: 3px;
  }

  .download-button {
    padding: 1.5rem;
    font-size: 1.2rem;
  }

  .download-hint {
    font-size: 1rem;
  }
}
