/* 채팅 컨테이너 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px); /* 상단 메뉴 높이 고려 */
  background: white;
  position: relative;
}

/* Hide Ad Container in Generate Page */
.generate-page .generate-ad-container,
.generate-page .adsense-container,
.generate-page .adsbygoogle {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Initial View */
.initial-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  will-change: opacity, visibility, transform;
}

.initial-view.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
}

.initial-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.initial-view h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
}

.initial-view .subtitle {
  font-size: 1.125rem;
  color: #64748b;
  margin-bottom: 2rem;
}

.initial-view .system-prompt {
  font-size: 1.25rem;
  color: #1e293b;
  margin-bottom: 2rem;
}

.example-prompts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.example-prompt-btn {
  width: 100%;
  padding: 1rem;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  border-radius: 8px;
  color: #0369a1;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.example-prompt-btn:hover {
  background: #e0f2fe;
  border-color: #0369a1;
}

/* 채팅 메시지 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scroll-behavior: smooth;
  padding-bottom: 120px; /* 채팅 입력창 높이만큼 여백 추가 */
}

.message {
  margin: 1rem 0;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 90%;
  line-height: 1.5;
}

.message.user {
  background-color: #f0f9ff;
  margin-left: auto;
}

.message.assistant {
  background-color: #ffffff;
  margin-right: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 0.95rem;
}

.message.system {
  background-color: #fee2e2;
  color: #991b1b;
  margin: 1rem auto;
  text-align: center;
}

/* Chat Input */
.chat-input {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 1rem;
  z-index: 20;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.input-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
}

textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  resize: none;
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  height: 48px;
  max-height: 200px;
  transition: all 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.send-button {
  background: #0ea5e9;
  color: white;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-button:hover {
  background: #0284c7;
}

.send-button:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 30;
}

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

.toast.error {
  background: #fee2e2;
  color: #991b1b;
}

/* 설명 섹션 */
.description-container {
  margin-top: 1.5rem;
}

.description-section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.section-content {
  color: #475569;
  line-height: 1.6;
}

.list-item {
  margin: 0.5rem 0;
  padding-left: 1rem;
  position: relative;
}

.list-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #94a3b8;
}

/* Code Blocks */
code {
  background-color: #f1f5f9;
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  font-size: 0.875em;
  color: #0f172a;
}

/* 반응형 디자인 */
@media (max-width: 640px) {
  .chat-container {
    height: calc(var(--vh, 1vh) * 100 - 120px);
  }

  .initial-view {
    padding: 1rem;
  }

  .initial-view h1 {
    font-size: 1.875rem;
  }

  .message {
    padding: 1rem;
  }

  .input-wrapper {
    padding: 0 1rem;
  }

  textarea {
    font-size: 16px; /* 모바일에서 기본 16px로 설정하여 자동 확대 방지 */
    height: 40px; /* 모바일에서 더 작은 높이 */
    padding: 0.5rem 0.75rem; /* 모바일에서 패딩 축소 */
  }

  .example-prompt-btn {
    font-size: 14px; /* 모바일에서 예시 프롬프트 폰트 크기 축소 */
    padding: 0.75rem;
  }

  .utm-url-card,
  .description-section {
    padding: 1rem;
  }

  .url-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }

  .parameter-item {
    padding: 0.75rem;
  }
}

.param-option {
  margin: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.param-option::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #94a3b8;
}

/* 로딩 인디케이터 스타일 */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 1rem auto;
  background: transparent;
}

.loading-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  background-color: #0ea5e9;
  border-radius: 50%;
  animation: bounce 0.5s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.1s;
}

.dot:nth-child(3) {
  animation-delay: 0.2s;
}

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

/* 설명 섹션 스타일 */
.description-text {
  margin-bottom: 1.5rem;
  color: #1e293b;
  line-height: 1.6;
}

.description-text p {
  margin-bottom: 0.75rem;
}

.description-text strong {
  color: #0369a1;
  font-weight: 600;
  background: #f0f9ff;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.description-text code {
  font-family: "Fira Code", monospace;
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #0369a1;
}

/* Parameters Used 섹션 */
.parameters-section {
  background: #f8fafc;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.parameters-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.parameter-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.parameter-name {
  color: #0369a1;
  font-weight: 500;
  margin-right: 0.5rem;
  font-family: "Fira Code", monospace;
}

.parameter-value {
  color: #334155;
}

/* UTM URL 섹션 */
.utm-url-section {
  margin-top: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  padding: 1rem;
}

.url-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.url-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.url-text {
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  color: #1e293b;
  padding: 0.75rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  word-break: break-all;
  line-height: 1.5;
}

.url-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.url-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.url-button i {
  font-size: 0.875rem;
}

.copy-button {
  background-color: #f0f9ff;
  color: #0369a1;
  border-color: #e0f2fe;
}

.copy-button:hover {
  background-color: #e0f2fe;
  border-color: #0369a1;
}

.save-button {
  background-color: #0369a1;
  color: white;
}

.save-button:hover {
  background-color: #0284c7;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .url-buttons {
    flex-direction: column;
  }

  .url-button {
    width: 100%;
    justify-content: center;
  }
}

/* 나머지 텍스트 스타일 */
.remaining-text {
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}
