/* JURAGAN69 Lucky Wheels - Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

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

:root {
  --primary: #ffd700;
  --secondary: #ff6b35;
  --dark: #1a1a2e;
  --darker: #0f0f1a;
  --text: #ffffff;
  --muted: #a0a0a0;
}

body.page {
  font-family: 'Poppins', 'Montserrat', sans-serif;
  background: #0a0a14;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background with gradient overlay */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: 
    linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(15, 15, 26, 0.95) 100%),
    url('https://images.unsplash.com/photo-1596838132731-3301c3fd4317?w=1920') center/cover;
  z-index: -1;
}

/* Logo Header */
.logo-header {
  text-align: center;
  padding: 20px;
  z-index: 10;
  position: relative;
}

.main-logo {
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: calc(100vh - 150px);
}

/* Wheel Container */
.wheel-container {
  position: relative;
  margin-bottom: 30px;
}

.wheel-frame {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a227, #8b6914);
  padding: 15px;
  box-shadow: 
    0 0 60px rgba(255, 215, 0, 0.4),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform var(--spin-duration, 6s) cubic-bezier(0.15, 0.85, 0.35, 1);
}

.wheel-pointer {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 50px solid #ffd700;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
  z-index: 10;
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: -48px;
  left: -20px;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 40px solid #ffec8b;
}

.wheel-center-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #b8860b);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  z-index: 5;
  font-size: 2rem;
}

.center-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 400px;
}

.spin-btn {
  width: 100%;
  padding: 18px 40px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  background: linear-gradient(135deg, #ffd700, #ffec8b, #ffd700);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 
    0 10px 30px rgba(255, 215, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.spin-btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 15px 40px rgba(255, 215, 0, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

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

.winners-btn {
  width: 100%;
  padding: 15px 30px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8b0000, #dc143c, #8b0000);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(220, 20, 60, 0.4);
  transition: all 0.3s ease;
}

.winners-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(220, 20, 60, 0.5);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Welcome Modal */
.welcome-modal {
  text-align: center;
  color: #333;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.welcome-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4a4a4a;
  margin-bottom: 20px;
  line-height: 1.4;
}

.welcome-text {
  text-align: justify;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.6;
}

.syarat-btn {
  width: 100%;
  padding: 12px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: default;
  margin-bottom: 15px;
}

.syarat-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #333;
}

.syarat-list li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.syarat-list li:last-child {
  border-bottom: none;
}

.ok-btn {
  padding: 12px 50px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ok-btn:hover {
  background: #303f9f;
}

/* Code Modal */
.code-modal {
  text-align: center;
  color: #333;
}

.code-title {
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 20px;
  color: #333;
}

.code-input {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease;
}

.code-input:focus {
  border-color: #1a237e;
}

.code-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.spin-confirm-btn {
  padding: 12px 30px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.spin-confirm-btn:hover {
  background: #303f9f;
}

.cancel-btn {
  padding: 12px 30px;
  background: #757575;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cancel-btn:hover {
  background: #616161;
}

/* Result Modal */
.result-modal {
  text-align: center;
  color: #333;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 10px;
}

.result-modal h3 {
  font-size: 2rem;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 2px 2px 0 #b8860b;
  margin-bottom: 10px;
}

.result-prize {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 15px;
}

.result-info {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
}

/* Winners Modal */
.winners-modal {
  color: #333;
}

.winners-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #333;
}

.winners-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.winner-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.winner-item:last-child {
  border-bottom: none;
}

.winner-name {
  font-weight: 600;
}

.winner-prize {
  color: #1a237e;
  font-weight: 500;
}

.no-winners {
  text-align: center;
  color: #999;
  padding: 30px;
}

/* Confetti */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* Admin Link */
.admin-link-hidden {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 1.5rem;
  opacity: 0.3;
  text-decoration: none;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.admin-link-hidden:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
  .wheel-frame {
    width: 320px;
    height: 320px;
  }
  
  .main-logo {
    max-width: 200px;
  }
  
  .welcome-title {
    font-size: 1.1rem;
  }
  
  .spin-btn {
    font-size: 1.2rem;
    padding: 15px 30px;
  }
  
  .action-buttons {
    max-width: 320px;
  }
}

/* Admin Styles */
.admin-link {
  color: var(--text);
  opacity: 0.8;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.admin-link:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.4);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  position: relative;
  z-index: 1;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0 48px 48px;
  position: relative;
  z-index: 1;
}

.layout.admin-layout {
  grid-template-columns: 1fr;
}

.card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  color: var(--muted);
  font-size: 14px;
}

.form-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

input, select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.prize-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.prize-row {
  display: grid;
  grid-template-columns: 40px 1fr 80px 90px 90px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
}

.prize-color {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
}

.status-active {
  background: rgba(125, 255, 122, 0.12);
  color: #9eff9b;
}

.status-inactive {
  background: rgba(255, 210, 102, 0.12);
  color: #ffd266;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 140px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.primary-btn, .secondary-btn {
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #ff4d79, #ff9a8b);
  color: #fff;
  box-shadow: 0 10px 25px rgba(255, 77, 121, 0.45);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 20px;
  }
  .layout {
    padding: 0 20px 32px;
  }
}
