/* Blurred background for modal */
body.modal-open::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(10px);
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 998;
  overflow: hidden;
}

/* Main Modal Container */
.search-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 800px;
  height: 80vh;
  background:var(--Mainbg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  overscroll-behavior: contain;
  border: var(--border);
}

/* Scrollable area inside modal */
.search-modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  
}

.search-modal-body::-webkit-scrollbar {
  width: 0px;
  display: none;
}
.search-modal-body::-webkit-scrollbar-thumb {
  background: #cccccc00;
  border-radius: 3px;
}

.search-modal-body {
  scrollbar-width: none;
 
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .search-modal {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    justify-content: flex-start;
    align-items: stretch;
    z-index: 99999999;
    border: none;
  }
}

.hidden {
  display: none;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-modal-header input {
  flex: 1;
  padding: 10px 1rem;
  border: var(--border);
  border-radius: 35px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  background: var(--Mainbg);
  color: var(--color);
}

.search-modal-header button {
    background: var(--search-header-x);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 32px;
    color: #ffffff;
    padding: 10px 10px;
}
.result-card {
  display: flex;
  flex-direction: column;
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  cursor: pointer;
  background: var(--Mainbg);
  margin-bottom: 1rem;
  width: 100%;
}

.result-card:hover {
  transform: translateY(-2px);
}

.result-card img {
  display: none;
}

.result-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-content h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color);
}

.result-content p {
  margin: 0;
  font-size: 0.95rem;
  color: #939393;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.result-tags span {
  background: var(--labletag);
  padding: 0.25rem 0.6rem;
  border-radius: 30px;
  font-size: 0.75rem;
  color: var(--color);
}

.result-date {
  font-size: 0.75rem;
  color: #888;
  text-align: right;
}

/* Trending Placeholder */
.trending-placeholder {
  text-align: left;
  padding-top: 0.5rem;
}

.trending-placeholder h3 {
  font-size: 1.2rem;
  color: var(--color);
  margin-bottom: 1rem;
}

.trending-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tag-section {
    margin-top: 0px;
    margin-bottom: 50px;
}
.tag-section h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--color);
}
.tag-section .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag-section .tag-list span {
  background: var(--labletag);
  padding: 0.35rem 0.8rem;
  border-radius: 30px;
  font-size: 0.8rem;
  color: var(--color);
  cursor: pointer;
  transition: background 0.2s ease;
}
.tag-section .tag-list span:hover {
  background: #d5d5d5;
}

.skeleton {
  background: #eee;
  border-radius: 6px;
  animation: shimmer 1.5s infinite linear;
}


.close-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #ffffff;
  transition: color 0.2s ease;
}

.close-button:hover {
  color: #333;
}

.close-button svg {
  display: block;
}
