/* Reset and Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #000;
  color: #fff;
  overflow-x: hidden;
}

/* ========================================
   PAYLOAD CMS HERO BACKGROUND ANIMATION
   ======================================== */

.background-gradient-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 0;
  overflow: hidden;
}

/* Canvas Background */
.background-gradient-wrapper canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* SVG Overlay */
.svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--svg-overlay-opacity, 0.15);
}

.svg-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* CRT Scanline Overlay Effect */
.background-gradient-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://payloadcms.com/images/crt.gif");
  background-repeat: repeat;
  background-size: var(--crt-size, 256px);
  background-position: 50% 50%;
  z-index: 1;
  pointer-events: none;
  opacity: var(--crt-opacity, 0.15); /* Subtle CRT effect like Payload */
}

.background-gradient-wrapper:not(.crt-enabled)::before {
  display: none;
}

/* ========================================
   SAMPLE HERO CONTENT (OPTIONAL)
   ======================================== */

.hero-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 4rem;
  max-width: 600px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.preset-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
  max-width: 400px;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 300ms ease;
  cursor: pointer;
  font-family: inherit;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.preset-btn:active {
  transform: translateY(0);
}

/* Primary Button (Command Line Style) */
.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  overflow: hidden;
  height: 56px;
}

.primary-btn .default-label,
.primary-btn .hover-label {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  transition: transform 450ms cubic-bezier(0.165, 0.84, 0.44, 1);
}

.primary-btn .default-label {
  position: relative;
}

.primary-btn .hover-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  color: #000;
  transform: translateY(100%);
}

.primary-btn:hover .default-label {
  transform: translateY(-100%);
}

.primary-btn:hover .hover-label {
  transform: translateY(0);
}

/* Secondary Button */
.secondary-btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 300ms ease;
}

.secondary-btn:hover {
  background: #fff;
  color: #000;
}

/* ========================================
   GRADIENT CONTROLS OVERLAY
   ======================================== */

.control-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.control-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.controls-overlay {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 999;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.controls-overlay.active {
  right: 0;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10;
}

.controls-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.close-controls {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.close-controls:hover {
  background: rgba(255, 255, 255, 0.1);
}

.controls-content {
  padding: 1rem 1.25rem;
}

.control-section {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  padding: 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.accordion-header:hover {
  color: rgba(255, 255, 255, 1);
}

.accordion-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.6);
}

.control-section.collapsed .accordion-icon {
  transform: rotate(-90deg);
}

.accordion-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.control-section.collapsed .accordion-content {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.control-group {
  margin-bottom: 0.875rem;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.control-group label input[type="checkbox"] {
  margin-right: 0.5rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.value-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  min-width: 55px;
  text-align: right;
  cursor: text;
  transition: all 0.2s ease;
}

.value-display:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.value-display:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

/* Slider Styles */
.slider {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Select Control */
.select-control {
  width: 100%;
  padding: 0.625rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.select-control:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.select-control:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.select-control option {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem;
}

/* Color Picker */
.color-picker {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

/* Preset Buttons */
.preset-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.preset-btn {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.preset-btn:active {
  transform: translateY(0);
}

/* Reset Button */
.control-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.reset-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.reset-btn:active {
  transform: translateY(0);
}

.export-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 4px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.6);
  transform: translateY(-1px);
}

.export-btn:active {
  transform: translateY(0);
}

.settings-export-textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

.settings-export-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Scrollbar Styling */
.controls-overlay::-webkit-scrollbar {
  width: 8px;
}

.controls-overlay::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.controls-overlay::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.controls-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .hero-content {
    padding: 2rem 1.5rem;
  }
  
  .preset-buttons-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 100%;
  }

  .preset-btn {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .primary-btn,
  .secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .controls-overlay {
    width: 100%;
    right: -100%;
  }

  .control-toggle {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
}

