/**
 * AI 상품명 생성기 - 커스텀 스타일
 * Tailwind CSS 보완용
 */

/* 기본 스타일 */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
    Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR',
    'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 폼 요소 스타일 */
input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 체크박스 스타일 */
input[type="checkbox"] {
  accent-color: #6366f1;
}

/* 결과 카드 스타일 */
.result-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 16px;
  transition: all 0.2s ease;
}

.result-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.result-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #374151;
}

.result-card-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #f3f4f6;
  color: #6b7280;
}

.result-card-badge.valid {
  background: #dcfce7;
  color: #166534;
}

.result-card-badge.invalid {
  background: #fee2e2;
  color: #991b1b;
}

.result-card-content {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #1f2937;
  word-break: keep-all;
}

.result-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.result-card-validation {
  font-size: 12px;
  color: #6b7280;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: #6366f1;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: #4f46e5;
}

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

/* GEO 점수 배지 */
.geo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

.geo-badge.applied {
  background: #dcfce7;
  color: #166534;
}

.geo-badge.not-applied {
  background: #f3f4f6;
  color: #9ca3af;
}

/* 인증 체크박스 스타일 */
.cert-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.cert-checkbox:hover {
  background: #f3f4f6;
}

.cert-checkbox input {
  width: 16px;
  height: 16px;
}

.cert-checkbox.checked {
  background: #fef3c7;
  border-color: #f59e0b;
}

/* Toast 스타일 */
#toast.success {
  background: #10b981;
  color: white;
}

#toast.error {
  background: #ef4444;
  color: white;
}

#toast.info {
  background: #6366f1;
  color: white;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* 로딩 애니메이션 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* AI 질문 리스트 */
#aiQuestionsList li {
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

#aiQuestionsList li:last-child {
  border-bottom: none;
}

#aiQuestionsList li::before {
  content: '💬 ';
}

/* 반응형 조정 */
@media (max-width: 640px) {
  .result-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .result-card-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .copy-btn {
    justify-content: center;
  }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 섹션 접기/펼치기 (향후 확장용) */
.section-collapsible {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* 포커스 표시 개선 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* 드래그 방지 (결과 텍스트) */
.result-card-content {
  user-select: all;
}

/* 툴팁 컨테이너 */
.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

/* 물음표 아이콘 */
.tooltip-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  transition: all 0.2s ease;
}

.tooltip-icon:hover {
  background: #6366f1;
  color: white;
}

/* 툴팁 텍스트 */
.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 280px;
  padding: 12px;
  background: #1f2937;
  color: white;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  transition: all 0.2s ease;
}

/* 툴팁 화살표 */
.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

/* 호버 시 표시 */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== SNS 공유 버튼 스타일 ===== */

/* 공유 드롭다운 컨테이너 */
.share-dropdown-container {
  position: relative;
}

/* 공유 버튼 */
.share-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  color: #374151;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* 공유 드롭다운 */
.share-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}

.share-dropdown.hidden {
  display: none;
}

/* 공유 옵션 버튼 */
.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s ease;
}

.share-option:hover {
  background: #f3f4f6;
}

/* 공유 아이콘 */
.share-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
}

.share-icon.twitter {
  background: #000;
  color: white;
}

.share-icon.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.share-icon.link {
  background: #6366f1;
  color: white;
}

/* 웹사이트 공유 모달 버튼 */
.share-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-modal-btn.twitter-btn {
  background: #000;
  color: white;
}

.share-modal-btn.twitter-btn:hover {
  background: #333;
}

.share-modal-btn.instagram-btn {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
}

.share-modal-btn.instagram-btn:hover {
  opacity: 0.9;
}

.share-modal-btn.link-btn {
  background: #6366f1;
  color: white;
}

.share-modal-btn.link-btn:hover {
  background: #4f46e5;
}

/* 모바일 반응형 */
@media (max-width: 640px) {
  .share-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    min-width: 100%;
  }

  .share-option {
    padding: 16px 20px;
  }
}

/* ===== 헤더 버튼 스타일 ===== */

.header-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.4);
}
