/**********************************************
 * CSS 그라데이션 생성기 컨테이너
 **********************************************/
.gradient-generator {
  margin: 20px auto !important;
  padding: 30px !important;
  background: #f8fafc !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1180px !important;
  font-family: 'Noto Sans KR', Arial, sans-serif !important;
  color: #334155 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

@media screen and (max-width: 768px) {
  .gradient-generator {
    padding: 15px 8px !important;
    margin: 10px auto !important;
    border-radius: 8px !important;
  }
}

.generator-title {
  text-align: center !important;
  font-size: 1.9em !important;
  margin-bottom: 5px !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

.generator-description {
  text-align: center !important;
  font-size: 0.97em !important;
  margin-bottom: 25px !important;
  color: #64748b !important;
}

/**********************************************
 * 생성기 레이아웃
 **********************************************/
.generator-layout {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
  margin-bottom: 20px !important;
}

.controls-section {
  flex: 1 !important;
  min-width: 320px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.output-section {
  flex: 1 !important;
  min-width: 320px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.section-title {
  font-size: 1.25em !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
  color: #0f172a !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid #f1f5f9 !important;
}

/**********************************************
 * 컨트롤 그룹
 **********************************************/
.control-group {
  margin-bottom: 20px !important;
  position: relative !important;
}

.control-group label {
  display: block !important;
  margin-bottom: 8px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  font-size: 1.1em !important;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group select {
  width: 100% !important;
  padding: 10px 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  color: #334155 !important;
  background: #fff !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05) !important;
}

.control-group input[type="text"]:focus,
.control-group input[type="number"]:focus,
.control-group select:focus {
  border-color: #2563eb !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/**********************************************
 * 그라데이션 유형 선택
 **********************************************/
.type-selector {
  display: flex !important;
  gap: 8px !important;
  margin-bottom: 10px !important;
}

.type-btn {
  flex: 1 !important;
  padding: 8px 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 1em !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.type-btn:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

.type-btn.active {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

/**********************************************
 * 각도 및 방향 컨트롤
 **********************************************/
.angle-control {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  margin-bottom: 10px !important;
}

.angle-control input[type="range"] {
  flex: 1 !important;
  -webkit-appearance: none !important;
  height: 6px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  outline: none !important;
}

.angle-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.angle-control input[type="range"]::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  border: none !important;
}

.angle-value {
  display: flex !important;
  align-items: center !important;
  min-width: 60px !important;
  white-space: nowrap !important;
}

.angle-value input {
  width: 50px !important;
  padding: 4px 6px !important;
  text-align: center !important;
  margin-right: 2px !important;
}

.direction-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 5px !important;
  margin-top: 10px !important;
}

.direction-btn {
  padding: 8px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 1.2em !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.direction-btn:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

.direction-btn.active {
  background: #dbeafe !important;
  color: #2563eb !important;
  border-color: #93c5fd !important;
}

/**********************************************
 * 모양 선택
 **********************************************/
.shape-selector {
  display: flex !important;
  gap: 8px !important;
  margin-bottom: 15px !important;
}

.shape-btn {
  flex: 1 !important;
  padding: 8px 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 1em !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.shape-btn:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

.shape-btn.active {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

.position-control {
  margin-bottom: 15px !important;
}

/**********************************************
 * 색상 정지점
 **********************************************/
.color-stops-container {
  margin-bottom: 10px !important;
}

.color-stops {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 15px !important;
  margin-bottom: 10px !important;
}

.color-stop {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.color-stop:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.color-picker-container {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
}

.color-preview {
  width: 32px !important;
  height: 32px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  border: 1px solid #cbd5e1 !important;
}

.color-input {
  flex: 1 !important;
  padding: 8px 10px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  color: #334155 !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important;
}

.color-position {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  width: 80px !important;
}

.color-position input {
  width: 50px !important;
  padding: 8px !important;
  text-align: center !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 1em !important;
}

.color-position span {
  color: #64748b !important;
}

.remove-color {
  background: none !important;
  border: none !important;
  color: #ef4444 !important;
  cursor: pointer !important;
  font-size: 1.2em !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  transition: all 0.2s !important;
}

.remove-color:hover {
  background: #fef2f2 !important;
}

.add-color-btn {
  width: 100% !important;
  padding: 8px !important;
  background: #dbeafe !important;
  color: #2563eb !important;
  border: 1px dashed #93c5fd !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.add-color-btn:hover {
  background: #bfdbfe !important;
}

/**********************************************
 * 프리셋 그라데이션
 **********************************************/
.presets-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
}

@media (max-width: 768px) {
  .presets-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

.preset {
  height: 40px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid #e2e8f0 !important;
}

.preset:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15) !important;
}

/**********************************************
 * 체크박스 그룹
 **********************************************/
.checkbox-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.checkbox-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 1em !important;
  color: #334155 !important;
  cursor: pointer !important;
}

.checkbox-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: #2563eb !important;
}

/**********************************************
 * 미리보기 영역
 **********************************************/
.preview-container {
  margin-bottom: 20px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.preview-tabs {
  display: flex !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.preview-tab {
  padding: 10px 15px !important;
  background: transparent !important;
  border: none !important;
  font-size: 1em !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
}

.preview-tab:hover {
  color: #334155 !important;
}

.preview-tab.active {
  background: #fff !important;
  color: #2563eb !important;
  font-weight: 500 !important;
  box-shadow: inset 0 2px 0 #2563eb !important;
}

.preview-area {
  height: 200px !important;
  position: relative !important;
}

.preview-item {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: none !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.preview-item.active {
  display: flex !important;
}

.preview-background {
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px !important;
}

.preview-button {
  padding: 12px 24px !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  font-weight: 500 !important;
  color: #fff !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.preview-text {
  font-size: 2em !important;
  font-weight: 700 !important;
  text-align: center !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  color: transparent !important;
}

.preview-border {
  padding: 20px !important;
  border-width: 4px !important;
  border-style: solid !important;
  border-radius: 8px !important;
  font-size: 1em !important;
  text-align: center !important;
  background: white !important;
}

/**********************************************
 * 코드 출력 영역
 **********************************************/
.code-container {
  margin-bottom: 20px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.code-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 10px 15px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.code-header span {
  font-weight: 500 !important;
  color: #334155 !important;
}

.copy-btn {
  padding: 6px 12px !important;
  background: #2563eb !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  font-size: 0.9em !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.copy-btn:hover {
  background: #1d4ed8 !important;
}

.copy-btn.copied {
  background: #10b981 !important;
}

.code-area {
  padding: 15px !important;
  background: #fff !important;
  overflow-x: auto !important;
  max-height: 200px !important;
}

.code-area pre {
  margin: 0 !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-size: 0.9em !important;
  line-height: 1.5 !important;
  color: #334155 !important;
  white-space: pre-wrap !important;
}

/**********************************************
 * 사용 정보
 **********************************************/
.usage-info {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 15px !important;
}

.usage-info h4 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  font-size: 1.1em !important;
  color: #0f172a !important;
}

.usage-info ul {
  margin: 0 0 0 20px !important;
  padding: 0 !important;
}

.usage-info li {
  margin-bottom: 5px !important;
  color: #334155 !important;
}

.usage-info code {
  background: #f1f5f9 !important;
  padding: 2px 5px !important;
  border-radius: 4px !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  color: #2563eb !important;
  font-size: 0.9em !important;
}

/**********************************************
 * 팁 섹션
 **********************************************/
.info-section {
  margin-top: 30px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.tip-cards {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
}

.tip-card {
  flex: 1 !important;
  min-width: 250px !important;
  background: #f8fafc !important;
  padding: 15px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
}

.tip-card h4 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  font-size: 1.1em !important;
  color: #0f172a !important;
}

.tip-card p {
  margin: 0 !important;
  color: #334155 !important;
  font-size: 0.95em !important;
  line-height: 1.5 !important;
}

/**********************************************
 * 면책 조항
 **********************************************/
.disclaimer {
  margin-top: 20px !important;
  font-size: 0.9em !important;
  color: #64748b !important;
  text-align: center !important;
}

.disclaimer p {
  margin: 5px 0 !important;
}

/**********************************************
 * 모바일 대응
 **********************************************/
@media screen and (max-width: 1000px) {
  .controls-section, 
  .output-section {
    flex: 1 1 100% !important;
  }
  
  .tip-card {
    min-width: 100% !important;
  }
}

@media screen and (max-width: 768px) {
  .preview-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
  
  .presets-container {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  .color-stop {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .color-picker-container {
    width: 100% !important;
  }
  
  .color-position {
    width: 100% !important;
    justify-content: space-between !important;
    margin-top: 5px !important;
  }
  
  .remove-color {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
  }
}

@media screen and (max-width: 480px) {
  .controls-section, 
  .output-section,
  .info-section {
    padding: 15px 12px !important;
  }
  
  .angle-control {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .angle-value {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  
  .direction-buttons {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  .presets-container {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/**********************************************
 * Pickr 색상 선택기 커스텀 스타일
 **********************************************/
.pickr {
  position: relative !important;
  overflow: visible !important;
  z-index: 1 !important;
}

.pcr-app {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
  border-radius: 8px !important;
}