/* web/css/card.css — 이름 뜻 카드 모듈 스타일 (수평 스냅 피드 · 무한 캐러셀) */

#card-root {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 10px 0 0;
}

.card-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 0;
}

/* 수평 스냅 캐러셀 컨테이너 */
.card-carousel {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  align-items: flex-start;
  box-sizing: border-box;
  touch-action: pan-y;
}

.card-carousel::-webkit-scrollbar {
  display: none;
}

/* 개별 슬라이드 */
.card-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 8px 16px 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* 메인 이름 카드 */
.name-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid rgba(231, 229, 228, 0.9);
  border-radius: 22px;
  padding: 26px 20px 22px;
  box-shadow: 0 10px 28px -6px rgba(28, 25, 23, 0.07),
              0 2px 6px -1px rgba(28, 25, 23, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
}

/* 다른 한자 표기 선택 (variants) */
.card-variant-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.card-variant-nav-label {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}

.card-variant-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.card-variant-dot {
  border: 1px solid var(--line);
  background: #FAF9F6;
  color: var(--muted);
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.card-variant-dot:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.card-variant-dot.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

/* 카드 상단 이름 영역 */
.card-header {
  text-align: center;
  margin-bottom: 2px;
}

.card-name-hangul {
  margin: 0;
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(2.3rem, 7.5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.card-name-hanja {
  margin-top: 6px;
  font-family: 'Noto Serif KR', serif;
  font-size: 1.22rem;
  color: #78716C;
  letter-spacing: 0.2em;
  font-weight: 500;
}

.card-name-hanja-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  background: #F5F5F4;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

/* 이름의 뜻 한 문장 */
.card-meaning-box {
  margin: 16px 0 18px;
  padding: 13px 16px;
  background: #FAF8F5;
  border-radius: 14px;
  border: 1px solid #EFECE6;
  position: relative;
}

.card-meaning-text {
  margin: 0;
  font-family: 'Noto Serif KR', serif;
  font-size: 1.02rem;
  line-height: 1.72;
  color: #262220;
  text-align: center;
  word-break: keep-all;
  font-weight: 500;
}

/* 음절별 한자 풀이 목록 */
.card-syllables-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.card-syllable-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #FAF9F6;
  border: 1px solid #F0EEE9;
  border-radius: 12px;
  transition: border-color 0.15s, background-color 0.15s;
}

.card-syllable-item.is-surname {
  background: #FDFBF7;
  border-color: #EAE6DF;
}

.card-syllable-item:hover {
  background: #F7F5EE;
  border-color: #E2DDD3;
}

.syl-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 46px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-shrink: 0;
  padding: 2px 4px;
}

.syl-hangul {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}

.syl-hanja {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.15;
  margin-top: 1px;
}

.syl-hanja-empty {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.15;
  margin-top: 1px;
}

.syl-info {
  flex: 1;
  min-width: 0;
}

.syl-meaning-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
}

.syl-sym-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  word-break: keep-all;
}

/* 카드 하단 액션 버튼 (공유 / 편지 쓰기) */
.card-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.card-action-btn {
  flex: 1;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.card-action-btn:active {
  transform: scale(0.98);
}

.card-action-btn.share-btn {
  background: #FFFFFF;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.card-action-btn.share-btn:hover {
  background: #FAF7F2;
  border-color: #D6D3D1;
}

.card-action-btn.letter-btn {
  background: var(--ink);
  color: #FFFFFF;
  border: none;
}

.card-action-btn.letter-btn:hover {
  background: #2E2A27;
}

/* 좌우 네비게이션 화살표 */
.carousel-arrow {
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.08);
  transition: all 0.2s ease;
}

.carousel-arrow:hover:not(:disabled) {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 16px rgba(28, 25, 23, 0.12);
}

.carousel-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.carousel-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-arrow-prev {
  left: 8px;
}

.carousel-arrow-next {
  right: 8px;
}

/* 하단 익명 편지 안내 힌트 */
.card-scroll-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  margin: 6px auto 14px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px dashed rgba(217, 119, 6, 0.4);
  border-radius: 999px;
  color: #92400E;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  animation: hintBounce 2.2s infinite ease-in-out;
}

.card-scroll-hint:hover {
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(217, 119, 6, 0.7);
  color: #78350F;
  transform: translateY(2px);
}

.card-scroll-hint-arrow {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 700;
}

@keyframes hintBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* 모바일 화면 최적화 */
@media (max-width: 480px) {
  .carousel-arrow {
    width: 32px;
    height: 32px;
  }
  .carousel-arrow-prev {
    left: 4px;
  }
  .carousel-arrow-next {
    right: 4px;
  }
  .name-card {
    padding: 22px 16px 18px;
  }
  .card-meaning-box {
    margin: 14px 0 16px;
    padding: 12px 14px;
  }
}

/* 미등록 신규 요청 이름 안내 배너 (내일 새벽 Gemini 업데이트 안내) */
.unserved-name-notice {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FDE68A;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.06);
  animation: fadeInNotice 0.25s ease-out;
}

@keyframes fadeInNotice {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.unserved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #D97706;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2);
}

.unserved-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #78350F;
}

.unserved-random-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #F59E0B;
  color: #B45309;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.unserved-random-btn:hover {
  background: #FEF3C7;
  transform: translateY(-1px);
}

/* 외국인 이름 발음 매칭 브릿지 (e.g. 'Sophia Korean Name') 배너 */
.card-phonetic-bridge {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #BFDBFE;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

.bridge-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bridge-ipa {
  opacity: 0.85;
  font-family: monospace;
  font-size: 10px;
}

.bridge-reason {
  margin: 0 0 10px;
  font-size: 13px;
  color: #1E3A8A;
  line-height: 1.45;
  font-style: italic;
}

.bridge-alts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #93C5FD;
}

.bridge-alts-label {
  font-size: 11px;
  font-weight: 700;
  color: #1E40AF;
}

.bridge-alts-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bridge-alt-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #93C5FD;
  color: #1D4ED8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bridge-alt-pill:hover {
  background: #DBEAFE;
  border-color: #3B82F6;
  transform: translateY(-1px);
}
