/**
 * dictionary.css
 * 이모지 의미 사전 페이지 스타일
 */

/* ============================================
   1) Hero 섹션
   ============================================ */
.dictionary-hero {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 80px 20px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dictionary-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* Hero 캐릭터 이미지 */
.dictionary-hero__img {
  position: absolute;
  max-width: 150px;
  height: auto;
  opacity: 0.9;
  object-fit: contain;
}

.dictionary-hero__img--left {
  bottom: -20px;
  left: 5%;
  width: clamp(80px, 12vw, 150px);
  animation: float 4s ease-in-out infinite;
}

.dictionary-hero__img--right {
  top: -10px;
  right: 5%;
  width: clamp(100px, 15vw, 180px);
  animation: float 5s ease-in-out infinite 0.5s;
}

/* Hero 콘텐츠 */
.dictionary-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dictionary-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 20px 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dictionary-hero__subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  line-height: 1.6;
  margin: 0;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ============================================
   2) 딕셔너리 메인 섹션
   ============================================ */
.dictionary-main {
  padding: 60px 20px;
  background: linear-gradient(180deg, transparent 0%, rgba(102, 126, 234, 0.05) 100%);
  min-height: 100vh;
}

/* ============================================
   3) 검색 섹션
   ============================================ */
.dictionary-search-section {
  margin-bottom: 40px;
  animation: slideUp 0.6s ease-out;
}

.search-box {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.dict-search-input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.dict-search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   4) 카테고리 탭
   ============================================ */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
  justify-content: center;
  animation: fadeIn 0.6s ease-out 0.1s both;
}

.category-tab {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.category-tab:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
}

.category-tab:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.category-tab--active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-tab--active:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ============================================
   5) 이모지 딕셔너리 그리드
   ============================================ */
.emoji-dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
  animation: fadeIn 0.6s ease-out;
}

.emoji-dictionary-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  background: #f8f9ff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  min-height: 140px;
  position: relative;
}

.emoji-dictionary-card:hover {
  border-color: #667eea;
  background: #e8ecff;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.emoji-dictionary-card:active {
  transform: translateY(-2px);
}

.emoji-dictionary-card.copied {
  animation: cardCopied 0.4s ease-out;
}

.emoji-dictionary-card:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.emoji-dict-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.emoji-dict-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  word-break: keep-all;
  margin: 0;
}

