/* AI 검색 포털 향상 스타일 */

/* 사이드바 최소화 */
.category-sidebar {
  width: 60px;
  min-width: 60px;
  max-width: 60px ;
  transition: width 0.3s ease !important;
  overflow: visible;
  position: relative;
}

.category-sidebar:hover,
.category-sidebar.expanded {
  width: 280px;
  max-width: 280px;
  overflow-y: auto !important;
}

/* 섹션 버튼 아이콘화 */
.section-btn {
  position: relative;
  padding: 12px 8px 12px 14px !important;
  min-height: 44px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s;
  margin: 4px 6px;
  border-radius: 8px;
}

/* Active 상태 강화 - 연한 주황색 */
.section-btn.active {
  background: #ffb380 !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(255, 179, 128, 0.3);
  border-left: 3px solid #ff9560;
}

/* 모든 active 버튼 연한 주황색 통일 */
#categorySidebar .section-btn.active,
.category-sidebar .section-btn.active,
.section-selector .section-btn.active {
  background: #ffb380 !important;
  background-color: #ffb380 !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(255, 179, 128, 0.3);
  border-left: 3px solid #ff9560;
}

.section-btn.active::before {
  color: white !important;
}

.section-btn[data-section="ai"].active::before {
  color: white !important;
}

.section-btn.active .section-name {
  color: white !important;
  font-weight: 600;
}

.section-btn[data-section="ai"].active .section-name {
  color: white !important;
  font-weight: 600;
}

/* 아이콘 스타일 */
.section-btn .section-icon {
  font-size: 20px;
  transition: all 0.3s;
  display: inline-block;
  flex-shrink: 0;
  margin-left: 4px;
}

/* 축소된 상태에서는 아이콘만 표시 */
.section-btn .section-name {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: all 0.3s;
  white-space: nowrap;
  margin-left: 0;
}

/* 호버/확장 시 아이콘과 텍스트 함께 표시 */
.category-sidebar:hover .section-btn,
.category-sidebar.expanded .section-btn {
  justify-content: flex-start !important;
  padding-left: 18px !important;
}

.category-sidebar:hover .section-btn .section-icon,
.category-sidebar.expanded .section-btn .section-icon {
  margin-right: 10px;
  margin-left: 0;
}

.category-sidebar:hover .section-btn .section-name,
.category-sidebar.expanded .section-btn .section-name {
  opacity: 1;
  width: auto;
}

/* Hover 상태가 active를 덮어쓰지 않도록 */
.section-btn:hover:not(.active) {
  background: #fff5f0;
  color: #ff9560;
  transform: translateX(2px);
}

.section-btn.active:hover {
  background: #ff9560 !important;
  color: white !important;
}

/* 카테고리 필터 숨김/표시 */
.category-filters {
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.category-sidebar:hover .category-filters,
.category-sidebar.expanded .category-filters {
  opacity: 1;
  pointer-events: auto;
}

.filter-header {
  display: none;
}

.category-sidebar:hover .filter-header,
.category-sidebar.expanded .filter-header {
  display: block;
}

.category-group {
  display: none !important;
}

.category-sidebar:hover .category-group,
.category-sidebar.expanded .category-group {
  display: flex !important;
}

/* 생성 버튼 최소화 */
.create-content-section {
  padding: 8px !important;
}

.create-btn {
  position: relative;
  min-height: 44px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.create-btn .create-icon {
  font-size: 20px;
}

.create-btn .create-text {
  display: none;
}

.category-sidebar:hover .create-btn,
.category-sidebar.expanded .create-btn {
  justify-content: flex-start !important;
  padding-left: 16px !important;
}

.category-sidebar:hover .create-btn .create-text,
.category-sidebar.expanded .create-btn .create-text {
  display: inline;
  margin-left: 8px;
}

/* AI 검색 섹션 */
.ai-search-section {
  padding: 40px;
  background: white;
  border-radius: 16px;
  margin: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 10;
}

/* 콘텐츠 섹션 기본 스타일 */
#musicContent, #feedContent, #gathertownContent, #openmallContent {
  position: relative;
  width: 100%;
}

.ai-search-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.ai-search-subtitle {
  font-size: 16px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 32px;
}

.ai-search-box {
  position: relative;
  max-width: 800px;
  margin: 0 auto 24px;
}

.ai-search-input {
  width: 100%;
  padding: 16px 60px 16px 20px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s;
}

.ai-search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.ai-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s;
}

.ai-search-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

.ai-search-options {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.search-option {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.search-option:hover {
  background: white;
  border-color: #667eea;
  color: #667eea;
}

.search-option.active {
  background: #667eea;
  color: white;
}

/* AI 기능 카드 */
.ai-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.ai-feature-card {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.ai-feature-card:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.ai-feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.ai-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.ai-feature-desc {
  font-size: 12px;
  color: #6b7280;
}

/* AI 결과 섹션 */
.ai-results-section {
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  margin: 20px;
  min-height: 400px;
}

.ai-result-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.ai-result-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.ai-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.ai-result-summary {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 8px;
}

.ai-result-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
}

/* 픽메타 독점 트렌드 인덱스 */
.trending-knowledge {
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  margin: 20px;
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.trending-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-nav {
  display: flex;
  gap: 8px;
}

.trending-nav-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.trending-nav-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.trending-nav-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* 독점 트렌드 카드 */
.exclusive-trends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.trend-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s;
}

.trend-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.trend-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
}

.trend-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}

