@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap");

.gradient-tool-active {
  background-color: #fff;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.gradient-tool-active body,
.gradient-tool-active #root {
  background-color: #fff;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  font-family: "IBM Plex Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.gradient-tool {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  font-family: "IBM Plex Mono", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 0;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.hero-text {
  position: fixed;
  z-index: 100;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(80px, 8vw, 120px);
  font-weight: 700 !important;
  line-height: 1.05;
  pointer-events: none;
  white-space: pre-wrap;
  max-width: 80%;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.hero-text.text-black { color: #000; }
.hero-text.text-white { color: #fff; }

.hero-text.center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
}

.hero-text.tl {
  top: 52px !important;
  left: 52px !important;
  bottom: auto !important;
  transform: none !important;
  text-align: left !important;
}

.hero-text.bl {
  bottom: 52px !important;
  left: 52px !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  text-align: left !important;
}

.control-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 260px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  z-index: 2000;
  cursor: move;
  user-select: none;
  will-change: transform;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.control-panel.dragging { cursor: grabbing; }

.panel-section { margin-bottom: 20px; }
.panel-section:last-child { margin-bottom: 0; }

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

.section-title {
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  color: #000;
  margin: 0;
  line-height: 1;
  letter-spacing: 1px;
}

.reset-button {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-button:hover { color: #000; }

.color-swatches {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.color-swatch {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0;
  overflow: hidden;
}

.color-swatch::-webkit-color-swatch-wrapper { padding: 0; border: none; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 50%; }
.color-swatch::-moz-color-swatch { border: none; border-radius: 50%; }
.color-swatch:hover { transform: scale(1.05); }
.color-swatch:active { transform: scale(0.95); }

.action-buttons { display: flex; gap: 8px; }

.action-btn {
  flex: 1;
  padding: 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  color: #000;
  letter-spacing: 1px;
}

.action-btn:hover { opacity: 0.9; }
.action-btn:focus,
.action-btn:focus-visible { background: #f5f5f5; }

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

.control-value {
  font-size: 16px;
  font-weight: 500;
  color: #666;
  letter-spacing: 1px;
}

.slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

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

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

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

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

.text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
  line-height: 1.4;
  margin-bottom: -2px;
}

.text-input:focus { border-color: #000; }
.text-input::placeholder { color: #999; }

.text-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.position-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.text-color-toggle {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.text-color-toggle.black { background: #f5f5f5; }
.text-color-toggle.white { background: #000; }

.toggle-knob {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 3px;
  transition: left 0.2s ease, background-color 0.2s ease;
  will-change: left, background-color;
}

.text-color-toggle.black .toggle-knob {
  background: #000;
  left: 3px;
}

.text-color-toggle.white .toggle-knob {
  background: #fff;
  left: 23px;
}

.position-btn {
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  color: #999;
  transition: color 0.2s ease;
  text-decoration: none;
  letter-spacing: 1px;
}

.position-btn:hover { color: #666; }
.position-btn.active {
  color: #000;
  text-decoration: underline;
}

.ratio-dropdown {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 100px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  letter-spacing: 1px;
}

.ratio-dropdown:hover { border-color: #999; }
.ratio-dropdown:focus { border-color: #000; }

.download-dropdown {
  position: relative;
  width: 100%;
}

.download-button {
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  transition: opacity 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 1px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.download-button:hover { opacity: 0.9; }
.download-button:active { transform: scale(0.98); }
.download-button:disabled { cursor: wait; }

.download-dropdown.active .download-button {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 7L6 2L11 7' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.download-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  color: #000;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  letter-spacing: 1px;
}

.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f5f5f5; }
.dropdown-item:active { background: #e8e8e8; }

@media (max-width: 1024px) {
  .hero-text { font-size: clamp(60px, 8vw, 100px); }
}

@media (max-width: 768px) {
  .control-panel {
    width: calc(100vw - 40px);
    max-width: 260px;
  }
  .hero-text {
    font-size: clamp(40px, 10vw, 80px);
    padding: 0 20px;
  }
  .hero-text.tl,
  .hero-text.bl { left: 20px; }
  .hero-text.tl { top: 20px; }
  .hero-text.bl { bottom: 20px; }
}

