/* ================================================
   WHEEL SPINNER CUSTOM STYLES
   ================================================ */

/* Theme Variables */
:root {
  --wheel-border: #fff;
  --pointer-color: #ff3b3b;
  --spin-btn-bg: #0d6efd;
}

body.dark-mode,
body[data-theme="dark"] {
  background-color: #1a1a2e !important;
  color: #eee !important;
}

body.dark-mode .card,
body.dark-mode .navbar,
body.dark-mode footer,
body[data-theme="dark"] .card,
body[data-theme="dark"] .navbar,
body[data-theme="dark"] footer {
  background-color: #16213e !important;
  color: #eee !important;
}

body.dark-mode .text-muted,
body[data-theme="dark"] .text-muted {
  color: #aaa !important;
}

body.dark-mode .border,
body[data-theme="dark"] .border {
  border-color: #2a2a4e !important;
}

/* Crypto Theme */
body[data-theme="crypto"] {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
}

body[data-theme="crypto"] .card {
  background-color: rgba(26, 31, 58, 0.9) !important;
  border-color: #f7931a;
}

body[data-theme="crypto"] .text-primary {
  color: #f7931a !important;
}

body[data-theme="crypto"] #wheel {
  border-color: #f7931a !important;
  box-shadow: 0 0 30px rgba(247, 147, 26, 0.4);
}

/* Food Theme */
body[data-theme="food"] {
  background: linear-gradient(135deg, #fff5e6 0%, #ffe4c4 100%);
}

body[data-theme="food"] #wheel {
  border-color: #ff6b35 !important;
}

body[data-theme="food"] .text-primary {
  color: #ff6b35 !important;
}

/* Creative Theme */
body[data-theme="creative"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body[data-theme="creative"] .card {
  background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Gaming Theme */
body[data-theme="gaming"] {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  color: #c9d1d9;
}

body[data-theme="gaming"] .card {
  background-color: #161b22 !important;
  color: #c9d1d9 !important;
  border-color: #58a6ff;
}


/* Wheel Container */
.wheel-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1;
  min-height: 400px;
  /* Prevents layout shift */
  border-radius: 50%;
}

.wheel-wrapper::before {
  content: '';
  display: block;
  padding-top: 100%;
  /* Creates 1:1 aspect ratio */
}

.wheel-wrapper>canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--wheel-border);
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 32px solid var(--pointer-color);
  z-index: 20;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: border-top-color 0.1s ease;
}

.spin-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--spin-btn-bg);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.spin-center-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
}

.spin-center-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Items Container */
.items-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

.item-entry {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.32rem;
  background: white;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  align-items: start;
}

.item-entry input[type="text"] {
  flex: 1;
}

.item-entry input[type="number"] {
  width: 80px;
}

.item-entry select {
  width: 120px;
}

.item-entry input[type="file"] {
  font-size: 0.875rem;
}

.item-entry .btn-danger {
  min-width: 38px;
}

/* Preset Cards */
.preset-card {
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preset-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: #667eea !important;
}

.preset-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.preset-card .preset-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
  line-height: 1;
}

.preset-card .preset-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
  margin: 0;
  line-height: 1.3;
}

.preset-card:hover .preset-title {
  color: #667eea;
}

/* Confetti Animation */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 9999;
}

/* Custom List */
.custom-list li {
  line-height: 1.8;
}

/* Feature Box Hover */
.feature-box {
  transition: transform 0.2s;
}

.feature-box:hover {
  transform: translateX(5px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .spin-center-btn {
    width: 80px;
    height: 80px;
    font-size: 1rem;
  }

  .pointer {
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 24px solid var(--pointer-color);
    top: -8px;
  }

  #wheel {
    border-width: 1px;
  }

  .item-entry {
    flex-direction: column;
  }

  .item-entry input[type="number"],
  .item-entry select {
    width: 100%;
  }

  .preset-card .preset-emoji {
    font-size: 2rem;
  }

  .preset-card .preset-title {
    font-size: 0.75rem;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Ad Container Spacing */
#bottomAd {
  z-index: 1000;
}

@media (min-width: 768px) {
  #bottomAd {
    display: none !important;
  }
}

/* SPIN MODE SELECTOR */
.spin-mode-card {
  padding: 1.5rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
}

.spin-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-color: #0d6efd;
}

.spin-mode-card.active {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  color: white;
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.3);
}

.mode-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.mode-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.spin-mode-card.active .mode-title,
.spin-mode-card.active small {
  color: white;
}

.spin-container {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive for new spin modes */
@media (max-width: 768px) {
  .forza-container {
    max-width: 100%;
    height: 300px;
  }

  .slot-container {
    gap: 10px;
    padding: 20px 10px;
    min-height: 300px;
  }

  .slot-reel {
    width: 90px;
    height: 250px;
  }

  .slot-item {
    height: 83.33px;
  }

  .slot-item-content {
    font-size: 2rem;
  }

  .lucky-container {
    max-width: 100%;
    height: 180px;
  }

  .lucky-item {
    width: 120px;
    height: 120px;
  }

  .wheel-wrapper {
    min-height: 300px;
  }
}

/* Spin button below wheels */
.spin-below-btn {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Advanced Options Styling */
.advanced-toggle {
  transition: all 0.2s ease;
}

.advanced-toggle:hover {
  transform: scale(1.05);
}

#advancedOptions {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Wheel Title Styling */
#wheelTitle {
  color: var(--primary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Preset Dropdown Styling */
#presetDropdown {
  cursor: pointer;
  transition: border-color 0.2s ease;
}

#presetDropdown:hover {
  border-color: #667eea;
}

#presetDropdown:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* Background Image Upload Buttons */
#clearBgImage {
  transition: all 0.2s ease;
}

#clearBgImage:hover {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

/* Disabled State for Controls */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Item Entry Grid Layout for Advanced Mode */
@media (min-width: 768px) {
  .item-entry {
    display: grid;
    grid-template-columns: 1fr 80px 120px auto;
    gap: 0.5rem;
    align-items: center;
  }

  .item-entry input[type="text"] {
    grid-column: 1 / 2;
  }

  .item-entry input[type="number"] {
    grid-column: 2 / 3;
    width: 80px;
  }

  .item-entry select {
    grid-column: 3 / 4;
    width: 120px;
  }

  .item-entry .btn-group {
    grid-column: 4 / 5;
  }
}
