/* ══════════════════════════════════════════════════
   PASTE AT BOTTOM OF style.css
   Nova AI Tutor Widget
   ══════════════════════════════════════════════════ */

/* ── Floating Action Button ───────────────────────── */
.tutor-fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 350;
  background: var(--navy);
  border: none;
  border-radius: 50px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 4px 16px rgba(15,31,69,0.3),
    0 0 0 0 rgba(232,160,32,0);
}

.tutor-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 8px 24px rgba(15,31,69,0.35),
    0 0 0 6px rgba(232,160,32,0.12);
}

.tutor-fab.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(8px);
}

.fab-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 12px;
  position: relative;
  z-index: 1;
}

.fab-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #f5b942);
  color: var(--navy);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fab-label {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.fab-premium-badge {
  font-size: 0.55rem;
  color: var(--gold);
  position: absolute;
  top: 6px;
  right: 6px;
}

/* Pulsing ring */
.fab-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50px;
  border: 2px solid rgba(232,160,32,0.4);
  animation: fab-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes fab-pulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  70%  { transform: scale(1.08); opacity: 0; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* ── Chat Panel ───────────────────────────────────── */
.tutor-panel {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 360px;
  max-height: calc(100vh - 100px);
  background: var(--white);
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(15,31,69,0.2),
    0 4px 16px rgba(15,31,69,0.1);
  display: flex;
  flex-direction: column;
  z-index: 350;
  overflow: hidden;
  border: 1px solid rgba(15,31,69,0.08);

  /* Hidden by default */
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom left;
}

.tutor-panel.tutor-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.tutor-header {
  background: linear-gradient(120deg, var(--navy), #1a3060);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.tutor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutor-header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #f5b942);
  color: var(--navy);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tutor-header-name {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.tutor-header-status {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.tutor-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.8);
  animation: status-blink 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.tutor-header-actions {
  display: flex;
  gap: 4px;
}

.tutor-action-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.tutor-action-btn:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

/* Context bar */
.tutor-context-bar {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: #f8f7f4;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--slate);
  flex-shrink: 0;
}

.ctx-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ctx-text strong { color: var(--navy); }

/* Messages area */
.tutor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  max-height: 340px;
  scroll-behavior: smooth;
}

.tutor-messages::-webkit-scrollbar { width: 3px; }
.tutor-messages::-webkit-scrollbar-track { background: transparent; }
.tutor-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Message bubbles */
.tutor-msg {
  display: flex;
  gap: 7px;
  align-items: flex-end;
  animation: msg-in 0.2s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tutor-msg-nova {
  align-self: flex-start;
  max-width: 90%;
}

.tutor-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 85%;
}

.tutor-msg-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #f5b942);
  color: var(--navy);
  font-family: var(--display);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tutor-msg-bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--navy);
}

.tutor-msg-nova .tutor-msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.tutor-msg-user .tutor-msg-bubble {
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.tutor-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.tutor-typing span {
  width: 6px; height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.tutor-typing span:nth-child(2) { animation-delay: 0.2s; }
.tutor-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Suggested prompt chips */
.tutor-suggestions {
  display: flex;
  gap: 5px;
  padding: 0 12px 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tutor-chip {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--slate);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tutor-chip:hover {
  border-color: var(--gold);
  color: var(--navy);
  background: var(--gold-lt);
}

/* Input area */
.tutor-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}

.tutor-input {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--navy);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.45;
  max-height: 120px;
  overflow-y: auto;
}
.tutor-input:focus {
  border-color: var(--gold);
  background: #fff;
}
.tutor-input::placeholder { color: var(--muted); }

.tutor-send-btn {
  width: 36px; height: 36px;
  background: var(--navy);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.tutor-send-btn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--navy);
  transform: scale(1.05);
}
.tutor-send-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tutor-footer-note {
  text-align: center;
  font-size: 0.57rem;
  color: var(--muted);
  padding: 4px 12px 10px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 500px) {
  .tutor-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 16px;
  }
  .tutor-fab {
    left: 16px;
    bottom: 16px;
  }
}