

.settings-pane {
overflow: auto;
}

.settings-pane::-webkit-scrollbar {
    width: 10px;
}
.settings-pane::-webkit-scrollbar-track {
    background-color: var(--light);
}
.settings-pane::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background-color: var(--gray);
}

.dark-mode .settings-pane::-webkit-scrollbar-track {
    background-color: var(--dark);
}


@media only screen and (min-width: 1024px) {

  body {
    min-height: 100vh; /* Вместо max-height */
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

.tabs {
    flex: 1; /* Растягивает контейнер, чтобы футер оставался внизу */
}


.footer-pane {
    margin-top: auto; /* Прижать футер к низу */
}

.hideOnMobile {
        display: block;
    }
    .hideOnMobile .divider-custom {
        display: block;
    }
}


/*end of freelancer css */
 
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.input-clear-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

#clearbtn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0;
  display: none;
}

#clearbtn:hover {
  color: #000;
}

.mainbutton {
  /*position: absolute; 
  right :35px; */
  z-index:9999;
}

.searchinput {
  z-index: 9; 
  width: 100%;
}

.searchinputdiv {
	position: relative; 
	flex-grow: 1;
}

.searchbar {
  z-index:1;
}


	.btn-fixed-width {
  width: 30px; /* Замените на желаемую фиксированную ширину */
}

  .btn-rotate {
    transition: transform 0.3s ease;
  }

  .btn-rotate.rotate {
    transform: rotate(180deg);
  }

::-webkit-scrollbar {
width: 16px;
height: 16px; }

::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,0.10),inset 0 -1px 0 rgba(0,0,0,0.07); }

.ui-autocomplete { 
max-height: 220px; 
min-height: 38px;
overflow-y: auto; 
overflow-x: hidden;
border-radius: 1rem;
max-width: 274px;
align-items: center;
}

.ui-autocomplete2 { 
max-height: 220px; 
min-height: 38px;
overflow-y: auto; 
overflow-x: hidden;
border-radius: 1rem;
max-width: 474px;
align-items: center;
}

.droponmain {
  height: 32px;
  padding: 3px 3px 3px 3px;
  background-color: #fff;
  background-clip: padding-box;
  border: 0.125rem solid #ced4da;
}


[data-theme="dark"] .droponmain {
    background: #e4e4e4;
    border-color: #6e6969; 
	border: 0.125rem solid #6e6969;
}

[data-theme="dark"] .border-primary {
    border-color: #6e6969 !important;
}


.roundedborder{
  position: absolute; 
  right :35px; 
  z-index:999999;
}
/*
.outlink {
  color:#0d6efd;
}
*/
/* Container holding the image and the text */
.imgcontainer {
  position: relative;
  text-align: center;
  color: white;
}

/* Centered text */
.centered {
  position: absolute;
  top: 15px;
  left: 15px;
  
}





.search-button {
    transition: 0s !important;
}

.search-box {
    transition: 0s !important;
    width: 300px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-button {
    background-color: var(--primary);
    border-radius: 7px;
    border: none;
    box-shadow: var(--shadow-default);
    color: var(--light);
    height: 30px;
  width: 80px !important;
  margin-left: 5px !important;

    padding: 5px 10px;
  white-space: nowrap; /* чтобы текст не переносился */

  
}


  .bubble-notification {
      position: fixed;
      bottom: 8%;
      left: 50%;
  /*  outline: 2px solid white; */
    box-shadow: 0 0 5px black;
      background: var(--primary);
      color: white;
      padding: 12px 20px;
      border-radius: 24px;
      font-size: 14px;
      opacity: 0;
      transform: translate(-50%, 20px);
      transition: all 0.3s ease;
      z-index: 100000;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
      display: flex;
      align-items: center;
      gap: 8px;
      pointer-events: none;
      max-width: 80%;
      text-align: center;
      white-space: nowrap;
    }
    
    .bubble-notification.show {
      opacity: 1;
      transform: translate(-50%, 0);
    }
    
    .bubble-notification::before {
      content: "";
      font-size: 16px;
    }




@media only screen and (max-width: 900px) {

#search-help-button {
        display: none;
    }

.search-button {
  height: auto;
}

}



/* DPD extra*/

body {
    transition: 0s !important;
}

.hidden {
        display: none;
    }
    
.search-box {
    padding-right: 25px; /* Чтобы место для крестика появилось */
    position: relative;
}

