/* Стили для обычного текста */
.pli-lang {
  cursor: text; 
  color: inherit; 
}

/* Стили для popup */
.popup {
  background: #E1EBED; /* Светлый фон */
  border: 2px solid #666;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 100000;
  display: none;
  color: #05031B; /* Текст на светлом фоне */
}

/* Темный режим для popup */
.popup.dark,
[data-theme="dark"] .popup {
  background: #07021D; /* Тёмный фон */
  color: #E1EAED; /* Текст на тёмном фоне */
  border-color: #666;
}

/* Для iframe */
.popup iframe {
  width: 100%;
  height: 100%;
  border: none;
  z-index: 10000;
  background: #E1EBED; /* Светлый фон */
  color: #05031B; /* Текст на светлом фоне */
}

[data-theme="dark"] .popup iframe,
.popup.dark iframe {
  background: #07021D; /* Тёмный фон */
  color: #E1EAED; /* Текст на тёмном фоне */
}

/* Для содержимого popup */
.popup * {
  color: inherit;
}

.popup-header {
  background: #E1EBED; /* Светлый фон */
  color: #05031B; /* Текст на светлом фоне */
}

.popup-header.dark,
[data-theme="dark"] .popup-header {
  background: #07021D; /* Тёмный фон */
  color: #E1EAED; /* Текст на тёмном фоне */
}

.popupSandalone {
  background: #E1EBED; /* Светлый фон */
  color: #05031B; /* Текст на светлом фоне */
}

[data-theme="dark"] .popupSandalone,
.popupSandalone.dark {
  background: #07021D; /* Тёмный фон */
  color: #E1EAED; /* Текст на тёмном фоне */
}

.popup .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(206, 5, 32, 0.6);
  color: white; /* Упростил цвет текста (для currentColor в SVG) */
  border: none;
  height: 30px;
  width: 30px;
  cursor: pointer;
  border-radius: 100%;
  /* Центрирование содержимого */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0; /* Убирает внутренние отступы */
  line-height: 0; /* Фикс для Safari */
}

.close-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor; /* Наследует цвет от .close-btn */
  transform: translateZ(0); /* Фикс рендеринга в Safari */
  vertical-align: middle; /* Дополнительное выравнивание */
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
 /* background: rgba(0, 0, 0, 0.5);*/
  z-index: 999;
  display: none;
}

/* Остальные стили остаются без изменений */
.common-size-icon4 {
  height: 25px; 
  width: 22px;
}

.dictIcon {
  height:15px; 
  width:15px;
}

.dictIcon-sitePages {
  height: 35px; 
  width: 35px;
}

.toggle-dict-btn img {
  width: 24px;
  height: 24px;
}

.container-fluid .toggle-dict-btn img {
  width: 20px;
  height: 20px;
}

img[data-size="small"] {
  width: 16px;
  height: 16px;
}

img[data-size="large"] {
  width: 48px;
  height: 48px;
}


        ::-webkit-scrollbar {
        background: #E1EBED; /* Светлый фон */
        }

        ::-webkit-scrollbar-thumb {
       background: #E1EBED; /* Светлый фон */
        }

        ::-webkit-scrollbar-thumb:hover {
          background: #E1EBED; /* Более тёмный скроллбар при наведении */
        }

        /* Темная тема */
        [data-theme="dark"] ::-webkit-scrollbar {
          background: #07021D; /* Темный фон скроллбара */
        }

        [data-theme="dark"] ::-webkit-scrollbar-thumb {
          background: #07021D; /* Светлый скроллбар для темной темы */
        }
        
        
                .resize-handle {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 20px;
            height: 20px;
            cursor: nwse-resize;
            z-index: 10;
        }
        
        .resize-handle::after {
            content: "";
            position: absolute;
            right: 3px;
            bottom: 3px;
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 0 0 12px 12px;
            border-color: transparent transparent #666 transparent;
        }
        
@media (max-width: 768px) {

   .overlay {
 background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}
   
}



/* Стили для dropdown словарей (финальная версия) */
.dict-dropdown-container {
  position: relative;
  display: inline-block;
}

.dict-dropdown-toggle {
  cursor: pointer;
  color: var(--primary);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
}

.dict-dropdown-toggle:hover {
  color: var(--primary-alt);
  text-decoration: underline;
}

.dict-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%; /* Изменено с bottom: 100% */
  left: 0;
  background-color: var(--light);
  border-radius: 7px;
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1001;
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--gray-transparent);
  margin-top: 8px; /* Изменено с margin-bottom */
}

/* Скроллбар как в основном стиле */
.dict-dropdown-menu::-webkit-scrollbar {
  width: 10px;
}

.dict-dropdown-menu::-webkit-scrollbar-track {
  background-color: var(--light);
}

.dark-mode .dict-dropdown-menu::-webkit-scrollbar-track {
  background-color: var(--dark);
}

.dict-dropdown-menu::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: var(--gray);
}

.dropdown-section {
  padding: 0 8px;
}

.dropdown-header {
  color: var(--primary);
  font-size: 0.8em;
  font-weight: bold;
  padding: 6px 12px;
  margin: 4px 0;
  border-bottom: 1px solid var(--gray-transparent);
}

.dropdown-item {
    text-align: left;
  display: block;
  padding: 8px 16px;
  color: var(--dark);
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(26, 188, 156, 0.1); /* Легкий голубой оттенок */
}

/* Темная тема */
.dark-mode .dict-dropdown-menu {
  background-color: var(--dark);
  border-color: var(--gray-transparent);
}

.dark-mode .dropdown-item {
  color: var(--light);
}

.dark-mode .dropdown-item:hover {
  background-color: rgba(26, 188, 156, 0.2);
}

/* Анимация появления - изменено на fadeInDown */
.dict-dropdown-menu.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from { 
    opacity: 0;
    transform: translateY(-5px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}