/* 태그 검색 페이지 스타일 */

.tag-search-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: 'Gothic A1', 'Noto Sans KR', sans-serif;
}

/* 페이지 헤더 */
.tag-search-header {
  text-align: center;
  margin-bottom: 40px;
}

.tag-search-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1D2F4E;
  margin-bottom: 12px;
}

.tag-search-description {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* 검색 영역 */
.tag-search-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input-wrapper {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.tag-search-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Gothic A1', 'Noto Sans KR', sans-serif;
  transition: border-color 0.2s;
}

.tag-search-input:focus {
  outline: none;
  border-color: #4285f4;
}

.tag-search-button {
  padding: 14px 32px;
  background: #4285f4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.tag-search-button:hover {
  background: #3367d6;
}

.tag-search-button:active {
  background: #2e5bb8;
}

/* 자동완성 드롭다운 */
.tag-autocomplete {
  position: relative;
  margin-bottom: 20px;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.autocomplete-item:hover {
  background: #f5f5f5;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-tag {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  margin-right: 8px;
  font-weight: 500;
}

.autocomplete-count {
  color: #666;
  font-size: 14px;
  float: right;
}

/* 선택된 태그 */
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  min-height: 40px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  background: #4285f4;
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
}

.selected-tag-remove {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  padding: 0;
  transition: background-color 0.2s;
}

.selected-tag-remove:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 인기 태그 */
.popular-tags-section {
  margin-top: 30px;
}

.popular-tags-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.popular-tag {
  display: inline-block;
  background: white;
  color: #4285f4;
  padding: 10px 18px;
  border: 2px solid #4285f4;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.popular-tag:hover {
  background: #4285f4;
  color: white;
}

.popular-tag-count {
  margin-left: 6px;
  color: #999;
  font-size: 12px;
  transition: color 0.2s;
}

.popular-tag:hover .popular-tag-count {
  color: rgba(255, 255, 255, 0.8);
}

.loading-tags {
  color: #999;
  font-size: 14px;
}

/* 필터 영역 */
.filter-section {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.filter-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Gothic A1', 'Noto Sans KR', sans-serif;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: #4285f4;
}

/* 검색 결과 */
.search-results-section {
  margin-top: 40px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.results-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.results-count {
  font-size: 16px;
  color: #666;
  font-weight: 500;
}

.search-results {
  display: grid;
  gap: 20px;
}

/* 문제 카드 */
.question-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.question-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.question-card-info {
  flex: 1;
}

.question-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.question-card-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #666;
}

.question-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.question-card-tag {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

/* ✅ 선택된 태그 강조 스타일 추가 */
.question-card-tag.active {
  background: #4285f4;
  color: white;
}

.tag-remove-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  margin-left: 2px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
}

.tag-remove-btn:hover {
  opacity: 1;
}

.question-card-action {
  padding: 8px 16px;
  background: #4285f4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.question-card-action:hover {
  background: #3367d6;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 16px;
  margin: 0;
}

/* 로딩 상태 */
.loading-results {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .tag-search-page {
    padding: 20px 16px;
  }

  .tag-search-header h1 {
    font-size: 24px;
  }

  .tag-search-section {
    padding: 20px;
  }

  .search-input-wrapper {
    flex-direction: column;
  }

  .tag-search-button {
    width: 100%;
  }

  .filter-section {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .question-card-header {
    flex-direction: column;
    gap: 12px;
  }

  .question-card-action {
    width: 100%;
  }
}
