/* dictionary.css */
.dictionary-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dictionary-container h1 {
  color: #30b3e2;
  text-align: center;
  margin-bottom: 30px;
}

/* واکنش‌گرایی برای تیتر در حالت موبایل */
@media (max-width: 768px) {
  .dictionary-container h1 {
    font-size: 1.5rem; /* کاهش اندازه فونت در موبایل */
  }
}

.search-box {
  position: relative;
  margin-bottom: 30px;
}

#dictionary-search-input {
  width: 100%;
  padding: 12px 20px 12px 40px; /* فضای کافی سمت چپ برای دکمه پاک کردن */
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 16px;
  transition: all 0.3s;
}

#dictionary-search-input:focus {
  border-color: #30b3e2;
  outline: none;
  box-shadow: 0 0 10px rgba(48, 179, 226, 0.3);
}

.search-box button {
  position: absolute;
  left: 5px;
  top: 5px;
  background: #30b3e2 !important;
  color: white !important;
  border: none;
  border-radius: 25px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.3s;
}

.search-box button:hover {
  background: #2596be;
}

.words-list {
  margin-top: 30px;
}

.word-item {
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 10px;
  background: rgba(48, 179, 226, 0.18); /* آبی فیروزه‌ای ملایم و شیشه‌ای */
  box-shadow: 0 2px 8px rgba(48, 179, 226, 0.1);
  backdrop-filter: blur(4px);
  transition: all 0.3s;
}

.word-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.word-item .word {
  font-size: 19px;
  font-weight: bold;
  color: #e23030;
  margin-bottom: 10px;
}

.word-item .meaning {
  font-size: 17px;
  line-height: 1.7;
}

.search-results-info {
  text-align: center;
  margin-bottom: 20px;
  color: #666;
}

.clear-search {
  color: #30b3e2;
  text-decoration: none;
  margin-right: 10px;
}

.clear-search:hover {
  text-decoration: underline;
}

.no-results {
  text-align: center;
  color: #666;
  font-size: 18px;
  padding: 30px;
}

/* استایل برای نتایج جستجوی پویا */
#dictionary-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#dictionary-search-results div {
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.2s;
}

#dictionary-search-results div:hover {
  background: #f0f0f0;
}

.clear-search-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #eee;
  color: #666;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.clear-search-btn.show {
  display: flex;
}

/* استایل تبلیغات صفحه دیکشنری */
.dictionary-ad-container {
  width: 30%; /* کاهش ابعاد */
  max-width: 30%; /* کاهش ابعاد */
  margin: 0px auto; /* فاصله از بالا و پایین */
  box-sizing: border-box;
  display: flex;
  justify-content: center; /* قرار دادن تصویر در مرکز افقی */
  align-items: center; /* قرار دادن تصویر در مرکز عمودی */
  position: relative; /* برای موقعیت‌دهی نوشته تبلیغات */
}

/* استایل تبلیغات افقی */
.dictionary-ad.horizontal-ad {
  display: flex; /* استفاده از فلکس‌باکس برای مرکز کردن */
  justify-content: center; /* مرکز کردن افقی */
  align-items: center; /* مرکز کردن عمودی */
  width: 100%; /* عرض کامل */
  max-width: 600px; /* حداکثر عرض */
  margin: 20px auto; /* فاصله از بالا و پایین */
  position: relative; /* برای موقعیت‌دهی نوشته تبلیغات */
  box-sizing: border-box;
}

.dictionary-ad.horizontal-ad img {
  width: 100%; /* تصویر به عرض کامل کانتینر */
  height: auto; /* حفظ نسبت تصویر */
  border-radius: 10px; /* گوشه‌های گرد */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* سایه برای زیبایی */
  display: block;
  box-sizing: border-box;
  border-radius: 10px;
}

/* استایل برای نوشته تبلیغات */
.ad-label {
  position: absolute;
  top: 0px !important; /* موقعیت گوشه بالا */
  right: 0px !important; /* موقعیت گوشه بالا */
}

/* حالت واکنش‌گرا برای تبلیغات */
@media (max-width: 768px) {
  .dictionary-ad-container {
    width: 80%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .dictionary-ad-container img {
    margin-top: 15px;
    width: 100%;
  }
}
