/* ===== VetPravda Smart Feedback Bar v9 ===== */
/* Узкая полоса + красивый попап + экран спасибо */

/* ── Полоса (fixed внизу) ─────────────────── */
#smart-feedback-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#smart-feedback-bar.fb-visible {
  display: block;
}

.fb-compact {
  background: #1a1a1a;
  color: #e8e8e8;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  font-size: 12px;
  border-top: 1px solid #2e2e2e;
  box-sizing: border-box;
}

.fb-section-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: #999;
  flex-shrink: 1;
  min-width: 0;
}

.fb-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
  position: relative;
}

/* Кнопки 👍 👎 */
.btn-thumb {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #d0d0d0;
  border-radius: 4px;
  padding: 2px 9px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
  height: 22px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-thumb:hover { background: #2a2a2a; border-color: #666; color: #fff; }
.btn-thumb-yes:hover { border-color: #5aaa80 !important; color: #5aaa80 !important; }
.btn-thumb-no:hover  { border-color: #cc6666 !important; color: #cc6666 !important; }

/* Разделитель */
.fb-sep {
  width: 1px;
  height: 16px;
  background: #333;
  margin: 0 4px;
  flex-shrink: 0;
}

/* Текстовые кнопки */
.btn-text {
  background: transparent;
  border: none;
  color: #777;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
  height: 22px;
  transition: color 0.15s;
  white-space: nowrap;
}
.btn-text:hover { color: #ccc; }

/* Кнопка 💬 (мобильный) */
.fb-more-btn {
  display: none;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 0 6px;
  height: 22px;
  border-radius: 4px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  position: relative;
}
.fb-more-btn:hover { color: #ccc; border-color: #666; }

/* Меню 💬 */
.fb-more-menu {
  display: none;
  position: absolute;
  bottom: 30px;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 4px 0;
  min-width: 200px;
  z-index: 9200;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.fb-more-menu.fb-open { display: block; }
.fb-more-menu .btn-text {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  font-size: 13px;
  color: #333;
  height: auto;
  border-bottom: 1px solid #f0f0f0;
}
.fb-more-menu .btn-text:last-child { border-bottom: none; }
.fb-more-menu .btn-text:hover { background: #f8f8f8; color: #111; }

/* Кнопка × */
.btn-close-bar {
  background: transparent;
  border: none;
  color: #555;
  font-size: 15px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  height: 22px;
  transition: color 0.15s;
  margin-left: 6px;
  flex-shrink: 0;
}
.btn-close-bar:hover { color: #aaa; }

/* ── Попап над полосой ─────────────────────── */
#fb-popup {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  bottom: 40px;
  left: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.10),
    0 12px 40px rgba(0,0,0,0.20);
  padding: 16px 16px 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  z-index: 9100 !important;
  transition: opacity 0.2s ease, visibility 0.2s;
  box-sizing: border-box;
}
#fb-popup.fb-popup-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.fb-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

#fb-popup .fb-popup-prompt {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  line-height: 1.45;
  margin: 0;
  flex: 1;
}

#fb-popup .fb-popup-close {
  background: none !important;
  border: none !important;
  color: #ccc !important;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-top: -1px;
  transition: color 0.15s;
}
#fb-popup .fb-popup-close:hover { color: #666 !important; }

#fb-popup .fb-popup-textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1.5px solid #e8e8e8 !important;
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: #222;
  resize: none;
  height: 80px;
  outline: none;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
  display: block;
}
.fb-popup-textarea:focus {
  border-color: #aaa;
  background: #fff;
}
.fb-popup-textarea::placeholder { color: #c0c0c0; }

.fb-popup-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

#fb-popup .btn-popup-skip {
  background: transparent !important;
  border: 1px solid #e0e0e0 !important;
  color: #aaa !important;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#fb-popup .btn-popup-skip:hover { background: #f5f5f5 !important; color: #666 !important; }

#fb-popup .btn-popup-send {
  background: #1a1a1a !important;
  border: none !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#fb-popup .btn-popup-send:hover { background: #333 !important; }

/* ── Экран благодарности внутри попапа ─────── */
.fb-thanks {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 6px;
  text-align: center;
  gap: 6px;
  min-height: 80px;
}
.fb-thanks.fb-thanks-visible {
  display: flex;
}
.fb-thanks-icon {
  font-size: 28px;
  line-height: 1;
}
.fb-thanks-text {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}
.fb-thanks-sub {
  font-size: 12px;
  color: #888;
  margin: 0;
}
/* скрыть основной контент попапа когда показано спасибо */
#fb-popup.fb-showing-thanks .fb-popup-header,
#fb-popup.fb-showing-thanks .fb-popup-textarea,
#fb-popup.fb-showing-thanks .fb-popup-footer {
  display: none;
}

/* ── Delayed Feedback Toast ──────────────────── */
#delayed-feedback-toast {
  display: none;
  position: fixed;
  bottom: 48px;
  right: 16px;
  z-index: 9300;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 16px 16px 12px;
  width: 260px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#delayed-feedback-toast.dt-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.dt-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}
.dt-close:hover { color: #666; }
.dt-text {
  font-size: 11px;
  color: #aaa;
  margin: 0 0 4px;
  padding-right: 18px;
}
.dt-question {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin: 0 0 12px;
  line-height: 1.4;
}
.dt-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dt-buttons button {
  background: transparent;
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  color: #333;
  transition: background 0.15s;
}
.dt-buttons button:hover { background: #f5f5f5; }
.dt-btn-yes { border-color: #5aaa80 !important; color: #3a8a60 !important; font-weight: 600; }
.dt-btn-yes:hover { background: #f0faf5 !important; }
.dt-btn-no  { border-color: #cc6666 !important; color: #aa4444 !important; }
.dt-btn-no:hover  { background: #fdf5f5 !important; }

/* ── Адаптив ───────────────────────────────── */
@media (max-width: 600px) {
  .fb-actions > .btn-text,
  .fb-actions > .fb-sep { display: none !important; }
  .fb-more-btn { display: flex !important; }
  .fb-section-title { font-size: 10px; }
  .fb-compact { padding: 0 10px; gap: 4px; }
  #fb-popup {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
  #fb-popup.fb-popup-open {
    transform: translateY(0);
  }
}
