/* 통합 검색 오버레이 — 전 페이지 공통 (footer search_modal.php).
   예전에는 main3.css 에만 있어 홈 외 페이지에서 레이아웃이 깨졌다. */

/* main3 밖에서도 브랜드 색이 먹도록 --portal-blue 폴백 */
.premium-search-overlay {
  --portal-blue: #009DDA;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.97); /* Soft Semi-transparent White background */
  backdrop-filter: blur(15px); /* Strong glassmorphism blur */
  -webkit-backdrop-filter: blur(15px);
  z-index: 100000; /* Ensure it stays on top of everything including SNB */
  display: none;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.premium-search-overlay.active {
  display: flex;
  opacity: 1;
}

.search-overlay-container {
  max-width: 1200px;
  width: 100%;
  margin: 120px auto 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Close Button */
.search-close-btn {
  position: absolute;
  top: 40px;
  right: 50px;
  background: transparent;
  border: none;
  color: #475569;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  outline: none;
  padding: 0;
  line-height: 1;
}
.search-close-btn:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.08);
}

/* Search Bar Wrapper */
.search-bar-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
}
input.search-input-field {
  width: 100% !important;
  height: auto !important;
  background: #ffffff !important;
  border: 2px solid rgba(0, 136, 209, 0.25) !important;
  border-radius: 60px !important;
  padding: 22px 75px 22px 35px !important;
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
  outline: none !important;
  line-height: normal !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
input.search-input-field:focus {
  border-color: var(--portal-blue) !important;
  box-shadow: 0 12px 35px rgba(0, 136, 209, 0.12), 0 0 20px rgba(0, 136, 209, 0.15) !important;
}
.search-input-field::placeholder {
  color: #94a3b8;
}

.search-submit-icon-btn {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.3s;
  outline: none;
}
.search-input-field:focus + .search-submit-icon-btn,
.search-submit-icon-btn:hover {
  color: var(--portal-blue);
}

/* Recommended Keywords */
.search-recommendations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.search-recommendations span.label {
  color: #475569;
  font-size: 1rem;
  font-weight: 700;
  margin-right: 8px;
}
.recommend-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none !important;
}
.recommend-tag:hover {
  background: var(--portal-blue);
  border-color: var(--portal-blue);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 150, 230, 0.25);
}

/* Search Results Area */
.search-results-viewport {
  background: #ffffff;
  border: 1px solid rgba(0, 136, 209, 0.1);
  border-radius: 24px;
  min-height: 250px;
  max-height: 480px;
  overflow-y: auto;
  padding: 30px;
  box-sizing: border-box;
  display: none;
  box-shadow: 0 15px 45px rgba(15, 23, 42, 0.05);
}
.search-results-viewport.has-query {
  display: block;
}

/* Result Tabs */
.search-result-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  gap: 20px;
  margin-bottom: 20px;
}
.search-tab-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
  outline: none;
}
.search-tab-btn.active {
  color: var(--portal-blue);
}
.search-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--portal-blue);
}

.search-results-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* No Results Message */
.search-no-results {
  text-align: center;
  padding: 50px 0;
  color: #64748b;
}
.search-no-results i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
  color: rgba(0, 136, 209, 0.3);
}
.search-no-results p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Center Result Card */
.search-result-card-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 24px;
  transition: all 0.3s;
  text-decoration: none !important;
}
.search-result-card-center:hover {
  background: #ffffff;
  border-color: var(--portal-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 136, 209, 0.06);
}
.search-result-card-center .info-box {
  display: flex;
  align-items: center;
  gap: 18px;
}
.search-result-card-center .icon-circle {
  background: rgba(0, 136, 209, 0.08);
  color: var(--portal-blue);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.search-result-card-center h5 {
  margin: 0 0 4px 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}
.search-result-card-center p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
}
.search-result-card-center .go-link {
  color: #64748b;
  font-size: 0.9rem;
  transition: transform 0.3s, color 0.3s;
}
.search-result-card-center:hover .go-link {
  color: var(--portal-blue);
  transform: translateX(4px);
}

/* Doctor Result Card */
.search-result-card-doctor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  transition: all 0.3s;
  text-decoration: none !important;
}
.search-result-card-doctor:hover {
  background: #ffffff;
  border-color: var(--portal-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 136, 209, 0.06);
}
.search-result-card-doctor .info-box {
  display: flex;
  align-items: center;
  gap: 16px;
}
.search-result-card-doctor .avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.search-result-card-doctor .avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.search-result-card-doctor h5 {
  margin: 0 0 4px 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}
.search-result-card-doctor h5 span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--portal-blue);
  background: rgba(0, 136, 209, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.search-result-card-doctor p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
}

/* Post Result Item */
.search-result-item-post {
  display: flex;
  flex-direction: column;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 10px;
  transition: all 0.3s;
  text-decoration: none !important;
}
.search-result-item-post:hover {
  background: #f8fafc;
}
.search-result-item-post h5 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  transition: color 0.3s;
}
.search-result-item-post:hover h5 {
  color: var(--portal-blue);
}
.search-result-item-post .meta {
  display: flex;
  gap: 15px;
  font-size: 0.78rem;
  color: #94a3b8;
}
.search-result-item-post .meta span.badge {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  color: #475569;
}

@media (max-width: 768px) {
  .search-overlay-container {
    margin-top: 80px;
  }
  .search-close-btn {
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
  }
  .search-input-field {
    font-size: 1.1rem;
    padding: 14px 60px 14px 20px;
  }
  .search-results-viewport {
    padding: 20px;
    max-height: 380px;
  }
  .search-recommendations {
    margin-bottom: 24px;
  }
}