.emoji-dict-desc {
  font-size: 0.7rem;
  color: #999;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.emoji-dict-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.keyword {
  font-size: 0.65rem;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.emoji-dict-generation {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  margin-top: 4px;
  font-weight: 600;
}

/* ============================================
   6) 검색 결과 없음 메시지
   ============================================ */
.no-results-message {
  background: white;
  padding: 50px 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
}

.no-results-message p {
  font-size: 1.1rem;
  color: #999;
  margin: 0;
}

/* ============================================
   7) 더 보기 섹션
   ============================================ */
.load-more-section {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.load-more-btn {
  padding: 14px 40px;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: none;
}

.load-more-btn.show {
  display: inline-block;
}

.load-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.load-more-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ============================================
   8) 모바일 반응형
   ============================================ */
@media (max-width: 1024px) {
  .dictionary-hero {
    min-height: 350px;
    padding: 60px 20px;
  }

  .dictionary-hero__img--left {
    max-width: 120px;
  }

  .dictionary-hero__img--right {
    max-width: 150px;
  }

  .emoji-dictionary-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 20px;
  }

  .emoji-dictionary-card {
    min-height: 120px;
    padding: 12px;
  }

  .emoji-dict-emoji {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .dictionary-hero {
    min-height: 300px;
    padding: 50px 20px;
  }

  .dictionary-hero__title {
    font-size: 2rem;
  }

  .dictionary-hero__subtitle {
    font-size: 0.95rem;
  }

  .dictionary-hero__img--left {
    width: clamp(60px, 10vw, 100px);
    bottom: -15px;
    left: 3%;
  }

  .dictionary-hero__img--right {
    width: clamp(80px, 12vw, 120px);
    top: 0;
    right: 3%;
  }

  .dictionary-main {
    padding: 40px 15px;
  }

  .category-tabs {
    gap: 8px;
  }

  .category-tab {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .emoji-dictionary-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
    padding: 15px;
  }

  .emoji-dictionary-card {
    min-height: 100px;
    padding: 10px;
  }

  .emoji-dict-emoji {
    font-size: 1.8rem;
  }

  .emoji-dict-name {
    font-size: 0.7rem;
  }

  .emoji-dict-desc {
    font-size: 0.6rem;
  }

  .keyword {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .dictionary-hero {
    min-height: 250px;
    padding: 40px 15px;
  }

  .dictionary-hero__title {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  .dictionary-hero__subtitle {
    font-size: 0.85rem;
  }

  .dictionary-hero__img--left {
    width: clamp(50px, 8vw, 80px);
    bottom: -10px;
    left: 2%;
  }

  .dictionary-hero__img--right {
    width: clamp(60px, 10vw, 100px);
    top: 5px;
    right: 2%;
  }

  .dictionary-main {
    padding: 30px 12px;
  }

  .search-box {
    flex-direction: column;
  }

  .dict-search-input {
    width: 100%;
  }

  .category-tabs {
    gap: 6px;
  }

  .category-tab {
    padding: 7px 11px;
    font-size: 0.75rem;
  }

  .emoji-dictionary-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .emoji-dictionary-card {
    min-height: 90px;
    padding: 8px;
    gap: 6px;
  }

  .emoji-dict-emoji {
    font-size: 1.5rem;
  }

  .emoji-dict-name {
    font-size: 0.65rem;
  }

  .emoji-dict-desc {
    font-size: 0.6rem;
    -webkit-line-clamp: 1;
  }

  .keyword {
    font-size: 0.55rem;
    padding: 1px 4px;
  }

  .no-results-message {
    padding: 30px 15px;
  }

  .no-results-message p {
    font-size: 1rem;
  }
}

/* ============================================
   9) 애니메이션
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes cardCopied {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    background: #d4e8ff;
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   10) 다크 모드
   ============================================ */
[data-theme="dark"] .dictionary-main {
  background: linear-gradient(180deg, transparent 0%, rgba(102, 126, 234, 0.02) 100%);
}

[data-theme="dark"] .emoji-dictionary-grid {
  background: #2a2a3e;
}

[data-theme="dark"] .emoji-dictionary-card {
  background: #333349;
  border-color: #3a3a4e;
}

[data-theme="dark"] .emoji-dictionary-card:hover {
  background: #404050;
  border-color: #667eea;
}

[data-theme="dark"] .emoji-dict-emoji {
  color: white;
}

[data-theme="dark"] .emoji-dict-name {
  color: #e0e0e0;
}

[data-theme="dark"] .emoji-dict-desc {
  color: #999;
}

[data-theme="dark"] .keyword {
  background: rgba(102, 126, 234, 0.2);
  color: #a8c5ff;
}

[data-theme="dark"] .emoji-dict-generation {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

[data-theme="dark"] .category-tab {
  background: #2a2a3e;
  border-color: #3a3a4e;
  color: #e0e0e0;
}

[data-theme="dark"] .category-tab:hover {
  background: #333349;
  border-color: #667eea;
}

[data-theme="dark"] .category-tab--active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .dict-search-input {
  background: #2a2a3e;
  border-color: #3a3a4e;
  color: #e0e0e0;
}

[data-theme="dark"] .dict-search-input:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .no-results-message {
  background: #2a2a3e;
}

[data-theme="dark"] .no-results-message p {
  color: #999;
}

/* ============================================
   11) 감소된 동작 모드
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .dictionary-hero,
  .dictionary-hero__content,
  .dictionary-search-section,
  .category-tabs,
  .emoji-dictionary-grid,
  .emoji-dictionary-card,
  .dictionary-hero__img {
    animation: none !important;
    transition: none !important;
  }
}