.search-box::-webkit-input-placeholder {
    /* Стиль для текстов-подсказок в поле */
    color: transparent;
}

.search-box:focus::-webkit-search-cancel-button {
    display: block;
    position: absolute;
    right: 5px;
    top: 10px;
  /*  transform: translateY(-50%);*/
    cursor: pointer;
    color: #888;
}

.alogo {
    text-decoration: none; /* Убирает подчеркивание */
    color: inherit; /* Наследует цвет текста от родительского элемента */
}

/* Для мобильных устройств */
.settings-icon {
  display: none; /* Скрыть иконку по умолчанию */
}


.header-lang-button {
    display: none;
  }

.round-button {
    /* Размеры и форма */
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
    min-width: 30px !important;
    min-height: 30px !important;
    border-radius: 50%;
    /*min-width: 1.8em;  Фиксированная минимальная ширина */
    
    /* Стили */
    background-color: var(--primary);
    border: none;
    box-shadow: var(--shadow-default);
    color: var(--light);
    
    /* Выравнивание содержимого */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* Текст */
    font-size: 1em;
    line-height: 1;
    
    /* Поведение */
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0; /* Убираем стандартные отступы */
}

/* Состояния кнопки */
.round-button:hover {
    background-color: var(--primary-alt);
    box-shadow: var(--shadow-hover);
}

.round-button:active {
    transform: scale(0.95);
}

/* Темная тема */
.dark-mode .round-button {
    color: var(--dark);
}



@media (max-width: 768px) {
.input-group {
        display: flex; /* Делаем контейнер flex */
        align-items: center; /* Выравниваем элементы по центру вертикально */
        justify-content: center; /* Выравниваем элементы по центру горизонтально */
        width: 100%; /* Занимаем всю доступную ширину */
    }

.search-box {
    min-width: 200px; /* Минимальная ширина поля ввода */
    max-width: 350px; /* Максимальная ширина поля ввода */
   /*  flex: 3; Занимает 3/4 ширины */
    margin: 0; /* Убираем отступы */
    width: 100%; /* Заполняет доступное пространство */
}

#search-help-button {
        display: none;
    }
 
.hideOnMobile {
        display: none;
    }

.hideOnMobile .divider-custom {
        display: none;
    }
 
.imgonmain {
    max-width: 95%;
  }
 
.header-pane {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* Чтобы форма поиска занимала оставшееся пространство */
#search-form {
    flex-grow: 1;
    min-width: 0;
}


  .logo-title {
        display: none;
    }

.header-lang-button {
        display: flex;
    }



    #history-content {
    display: none; /* Скрыть контент по умолчанию */
  }


    #settings-content {
    display: none; /* Скрыть контент по умолчанию */
  }

    .history-icon {
    display: inline-block; /* Показываем иконку на мобильных */
    width: 20px;
    height: 20px;
    margin-right: 8px; /* Расстояние между иконкой и текстом */
    background-image: url('/static/clock-rotate-left.svg');
    background-size: contain;
    background-repeat: no-repeat;
  }
  
  
    .settings-icon {
    display: inline-block; /* Показываем иконку на мобильных */
    width: 20px;
    height: 20px;
    margin-right: 8px; /* Расстояние между иконкой и текстом */
    background-image: url('/static/gear.svg');
    background-size: contain;
    background-repeat: no-repeat;
  }

}

/* Стиль для кнопки сворачивания */
.collapse-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
     color: var(--foreground-light);
 
/*  color: #333; */
}

.dark-mode .collapse-btn {
    color: var(--foreground-dark);
}


@media (max-width: 450px) {
    .header-pane {
        flex-wrap: nowrap !important;
        gap: 3px;
        padding: 5px;
    }

    .search-box {
        min-width: 0;
        flex: 1;
        font-size: 14px;
        padding: 2px 5px;
    }

    .search-button {
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        margin-left: 3px !important;
        font-size: 12px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-button span {
        display: none;
    }

    .search-button::before {
        content: "Go";
    }

    .round-button {
        font-size: 14px;
    }

    .header-pane > * {
        flex-shrink: 1;
    }

    .input-group {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
}

  #history-list {
    list-style-type: none;
  }


/* Стили для спиннера */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Изменено с center на flex-start */
    padding: 20px;
    position: relative;
    min-height: 100px; /* Минимальная высота для видимости */
}

