/* ===== SWITCH (переключатель) ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 129px;
  height: 40px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 40px;
  transition: all 0.3s;
  overflow: hidden;
}

/* Серый фон (по умолчанию) */
.slider::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e7e7e7;
  border-radius: 40px;
  transition: opacity 0.3s ease;
  z-index: 0;
}

/* Градиентный фон (активное состояние) */
.slider::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(240deg, #0076ab 0%, #00b0f0 100%);
  border-radius: 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

/* Сам движок (кружок) с текстом внутри */
.slider .handle {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  width: 99px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 38px;
  transition: 0.3s;
  pointer-events: none;
  z-index: 2;
}

.handle__text {
  font-weight: 600;
  font-size: 16px;
  line-height: 150%;
  background: linear-gradient(240deg, #0076ab 0%, #00b0f0 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.handle__textMb {
  display: none;
  background-image: url(../img/astroid.svg);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  width: 24px;
  height: 24px;
}

/* Состояние ВКЛ - показываем градиент, скрываем серый */
.switch input:checked + .slider::after {
  opacity: 1;
}

.switch input:checked + .slider::before {
  opacity: 0;
}

/* Движок в активном состоянии */
.switch input:checked + .slider .handle {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* ===== ОВЕРЛЕЙ ИИ-ПОИСКА ===== */
.agroknow__ai-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: rgba(0, 0, 0, 0.7); */
  background: rgba(34, 34, 34, 0.5);
  backdrop-filter: blur(10px);
  z-index: 999;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  animation: aiFadeIn 0.3s ease;
}

.agroknow__ai-overlay.active {
  display: flex;
}

.agroknow__ai-overlay .agroknow__form {
  margin-top: 0;
  border: 1px solid #eee;
}

.agroknow__ai-overlay-content {
  background: white;
  border-radius: 30px;
  padding: 4px;
  max-width: 940px;
  width: 90%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  animation: aiSlideUp 0.3s ease;
  position: relative;
}

/* Кнопка закрытия */
.agroknow__ai-overlay-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.2s;
  line-height: 1;
  padding: 8px;
  border-radius: 50%;
}

.agroknow__ai-overlay-close:hover {
  color: #333;
  transform: rotate(90deg);
}

/* Заголовок оверлея */
.agroknow__ai-overlay-title {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.agroknow__ai-overlay-subtitle {
  margin: 0 0 24px 0;
  font-size: 16px;
  color: #888;
}

/* ===== ФОРМА В ОВЕРЛЕЕ (копия основной) ===== */
.agroknow__form-ai {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f9fa;
  border-radius: 16px;
  padding: 4px;
  border: 2px solid #e8eaed;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  margin-bottom: 16px;
}

.agroknow__form-ai:focus-within {
  border-color: #0076ab;
  box-shadow: 0 0 0 4px rgba(0, 118, 171, 0.1);
}

/* Категории в оверлее */
.agroknow__form-ai .agroknow__form-ctgs {
  flex-shrink: 0;
}

.agroknow__form-ai .agroknow__form-ctgs-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.agroknow__form-ai .agroknow__form-ctgs-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.agroknow__form-ai .agroknow__form-ctgs-btn img {
  width: 20px;
  height: 20px;
}

/* ИИ-бейдж */
.agroknow__ai-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(
    240deg,
    rgba(0, 118, 171, 0.12) 0%,
    rgba(0, 176, 240, 0.12) 100%
  );
  border-radius: 40px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: #0076ab;
  white-space: nowrap;
}

.agroknow__ai-badge .ai-icon {
  font-size: 18px;
}

/* Поле ввода в оверлее */
.agroknow__form-ai .agroknow__form-field {
  flex: 1;
  min-width: 200px;
}

.agroknow__form-ai .agroknow__form-field input {
  width: 100%;
  padding: 12px 0;
  border: none;
  outline: none;
  font-size: 18px;
  font-family: inherit;
  background: transparent !important;
  color: #1a1a1a;
}

.agroknow__form-ai .agroknow__form-field input::placeholder {
  color: #bebebe;
}

/* Кнопка отправки в оверлее */
.agroknow__form-ai .agroknow__form-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(240deg, #0076ab 0%, #00b0f0 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  flex-shrink: 0;
  min-height: 48px;
}

.agroknow__form-ai .agroknow__form-submit:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 118, 171, 0.3);
}

