/* ============================================================
   TUTOR WIDGET — floating button + chat drawer
   Fisier nou, zero modificari in fisierele existente.
   ============================================================ */

/* ---------- Floating button ---------- */
.tutor-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #3FA9C4;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 9000;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tutor-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.tutor-drawer {
  position: fixed;
  bottom: 92px;              /* deasupra FAB-ului */
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  overflow: hidden;           /* colturi rotunjite si pe copii */
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.tutor-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
}
body.theme-dark .tutor-drawer {
  background: #1c2128;
  color: #e6e6e6;
}

/* ---------- Header ---------- */
.tutor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
body.theme-dark .tutor-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.tutor-header .tutor-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #3FA9C4;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tutor-header-text {
  flex: 1;
  min-width: 0;
}
.tutor-header-text .tutor-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.tutor-header-text .tutor-context {
  font-size: 12px;
  opacity: 0.65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tutor-close {
  border: none;
  background: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.6;
  padding: 6px;
}
.tutor-close:hover { opacity: 1; }

/* ---------- Messages ---------- */
.tutor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tutor-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tutor-msg.user {
  align-self: flex-end;
  background: #3FA9C4;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.tutor-msg.assistant {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 4px;
}
body.theme-dark .tutor-msg.assistant {
  background: rgba(255, 255, 255, 0.08);
}
.tutor-msg.thinking {
  opacity: 0.55;
  font-style: italic;
}

/* ---------- Input ---------- */
.tutor-inputbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
body.theme-dark .tutor-inputbar {
  border-top-color: rgba(255, 255, 255, 0.08);
}
.tutor-inputbar textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  max-height: 110px;
  background: inherit;
  color: inherit;
}
body.theme-dark .tutor-inputbar textarea {
  border-color: rgba(255, 255, 255, 0.18);
}
.tutor-send {
  border: none;
  background: #3FA9C4;
  color: #fff;
  border-radius: 10px;
  width: 42px;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}
.tutor-send:disabled { opacity: 0.5; cursor: default; }

/* ---------- Mobile ---------- */
@media (max-width: 520px) {
  .tutor-drawer {
    right: 10px;
    left: auto;
    width: min(340px, calc(100vw - 20px));
    bottom: 80px;
    height: 55vh;
    max-height: 480px;
  }
}