.transparent-spinner {
    position: fixed; /* Фиксируем относительно viewport */
    top: 50%;       /* По вертикали — центр */
    left: 50%;      /* По горизонтали — центр */
    transform: translate(-50%, -50%);
    z-index: 9999;  /* Поверх всех элементов */
    padding: 20px;
}


.loading-spinner {
    opacity: 0.6;
    width: 40px;
    height: 40px;
    filter: invert(0%);
    animation: spin 1s linear infinite;
}

.dark-mode .loading-spinner {
    filter: invert(100%);
}

.loading-text {
    margin-top: 10px;
    color: #666;
    text-align: center;
}

.dark-mode .loading-text {
    color: #aaa;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Чтобы спиннер не сдвигал содержимое */
.dpdResults {
    position: relative;
}



/* More Hide */ 

  .message-container {
    max-width: 600px; /* Можно настроить под ваш дизайн */
    margin: 0 auto;
  }

  .toggle-checkbox {
    display: none;
  }
  
  .collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .toggle-checkbox:checked ~ .collapsible {
    max-height: 500px; /* Достаточно для контента */
  }
  
  .toggle-button-container {
    text-align: right; /* Кнопка справа под текстом */
    margin-top: 8px;
  }
  
  .toggle-button {
    display: inline-block;
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    padding: 4px 8px;
    background: none;
    border: none;
    text-decoration: none;
  }
  
  .toggle-button:hover {
    text-decoration: underline;
  }
  
  /* Переключение текста кнопки */
  .hide-text {
    display: none;
  }
  .more-text {
    display: inline;
  }
  
  .toggle-checkbox:checked ~ .toggle-button-container .more-text {
    display: none;
  }
  .toggle-checkbox:checked ~ .toggle-button-container .hide-text {
    display: inline;
  }


/* Базовые стили баннера */
.pwa-install {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 12px 16px;
  z-index: 1000;
  max-width: calc(100% - 32px);
  min-width: 280px;
  width: auto;
  /*  box-sizing: border-box;
  
 Светлая тема по умолчанию */
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  transition: all 0.3s ease;
  will-change: transform, opacity;
  touch-action: none;
}

/* Темная тема */
.dark-mode .pwa-install,
.bg-dark .pwa-install,
[data-bs-theme="dark"] .pwa-install {
  background-color: var(--bs-secondary);
  border-color: var(--bs-border-color-translucent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Скрытое состояние */
.pwa-install.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(20px);
}

/* Основной контент */
.pwa-install-content {
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 0;
  gap: 12px;
  overflow: hidden;
}

/* Иконка приложения */
.pwa-install .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: var(--bs-tertiary-bg);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* Текстовый блок */
.pwa-install .text {
  min-width: 0;
  flex-grow: 1;
}

.pwa-install .text h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--bs-heading-color);
 
}

.pwa-install .text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--bs-secondary-color);
 
}

/* Контейнер кнопок действий */
.pwa-install .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* Общие стили кнопок */
.pwa-install button {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  outline: none;
  line-height: 1.2;
}

/* Кнопка установки */
#installBtn {
  background: var(--bs-secondary);
  color: var(--bs-white);
}

#installBtn:hover {
  background: var(--bs-primary);
}

#installBtn:active,
#installBtn:focus {
  background: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-secondary-rgb), 0.3);
}

/* Кнопка закрытия */
#closePwaBanner {
  background: transparent;
  color: var(--bs-secondary-color);
  padding: 6px;
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#closePwaBanner:hover {
  color: var(--bs-emphasis-color);
  background: var(--bs-tertiary-bg);
}

#closePwaBanner:active,
#closePwaBanner:focus {
  box-shadow: 0 0 0 3px rgba(var(--bs-secondary-color-rgb), 0.2);
}

/* Темная тема для кнопок */
.dark-mode #installBtn,
.bg-dark #installBtn,
[data-bs-theme="dark"] #installBtn {
  background: #136857;
}

.dark-mode #installBtn:hover,
.bg-dark #installBtn:hover,
[data-bs-theme="dark"] #installBtn:hover {
  background: var(--bs-primary);
}

.dark-mode #closePwaBanner,
.bg-dark #closePwaBanner,
[data-bs-theme="dark"] #closePwaBanner {
  color: var(--bs-secondary-color-dark);
}

