/* ========================================
   SpinWheel CMS - Frontend Styles
   ======================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:      #07071a;
  --bg-card:      rgba(255,255,255,0.04);
  --accent:       #ff2d55;
  --accent2:      #ffce00;
  --accent3:      #7c3aed;
  --text:         #f0f0f0;
  --text-muted:   rgba(255,255,255,0.5);
  --border:       rgba(255,255,255,0.08);
  --shadow:       0 8px 40px rgba(0,0,0,0.6);
  --glow:         0 0 30px rgba(255,45,85,0.5);
  --glow-gold:    0 0 30px rgba(255,206,0,0.6);
  --glow-purple:  0 0 30px rgba(124,58,237,0.5);
  --radius:       1.1rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 10% 0%,   rgba(124,58,237,0.28) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(255,45,85,0.22)  0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%,  rgba(7,7,26,0.9)      0%, transparent 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 1.25rem 1rem 1rem;
  position: relative;
}
.site-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent3), transparent);
  margin-top: 1rem;
  opacity: 0.5;
}
.site-logo {
  max-height: 72px;
  max-width: 260px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255,45,85,0.65)) drop-shadow(0 0 40px rgba(124,58,237,0.4));
}
.site-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  filter: drop-shadow(0 0 12px rgba(255,45,85,0.4));
}

/* ---------- Main Layout ---------- */
.main-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Side Panel (left) ---------- */
.side-panel {
  flex: 1 1 300px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.spin-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 25%, var(--accent2) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 12px rgba(255,206,0,0.45));
}

.spin-subheading {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Voucher Box ---------- */
.voucher-box {
  background: var(--bg-card);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(124,58,237,0.1), inset 0 1px 0 rgba(255,255,255,0.04);
}

.voucher-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 0.6rem;
}

.voucher-input-wrap {
  display: flex;
  gap: 0.5rem;
}

.voucher-input {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.voucher-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,69,96,0.2);
}
.voucher-input::placeholder { font-weight: 400; text-transform: none; letter-spacing: 0; color: rgba(255,255,255,0.3); }

.btn-validate {
  background: linear-gradient(135deg, var(--accent3), #5b21b6);
  border: none;
  border-radius: 0.7rem;
  padding: 0.75rem 1.1rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(124,58,237,0.4);
}
.btn-validate:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(124,58,237,0.65); }
.btn-validate:active { transform: translateY(0); }
.btn-validate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.voucher-msg {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1em;
}
.voucher-msg.success { color: #2ecc71; }
.voucher-msg.error   { color: #e74c3c; }
.voucher-msg.loading { color: var(--accent2); }

/* ---------- Voucher Badge ---------- */
.voucher-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(46,204,113,0.15);
  border: 1px solid rgba(46,204,113,0.4);
  border-radius: 2rem;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2ecc71;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}
.voucher-badge .fa-ticket { color: #2ecc71; }

/* ---------- Spin Button ---------- */
#spinArea {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.btn-spin {
  background: linear-gradient(135deg, var(--accent2), #ff8c00);
  border: none;
  border-radius: 0.9rem;
  padding: 1rem 2.2rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: #1a0a00;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 25px rgba(255,206,0,0.5), 0 1px 0 rgba(255,255,255,0.25) inset;
  transition: transform 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  letter-spacing: 1.5px;
}
.btn-spin::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: rgba(255,255,255,0.2);
  transform: skewX(-20deg);
  transition: left 0.4s;
}
.btn-spin:hover::before { left: 150%; }
.btn-spin:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 35px rgba(255,206,0,0.7); }
.btn-spin:active { transform: scale(0.97); }
.btn-spin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- Contact Buttons ---------- */
.contact-area {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.contact-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.contact-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-contact:hover { transform: translateY(-2px); }

.btn-wa {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}
.btn-wa:hover { box-shadow: 0 6px 20px rgba(37,211,102,0.5); color: #fff; }

.btn-livechat {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  color: #fff;
  box-shadow: 0 4px 15px rgba(78,84,200,0.3);
}
.btn-livechat:hover { box-shadow: 0 6px 20px rgba(78,84,200,0.5); color: #fff; }

.btn-lg-contact {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ---------- Wheel Panel (right) ---------- */
.wheel-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-outer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #ff1a3a;
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(255,0,0,0.9)) drop-shadow(0 0 16px rgba(255,50,50,0.7));
}

#wheelCanvas {
  display: block;
  filter:
    drop-shadow(0 0 20px rgba(255,45,85,0.45))
    drop-shadow(0 0 50px rgba(124,58,237,0.35))
    drop-shadow(0 8px 30px rgba(0,0,0,0.8));
  border-radius: 50%;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ========================================
   MODAL HASIL
   ======================================== */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.result-modal {
  background: linear-gradient(145deg, #0d0d24, #1a0a2e);
  border: 1.5px solid rgba(124,58,237,0.45);
  border-radius: 1.75rem;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(124,58,237,0.3), 0 0 120px rgba(255,45,85,0.1), var(--shadow);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.result-modal.zonk {
  border-color: rgba(255,100,50,0.45);
  box-shadow: 0 0 60px rgba(255,100,50,0.2), var(--shadow);
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.result-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  animation: bounce 0.8s ease 0.4s both;
}
@keyframes bounce {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.result-title {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}
.result-title.zonk-title {
  background: linear-gradient(90deg, #ff7043, #ff5252);
  -webkit-background-clip: text;
  background-clip: text;
}

.result-prize {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  margin-bottom: 0.75rem;
}

.result-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ---------- Loader ---------- */
.loader-dots {
  display: inline-flex;
  gap: 4px;
}
.loader-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  animation: dotPulse 1.2s ease-in-out infinite both;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column-reverse;
    gap: 1.25rem;
    padding: 1rem;
  }
  .side-panel { max-width: 100%; }
  #wheelCanvas { max-width: min(85vw, 340px); }
  .wheel-pointer { font-size: 2.2rem; }
  .btn-spin { width: 100%; }
  .spin-heading { font-size: 2rem; }
}

@media (max-width: 400px) {
  .voucher-input-wrap { flex-direction: column; }
  .btn-validate { width: 100%; }
}
