/* Settings Button and Panel */
#settings-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  animation: pulse 2s infinite;
}

#settings-button:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#settings-button i {
  font-size: 24px;
  color: white;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.7);
  }
}

/* Settings Panel */
#settings-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 320px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 999;
}

#settings-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-header i {
  font-size: 20px;
  color: #667eea;
}

.settings-close {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.settings-section {
  margin-bottom: 20px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 600;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.settings-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.settings-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
}

.settings-option-label i {
  font-size: 18px;
  color: #667eea;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch.active::after {
  left: 22px;
}

/* Background Preview */
.background-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-option {
  flex: 1;
  min-width: 80px;
  height: 60px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.preview-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preview-option.active {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.preview-option-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 4px;
  text-align: center;
  font-weight: 500;
}

/* Preview Styles */
.preview-default {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
}

.preview-grid {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
  position: relative;
}

.preview-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(102, 126, 234, 0.1) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.preview-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 159, 252, 0.3) 50%,
    transparent 100%
  );
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  #settings-panel {
    width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
  }

  #settings-button {
    bottom: 80px;
  }
}

/* Lightning Preview */
.preview-lightning {
  background: linear-gradient(135deg, #0a0f1a 0%, #1a1f2e 100%);
  position: relative;
  overflow: hidden;
}

.preview-lightning::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 212, 255, 0.3) 0%,
    transparent 70%
  );
  animation: lightning-pulse 2s ease-in-out infinite;
}

.preview-lightning::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 212, 255, 0.8) 50%,
    transparent 100%
  );
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

@keyframes lightning-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Dot Grid Preview */
.preview-dotgrid {
  background: linear-gradient(135deg, #0f0a1a 0%, #1a0f2e 100%);
  position: relative;
  overflow: hidden;
}

.preview-dotgrid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #5227ff 1px, transparent 1px);
  background-size: 15px 15px;
  opacity: 0.6;
}

.preview-dotgrid::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: radial-gradient(
    circle,
    rgba(82, 39, 255, 0.6) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  animation: dotgrid-pulse 2s ease-in-out infinite;
}

@keyframes dotgrid-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 1;
  }
}

/* Squares Preview */
.preview-squares {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
  position: relative;
  overflow: hidden;
}

.preview-squares::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#4a5568 1px, transparent 1px),
    linear-gradient(90deg, #4a5568 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.6;
  animation: squares-move 10s linear infinite;
}

@keyframes squares-move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(20px, 20px);
  }
}