.dark-mode #closePwaBanner:hover,
.bg-dark #closePwaBanner:hover,
[data-bs-theme="dark"] #closePwaBanner:hover {
  color: var(--bs-emphasis-color-dark);
  background: var(--bs-tertiary-bg-dark);
}

/* Адаптация для мобильных устройств */
@media (max-width: 400px) {
  .pwa-install {
    flex-wrap: wrap;
    padding-bottom: 12px;
  }
  
  .pwa-install-content {
    width: 100%;
    margin-right: 0;
  }
  
  .pwa-install .actions {
    width: 100%;
    justify-content: flex-end;
    order: 2;
  }
  
  #closePwaBanner {
    position: absolute;
    top: 8px;
    right: 8px;
  }
  
  .pwa-install .text h2,
  .pwa-install .text p {
    padding-right: 24px; /* Чтобы текст не заходил под кнопку закрытия */
  }
}

/* Особый случай для очень узких экранов */
@media (max-width: 300px) {

  .pwa-install {
    min-width: auto;
    width: calc(100% - 32px);
  }
  
  .pwa-install .actions {
    flex-direction: column;
    width: 100%;
  }
  
  #installBtn {
    width: 100%;
  }
}

/* Исправление для меню Dicts на мобильных */
#tab-container {
    overflow: visible !important; /* Разрешает меню выходить за границы панели */
    z-index: 2000 !important;     /* Поднимает панель (и меню) над всем остальным контентом */
    position: relative;           /* CHANGE: sticky -> relative */
    /* bottom: 0; */              /* CHANGE: Removed to stop anchoring to bottom of viewport */
    width: 100%;                  /* ADD: Ensures the bar spans the full width */
}

/* Дополнительная страховка для самого меню */
.dict-dropdown-menu {
    z-index: 2001 !important; /* Меню должно быть выше контейнера */
}


.hidden {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0s 0.3s;
}




/* Стили для 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;
  bottom: 100%;
  left: 0; /* Жесткое выравнивание по левому краю */
  background-color: var(--light);
  border-radius: 7px;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1001;
  padding: 8px 0;
  font-size: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--gray-transparent);
  margin-bottom: 8px;
}
.dict-dropdown-menu-down {
  display: none;
  position: absolute;
  top: 100%; /* Изменено с bottom: 100% на top: 100% */
  left: 0;
  background-color: var(--light);
  border-radius: 7px;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: 1001;
  padding: 8px 0;
  font-size: 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--gray-transparent);
  margin-top: 8px; /* Изменено с margin-bottom на margin-top */
}
/* Общие стили скроллбара для обоих типов меню */
.dict-dropdown-menu::-webkit-scrollbar,
.dict-dropdown-menu-down::-webkit-scrollbar {
  width: 10px;
}

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

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

.dict-dropdown-menu::-webkit-scrollbar-thumb,
.dict-dropdown-menu-down::-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,
.dark-mode .dict-dropdown-menu-down {
  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);
}
/* Анимация появления для обоих типов меню */
.dict-dropdown-menu.show,
.dict-dropdown-menu-down.show {
  display: block;
  animation: fadeInUp 0.2s ease-out;
}
@keyframes fadeInUp {
  from { 
    opacity: 0;
    transform: translateY(5px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.round-button.dict-dropdown-toggle {
  /*background-color: var(--gray-transparent);  */
  background: none;
  font-size: 1.2em;
  padding: 0.3em 0.6em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dark-mode .round-button.dict-dropdown-toggle {
  border: 2px solid var(--gray-transparent);  
    box-shadow: var(--primary);
}

.round-button.dict-dropdown-toggle:hover {
  text-decoration: none !important; /* Убираем подчёркивание при наведении */
 box-shadow: var(--shadow-default);
}



/* Стили только для мобильных устройств */
@media (max-width: 750px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 90vh; /* Минимальная высота - весь экран */
    }

    .tabs {
        flex: 1; /* Растягивает контейнер, чтобы футер оставался внизу */
    }

    .footer-pane {
        margin-top: auto; /* Прижимает футер к низу */
    }
}

.dict-dropdown-menu,
.dict-dropdown-menu-down {
  display: none;
  position: fixed !important; /* Ключевое: отвязываем от родителя */
  z-index: 999999 !important; /* Поверх всего */
  min-width: 260px;
  background-color: var(--light);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  /* Убираем статические отступы, так как их теперь ставит JS */
  margin: 0 !important; 
}
