/* Widget Guide CSS - 메인페이지 스타일 적용 */
.hero-background {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  position: relative;
  overflow: hidden;
}

.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50" cy="50" r="50"><stop offset="0" stop-color="%23FFF" stop-opacity=".1"/><stop offset="1" stop-color="%23FFF" stop-opacity="0"/></radialGradient></defs><rect fill="url(%23a)" width="100" height="20"/></svg>');
  opacity: 0.3;
}

/* 메인페이지 스타일의 히어로 아이콘 */
.hero-icon {
  font-size: 8rem;
  opacity: 0.8;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 그라디언트 텍스트 */
.bg-gradient-to-r {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.from-yellow-400 {
  --tw-gradient-from: #fbbf24;
}

.to-orange-400 {
  --tw-gradient-to: #fb923c;
}

.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

.text-transparent {
  color: transparent;
}

.widget-preview {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.widget-preview:hover {
  border-color: #3b82f6;
  background: #f1f5f9;
}

.feature-card {
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* PC 화면에서 실시간 미리보기 개선 - 메인페이지 스타일 적용 */
@media (min-width: 1024px) {
  .preview-sticky {
    position: sticky !important;
    top: 2rem !important;
    height: fit-content !important;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    will-change: transform;
    transform: translateZ(0);
  }

  .preview-stage {
    min-height: 200px !important;
    max-height: 280px;
    height: auto;
  }
}

/* 메인페이지 스타일의 버튼 */
.btn-primary-custom {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  color: white;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
  color: white;
}

.btn-success-custom {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  color: white;
}

.btn-success-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  color: white;
}

/* 메인페이지 스타일의 카드 */
.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid #f3f4f6;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 그라디언트 배경 클래스 */
.bg-gradient-to-br {
  background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
}

.from-blue-50 {
  --tw-gradient-from: #eff6ff;
}

.to-indigo-50 {
  --tw-gradient-to: #e0e7ff;
}

.bg-gradient-to-r {
  background: linear-gradient(90deg, var(--tw-gradient-from), var(--tw-gradient-to));
}

.from-blue-500 {
  --tw-gradient-from: #3b82f6;
}

.to-blue-700 {
  --tw-gradient-to: #1d4ed8;
}

.from-green-500 {
  --tw-gradient-from: #10b981;
}

.to-green-700 {
  --tw-gradient-to: #059669;
}

.from-yellow-500 {
  --tw-gradient-from: #eab308;
}

.to-orange-500 {
  --tw-gradient-to: #f97316;
}

.from-purple-500 {
  --tw-gradient-from: #8b5cf6;
}

.to-purple-700 {
  --tw-gradient-to: #7c3aed;
}

.from-purple-500.to-pink-500 {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
}

/* 코드 생성 섹션 반응형 최적화 */
.code-container {
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

.code-content {
  max-width: 100%;
  width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-break: anywhere;
}

/* 코드 생성 영역 전체 폭 확장 */
#generatedSimpleCode {
  width: 100%;
  max-width: none;
}

/* 데스크톱에서 코드 영역을 전체 폭으로 확장 */
@media (min-width: 1024px) {
  #generatedSimpleCode {
    grid-column: 1 / -1; /* 전체 그리드 폭 사용 */
    margin-top: 3rem;
  }
  
  .code-container {
    min-width: 100%;
    max-width: 100%;
  }
  
  .code-content {
    min-height: 120px;
    font-size: 0.875rem;
    padding: 2rem;
    line-height: 1.6;
  }
  
  /* PC에서 코드 헤더 패딩 조정 */
  .code-container .flex.items-center.justify-between {
    padding: 1rem 2rem;
  }
  
  /* PC에서 설치 안내 패딩 조정 */
  .bg-blue-50.border.border-blue-200 {
    padding: 1.5rem 2rem;
  }
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .code-content {
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 1rem;
  }
  
  .copy-btn .copy-text {
    display: none;
  }
  
  .code-container {
    border-radius: 0.5rem;
  }
  
  /* 모바일에서 코드 가독성 향상 */
  pre {
    font-size: 12px;
    line-height: 1.3;
  }
  
  /* 모바일 설치 안내 최적화 */
  .bg-blue-50 {
    padding: 1rem;
  }
  
  .bg-blue-50 h4 {
    font-size: 1rem;
  }
  
  .bg-blue-50 p {
    font-size: 0.875rem;
  }
  
  /* 모바일 성공 헤더 최적화 */
  .bg-gradient-to-r h3 {
    font-size: 1.125rem;
  }
  
  .bg-gradient-to-r p {
    font-size: 0.875rem;
  }
}

/* 태블릿 최적화 */
@media (min-width: 769px) and (max-width: 1023px) {
  .code-content {
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1.5rem;
  }
  
  #generatedSimpleCode {
    grid-column: 1 / -1; /* 태블릿에서도 전체 폭 사용 */
    margin-top: 2rem;
  }
  
  .code-container {
    width: 100%;
  }
}

/* 데스크톱 최적화 */
@media (min-width: 1025px) {
  .code-content {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

/* 위젯 설정 입력창 정렬 최적화 */
.widget-settings-section .row.g-4 {
  align-items: flex-start;
}

.widget-settings-section .col-md-6 {
  display: flex;
  flex-direction: column;
}

.widget-settings-section .mb-3 {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem !important;
}

.widget-settings-section .form-label {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.widget-settings-section .form-control,
.widget-settings-section .form-select {
  min-height: 44px;
  font-size: 0.95rem;
}

.widget-settings-section small {
  margin-top: 0.25rem;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* 버튼 스타일 섹션 공백 최적화 */
.widget-settings-section .mt-4.pt-4.border-top {
  margin-top: 1.5rem !important;
  padding-top: 1.5rem !important;
}

.widget-settings-section .mt-4.pt-3.border-top {
  margin-top: 1rem !important;
  padding-top: 1rem !important;
}

/* 데스크톱에서 컬럼 높이 최적화 */
@media (min-width: 768px) {
  .widget-settings-section .col-md-6 {
    min-height: auto;
  }
  
  .widget-settings-section .mb-3 {
    margin-bottom: 1.25rem !important;
  }
  
  /* 외관 설정 섹션 간격 조정 */
  .widget-settings-section h4.h6 {
    margin-bottom: 1rem !important;
  }
}

/* 코드 컨테이너 호버 효과 */
.code-container:hover {
  transform: translateY(-1px);
}

/* 복사 버튼 개선 */
.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 태블릿 화면에서의 조정 */
@media (min-width: 768px) and (max-width: 991px) {
  .preview-section {
    margin-top: 2rem;
  }
}

/* 모바일 화면에서의 조정 */
@media (max-width: 767px) {
  .preview-section {
    margin-top: 2rem;
  }

  .widget-settings-section .row {
    margin-bottom: 1rem;
  }

  .style-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.btn-primary-custom {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  color: white;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
  color: white;
}

.btn-success-custom {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  color: white;
}

.btn-success-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  color: white;
}

.custom-alert {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

.step-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem;
  transition: all 0.3s ease;
}

.step-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.step-number {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.step-number-small {
  width: 1.5rem;
  height: 1.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.style-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
  border-color: #3b82f6 !important;
}

.style-option.selected {
  border-color: #3b82f6 !important;
  background: #f1f5f9 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2) !important;
}

.preview-button:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
}

/* 간단한 스타일 선택 카드 */
.style-card {
  display: block;
  position: relative;
}

.style-card:hover .style-content {
  border-color: #3b82f6 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.style-radio:checked + .style-content {
  border-color: #3b82f6 !important;
  background: #f8fafc !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.style-radio:checked + .style-content .style-name {
  color: #3b82f6 !important;
  font-weight: 700 !important;
}

/* 스타일 그리드 간격 최적화 */
.style-grid {
  gap: 0.5rem !important;
  margin-bottom: 0 !important;
}

.style-content {
  padding: 0.5rem !important;
  font-size: 0.85rem;
}

.style-preview {
  width: 28px !important;
  height: 4px !important;
  margin-bottom: 0.5rem !important;
}

.style-name {
  font-size: 0.75rem !important;
  line-height: 1.2;
}

/* 미리보기 영역 최적화 */
.preview-stage:hover {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
}

/* 부모 컨테이너 overflow 수정 (sticky 작동을 위해 필수) */
.container-fluid {
  overflow: visible !important;
}

/* Grid 레이아웃 정렬 수정 */
.row.g-4 {
  align-items: flex-start !important;
}

/* 새로운 프로세스 및 특징 카드 스타일 */
.feature-highlight:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.step-circle {
  position: relative;
  transition: all 0.3s ease;
}

.step-circle:hover {
  transform: scale(1.1);
}

/* 애니메이션 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* 미리보기 영역 개선 */
.preview-stage {
  position: relative;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.preview-stage:hover {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* PC에서 고정 너비 보장 */
@media (min-width: 992px) {
  .preview-sticky {
    width: 100%;
    max-width: none;
  }
}

.feature-icon {
  transition: all 0.3s ease;
}

.feature-icon:hover {
  transform: rotate(5deg) scale(1.1);
}

/* 모바일 반응형 최적화 */
@media (max-width: 767px) {
  .style-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .style-content {
    padding: 0.75rem !important;
  }

  .style-preview {
    width: 32px !important;
    height: 5px !important;
  }

  .style-name {
    font-size: 0.8rem !important;
  }

  .preview-stage {
    min-height: 150px !important;
  }

  .preview-info {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 1199px) {
  .style-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
