/* =================================================================
   기본 및 전역 스타일
   ================================================================= */
html {
  scroll-behavior: smooth;
}

/* ✨ [수정] body에 flex를 이용한 중앙 정렬 적용 */
body {
  background-color: #121212; /* gray-900 */
  color: #e0e0e0; /* gray-200 */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

button, a {
  transition: all 0.2s ease-in-out;
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #1e1e1e; }
::-webkit-scrollbar-thumb { background-color: #3e3e3e; border-radius: 20px; border: 2px solid #1e1e1e; }
::-webkit-scrollbar-thumb:hover { background-color: #5a5a5a; }

/* =================================================================
   레이아웃
   ================================================================= */
/* ✨ [수정] max-width와 반응형 padding을 담당하는 메인 컨테이너 */
body .container {
  width: 100%;
  max-width: 800px !important;
  padding: 1rem;
  box-sizing: border-box; /* 패딩이 너비에 포함되도록 설정 */
}

/* ✨ [수정] page-wrapper는 최소 높이만 담당하도록 패딩 제거 */
.page-wrapper {
  min-height: 100vh;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(30, 30, 30, 0.5); /* gray-800/50 */
  border: 2px dashed #2a2a2a; /* gray-700 */
  border-radius: 8px;
  height: 96px;
  margin-bottom: 32px;
}

.ad-placeholder span {
  color: #5a5a5a; /* gray-500 */
  font-size: 14px;
  font-weight: 600;
}

.content-section {
  margin-top: 64px;
  text-align: center;
}

.page-footer {
  text-align: center;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid #2a2a2a; /* gray-700 */
}

.page-footer p {
  color: #5a5a5a; /* gray-500 */
}

/* =================================================================
   컴포넌트 스타일 (이하 동일)
   ================================================================= */
/* 제목 */
.page-title {
  font-size: 36px;
  font-weight: 800;
  background-image: linear-gradient(to right, #60a5fa, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle {
  margin-top: 16px;
  font-size: 18px;
  color: #8c8c8c; /* gray-400 */
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 40px;
  color: #f5f5f5; /* gray-100 */
}

/* 카드 */
.card {
  background-color: #1e1e1e; /* gray-800 */
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-label {
  display: block;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #cccccc; /* gray-300 */
}

/* 텍스트 입력창 */
.textarea-input, .textarea-output {
  width: 100%;
  height: 224px;
  padding: 16px;
  border: 2px solid #3e3e3e; /* gray-600 */
  border-radius: 8px;
  resize: none;
  color: #e0e0e0; /* gray-200 */
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.textarea-input {
  background-color: rgba(42, 42, 42, 0.5); /* gray-700/50 */
}
.textarea-input:focus {
  outline: none;
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.textarea-output {
  background-color: rgba(18, 18, 18, 0.7); /* gray-900/70 */
}

/* 옵션 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 10px;
}

.option-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a; /* gray-700 */
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}
.checkbox-option:hover {
  background-color: rgba(42, 42, 42, 0.5); /* gray-700/50 */
}
.checkbox-option input[type="checkbox"] {
  height: 20px;
  width: 20px;
  border-radius: 4px;
  background-color: #2a2a2a;
  border: 1px solid #5a5a5a;
  color: #3b82f6;
  cursor: pointer;
}
.checkbox-option input[type="checkbox"]:focus {
  box-shadow: 0 0 0 2px rgba(30,30,30,1), 0 0 0 4px rgba(59, 130, 246, 0.5);
}
.checkbox-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-group { display: flex; flex-direction: column; }
.sub-option { padding-left: 24px; }

.option-with-input {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.number-input, .text-input {
  padding: 8px;
  background-color: #2a2a2a;
  border: 1px solid #3e3e3e;
  border-radius: 6px;
  color: #e0e0e0;
}
.number-input:disabled, .text-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.number-input { width: 96px; }

.replace-inputs-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  padding-left: 24px;
  transition: opacity 0.2s;
}
.replace-inputs-container.disabled {
  opacity: 0.5;
}
.arrow-icon {
  color: #8c8c8c;
  text-align: center;
  font-weight: 700;
  align-self: center;
}

/* 알림 상자 */
.notice-box {
  text-align: center;
  margin-top: 32px;
}
.notice-box p {
  display: inline-block;
  font-size: 14px;
  color: rgba(250, 204, 21, 0.8); /* yellow-400/80 */
  background-color: rgba(113, 63, 18, 0.2); /* yellow-900/20 */
  padding: 8px 16px;
  border-radius: 6px;
}

/* 액션 버튼 그룹 */
.action-buttons-group {
  margin: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.action-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
}
.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.action-button:hover:not(:disabled) {
  transform: scale(1.05);
}
.action-button i {
  width: 20px;
  height: 20px;
}

#copyButtonContent {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 버튼 색상별 스타일 */
.action-button.primary {
  background-image: linear-gradient(to right, #3b82f6, #2563eb);
  color: white;
}
.action-button.primary:hover:not(:disabled) {
  background-image: linear-gradient(to right, #2563eb, #1d4ed8);
}
.action-button.secondary {
  background-color: #2a2a2a; /* gray-700 */
  color: #e0e0e0; /* gray-200 */
}
.action-button.secondary:hover:not(:disabled) {
  background-color: #3e3e3e; /* gray-600 */
}
.action-button.teal {
  background-color: #134e4a; /* teal-700 */
  color: #e0e0e0;
}
.action-button.teal:hover:not(:disabled) {
  background-color: #115e59; /* teal-600 */
}
.action-button.danger {
  background-color: rgba(153, 27, 27, 0.8); /* red-800/80 */
  color: white;
}
.action-button.danger:hover:not(:disabled) {
  background-color: rgba(185, 28, 28, 0.8); /* red-700/80 */
}


/* 주요 기능 */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  text-align: left;
}
.feature-card {
  background-color: #1e1e1e;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(42, 42, 42, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}
.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #60a5fa; /* blue-400 */
  margin-bottom: 12px;
}
.feature-card p {
  color: #8c8c8c; /* gray-400 */
  font-size: 16px;
  line-height: 1.6;
}

/* SNS 공유 */
.share-links-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.share-button {
  width: 112px;
  text-align: center;
  color: white;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 6px;
  transition: all 0.3s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  background-color: #2a2a2a;
}
.share-button:hover {
  transform: scale(1.05);
  background-color: #3e3e3e;
}


/* =================================================================
   반응형 디자인 (미디어 쿼리)
   ================================================================= */

/* sm 사이즈 이상 (640px) */
@media (min-width: 640px) {
  .page-title { font-size: 48px; }
  
  .options-grid { grid-template-columns: repeat(2, 1fr); }
  
  .option-with-input { flex-direction: row; align-items: center; }

  .replace-inputs-container { flex-direction: row; align-items: center; }
  .arrow-icon { transform: none; }
  
  .action-buttons-group { flex-direction: row; }
  .action-button { width: auto; }
  
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* md 사이즈 이상 (768px) */
@media (min-width: 768px) {
  .options-grid { grid-template-columns: repeat(3, 1fr); }
}