/* 검색 순위 */
.search-ranking {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-ranking li {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

.search-ranking li:hover {
  background: #f9fafb;
  margin: 0 -10px;
  padding: 10px;
}

.rank-num {
  width: 24px;
  height: 24px;
  background: #f3f4f6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #6b7280;
  margin-right: 12px;
}

.search-ranking li:nth-child(1) .rank-num {
  background: #ffd700;
  color: #000;
}

.search-ranking li:nth-child(2) .rank-num {
  background: #c0c0c0;
  color: #000;
}

.search-ranking li:nth-child(3) .rank-num {
  background: #cd7f32;
  color: #fff;
}

.rank-keyword {
  flex: 1;
  font-size: 14px;
  color: #374151;
}

.rank-change {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.rank-change.up {
  color: #ef4444;
  background: #fee2e2;
}

.rank-change.down {
  color: #3b82f6;
  background: #dbeafe;
}

.rank-change.new {
  color: #10b981;
  background: #d1fae5;
}

/* 키워드 클라우드 */
.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.keyword-tag {
  padding: 6px 12px;
  border-radius: 16px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.keyword-tag:hover {
  transform: scale(1.05);
}

.keyword-tag.hot {
  background: #fee2e2;
  color: #ef4444;
  animation: pulse 2s infinite;
}

.keyword-tag.trending {
  background: #fef3c7;
  color: #f59e0b;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 트렌드 인사이트 */
.trend-insight {
  padding: 12px;
  background: #f0f9ff;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
  font-size: 13px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-icon {
  font-size: 16px;
}

/* 커머스 트렌드 */
.commerce-trends {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trend-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
  transition: all 0.2s;
}

.trend-item:hover {
  background: #f3f4f6;
}

.trend-category {
  padding: 3px 8px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
  margin-right: 12px;
}

.trend-product {
  flex: 1;
  font-size: 14px;
  color: #1f2937;
}

.trend-growth {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}

/* 뉴스 요약 */
.news-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #e5e7eb;
  transition: all 0.2s;
}

.news-item:hover {
  border-left-color: #667eea;
  background: white;
}

.news-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.news-category.tech {
  background: #dbeafe;
  color: #3b82f6;
}

.news-category.business {
  background: #fef3c7;
  color: #f59e0b;
}

.news-category.social {
  background: #d1fae5;
  color: #10b981;
}

.news-item p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

.news-time {
  font-size: 11px;
  color: #9ca3af;
}

/* 트렌드 푸터 */
.trend-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.update-time {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.trend-more-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #667eea;
  color: #667eea;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.trend-more-btn:hover {
  background: #667eea;
  color: white;
}

/* 콘텐츠 영역 조정 */
.content-area {
  flex: 1;
  overflow-y: auto;
  background: #f5f7fa;
}

/* AI 도구 섹션 */
.ai-tools-section {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.ai-tools-header {
  display: none;
  padding: 8px;
}

.category-sidebar:hover .ai-tools-header,
.category-sidebar.expanded .ai-tools-header {
  display: block;
}

.ai-tools-title {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.ai-tool-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
  color: white;
  font-weight: 500;
}

.ai-tool-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-tool-icon {
  font-size: 20px;
}

.ai-tool-text {
  display: none;
  margin-left: 8px;
  font-size: 14px;
  color: white;
  font-weight: 500;
}

.category-sidebar:hover .ai-tool-btn,
.category-sidebar.expanded .ai-tool-btn {
  justify-content: flex-start;
  padding-left: 16px;
}

.category-sidebar:hover .ai-tool-text,
.category-sidebar.expanded .ai-tool-text {
  display: inline;
}

/* 사이드바 하단 여백 조정 */
.category-sidebar {
  padding-bottom: 180px; /* AI 도구 섹션 공간 확보 */
}

/* 모바일 대응 */
@media (max-width: 768px) {
  /* 사이드바는 style.css의 설정을 따름 */
  .category-sidebar.mobile-bottom-nav {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto !important;
    height: auto;
    z-index: 1000;
    background: white;
    border-top: 1px solid #e5e5e5;
    padding: 0;
  }
  
  .section-selector {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    padding: 8px 4px;
  }
  
  .section-btn {
    margin: 0 2px !important;
    padding: 8px 4px !important;
    flex: 1;
    border-radius: 6px;
  }
  
  .section-btn .section-icon {
    font-size: 18px;
    margin-right: 0 !important;
  }
  
  .section-btn .section-name {
    display: none !important;
  }
  
  .category-sidebar:hover .section-btn .section-name,
  .category-sidebar.expanded .section-btn .section-name {
    display: none !important;
  }
  
  .category-filters {
    display: none !important;
  }
  
  .ai-tools-section {
    display: none !important;
  }
  
  .ai-search-title {
    font-size: 24px;
  }
  
  .ai-features {
    grid-template-columns: 1fr;
  }
  
  /* 메인 컨텐츠 하단 여백 추가 */
  .main-content {
    padding-bottom: 70px;
  }
}