.agroknow__form-ai .agroknow__form-submit:active {
  transform: scale(0.98);
}

.agroknow__form-ai .agroknow__form-submit svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===== ПОДСКАЗКИ ДЛЯ ИИ ===== */
.agroknow__ai-suggestions {
  margin-top: 16px;
}

.agroknow__ai-suggestions-title {
  font-size: 13px;
  color: #999;
  display: block;
  margin-bottom: 8px;
}

.agroknow__ai-suggestions-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-suggestion {
  padding: 6px 16px;
  background: #f5f7fa;
  border: 1px solid #e8eaed;
  border-radius: 20px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.ai-suggestion:hover {
  background: #0076ab;
  border-color: #0076ab;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 118, 171, 0.2);
}

/* ===== РЕЗУЛЬТАТЫ ПОИСКА ===== */
.agroknow__ai-results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.agroknow__ai-results-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  justify-content: center;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: #0076ab;
  border-radius: 50%;
  animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loadingDot {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  color: #888;
  font-size: 14px;
}

.agroknow__ai-results-content {
  animation: aiSlideUp 0.3s ease;
}

/* ===== АНИМАЦИИ ===== */
@keyframes aiFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes aiSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
  .agroknow__ai-overlay {
    padding: 20px 12px;
    /* align-items: center; */
  }

  .agroknow__ai-overlay-content {
    border-radius: 16px;
    max-width: 100%;
  }

  .agroknow__ai-overlay-title {
    font-size: 20px;
  }

  .agroknow__form-ai {
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }

  .agroknow__form-ai .agroknow__form-field {
    width: 100%;
    order: 3;
  }

  .agroknow__form-ai .agroknow__form-ctgs {
    order: 1;
  }

  .agroknow__ai-badge {
    order: 2;
  }

  .agroknow__form-ai .agroknow__form-submit {
    width: 100%;
    order: 4;
    justify-content: center;
  }

  .agroknow__ai-suggestions-list {
    flex-direction: column;
  }

  .ai-suggestion {
    white-space: normal;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .agroknow__ai-overlay-content {
    padding: 5px;
  }

  .agroknow__form-ai .agroknow__form-field input {
    font-size: 16px;
  }

  .agroknow__form-ai .agroknow__form-ctgs-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/*************************/

.agroknow__ai-overlay-content__inner {
  display: flex;
  flex-direction: column;
}

.agroknow__aiContent {
  position: relative;
}

.agroknow__aiInputArea {
  display: flex;
  /* align-items: center; */
  flex: 1;
  background-color: #f5f5f5;
  padding: 8px 8px 8px 20px;
  border-radius: 30px;
}

.agroknow__aiInputArea button.agroknow__form-submit {
  margin: 0 0 0 10px !important;
  padding: 8px 20px 8px 16px;
  min-height: unset !important;
}

.agroknow__form_ai {
  height: auto !important;
  align-items: center;
}

.agroknow__aiContent_empty {
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 404px;
  margin: 0 auto;
  padding: 60px 30px 100px;
  display: none;
}

.agroknow__aiContent_empty.active {
  display: flex;
}

.ai-stars {
  display: block;
  width: 100%;
  max-width: 78px;
  margin: 0 auto 30px;
}

.agroknow__aiContent_emptyTitle {
  font-weight: 600;
  font-size: 24px;
  line-height: 120%;
  text-align: center;
  color: #1a1f23;
}

.agroknow__aiContent_emptyDesc {
  font-weight: 600;
  font-size: 24px;
  line-height: 120%;
  text-align: center;
  background: linear-gradient(240deg, #0076ab 0%, #00b0f0 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.agroknow__aiContent_full {
  gap: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-areas: "left right" "warning right";
}

/* .agroknow__aiContent_left:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  transform: translateY(100%);
  height: 100px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%);
} */

.agroknow__aiContent_leftOuter {
  flex: 1;
  display: flex;
  flex-direction: column;
  grid-area: left;
}

.agroknow__aiContent_left {
  border: 1px solid #e7e5e4;
  border-radius: 20px;
  padding: 24px 4px 24px 24px;
  position: relative;
  overflow: hidden;
}

/* .agroknow__aiContent_left::after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  content: "";
  height: 100px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 1) 100%);
} */

.agroknow__aiContent_leftInner {
  height: 300px;
  min-height: 150px;
  max-height: 600px;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  position: relative;
}

.q_post {
  border-radius: 20px 20px 0 20px;
  padding: 12px 20px;
  background: #f5f5f5;
  width: 60%;
  margin-left: auto;
  margin-bottom: 22px;
  font-weight: 600;
  font-size: 15px;
  line-height: 140%;
  color: #222;
}

.q_aiPost {
}

.q_aiPost p {
  font-weight: 600;
  font-size: 15px;
  line-height: 140%;
  color: #222;
}

.q_aiPost a {
  border-radius: 20px;
  padding: 3px 8px;
  background: #f5f5f5;
  display: inline-block;
  transition: all 0.3s;
}

.q_aiPost a:hover {
  background: #cecece;
}

.agroknow__aiContent_right {
  border: 1px solid #e7e5e4;
  border-radius: 20px;
  padding: 24px 24px 12px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  grid-area: right;
}

.agroknow__aiContent_rightTitle {
  margin-bottom: 20px;
  font-weight: 400;
  font-size: 18px;
  line-height: 130%;
  color: #222;
}

.aiContent__files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aiFile {
  border-radius: 12px;
  padding: 12px;
  background-color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.aiFile:after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, #ffffff 80%);
  cursor: pointer;
  z-index: 1;
}

.aiFile span {
  font-weight: 600;
  font-size: 13px;
  line-height: 130%;
  color: #222;
  white-space: nowrap;
  max-width: 180px;
}

.ai_d_ico {
  position: absolute;
  opacity: 0;
  width: 35px;
  height: 35px;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e7e5e4;
  border-radius: 9px;
}

.aiFile:hover .ai_d_ico {
  opacity: 1;
}

/* WebKit (Chrome, Safari, Edge) */
.agroknow__aiContent_left::-webkit-scrollbar {
  width: 2px !important;
  height: 2px !important;
}

.agroknow__aiContent_left::-webkit-scrollbar-track {
  background: transparent;
}

.agroknow__aiContent_left::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 2px !important;
}

.agroknow__aiContent_left::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* Firefox */
.agroknow__aiContent_left {
  scrollbar-width: thin;
  scrollbar-color: #d0d0d0 transparent;
}

/**********************/

.agroknow__aiThinkElement {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agroknow__aiThinkElement img {
  width: 16px;
}

.agroknow__aiThinkElement span {
  font-weight: 600;
  font-size: 15px;
  line-height: 140%;
  color: #222;
  opacity: 0.5;
}

.fake_button1 {
  gap: 10px;
  min-height: 0;
  height: 40px;
  padding: 10px 20px;
  border: 1px solid #696969;
  line-height: 1;
  font-weight: normal;
  color: #696969;
  border-radius: 100px;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  opacity: 0.5;
}

.fake_button1:after {
  content: "";
  width: 16px;
  height: 16px;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  translate: 0 1px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBmaWxsPSIjNjk2OTY5IiBkPSJNMy4xMzggNi4xMzhhLjQ3LjQ3IDAgMCAxIC42NjcgMGw0LjIyNCA0LjIyNCA0LjIyMy00LjIyNGEuNDcxLjQ3MSAwIDAgMSAuNjY3LjY2N2wtNC41NTcgNC41NTdhLjQ3LjQ3IDAgMCAxLS42NjcgMEwzLjEzOCA2LjgwNWEuNDcuNDcgMCAwIDEgMC0uNjY3Ii8+PC9zdmc+);
}

/***************************/

.agroknow__aiContent_leftWarning {
  font-weight: 600;
  font-size: 11px;
  line-height: 130%;
  text-align: center;
  color: rgba(34, 34, 34, 0.3);
  padding-top: 12px;
  grid-area: warning;
}

.agroknow__aiContent_leftWarning a {
  color: #00b0f0;
}

.ai-overlay-closeBtn {
  position: absolute;
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: #f5f5f5;
  right: -56px;
  top: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.ai-overlay-closeBtn:hover {
  background: #c5c5c5;
}

.resize-handle {
  display: block;
  cursor: row-resize;
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  z-index: 10;
}

.open_ii {
  font-weight: 600;
  color: #e92020;
  cursor: pointer;
}
