/* ============================================================
   Divyansh AI Labs — "Divya" Premium AI Career Mentor Chatbot
   Scoped stylesheet (all classes prefixed with .divya- / #divya-*)
   Safe to drop into any page without conflicting styles.
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  --divya-navy:        #003c72;
  --divya-navy-deep:   #001529;
  --divya-navy-dark:   #002548;
  --divya-gold:        #fdd707;
  --divya-gold-soft:   #ffe75a;
  --divya-white:       #ffffff;
  --divya-line:        rgba(255, 255, 255, 0.10);
  --divya-line-soft:   rgba(255, 255, 255, 0.06);
  --divya-text:        rgba(255, 255, 255, 0.94);
  --divya-text-mute:   rgba(255, 255, 255, 0.62);
  --divya-user-bg:     #fdd707;
  --divya-user-text:   #001529;
  --divya-shadow-lg:   0 30px 80px rgba(0, 0, 0, 0.55);
  --divya-shadow-md:   0 12px 30px rgba(253, 215, 7, 0.35);
  --divya-radius-lg:   22px;
  --divya-radius-md:   14px;
  --divya-radius-pill: 999px;
  --divya-font:        'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- 2. Root + launcher ---------- */
#divya-chatbot,
#divya-chatbot *,
#divya-chatbot *::before,
#divya-chatbot *::after {
  box-sizing: border-box;
  font-family: var(--divya-font);
}

#divya-chatbot {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
}

.divya-launch {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--divya-gold) 0%, var(--divya-gold-soft) 100%);
  color: #000;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--divya-shadow-md);
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), box-shadow 0.3s;
}
.divya-launch:hover { transform: scale(1.08); }
.divya-launch:focus-visible { outline: 3px solid var(--divya-gold); outline-offset: 3px; }
.divya-launch.active {
  background: var(--divya-navy);
  color: var(--divya-gold);
}
.divya-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--divya-gold);
  opacity: 0.4;
  z-index: -1;
  animation: divyaPulse 2s infinite;
}
@keyframes divyaPulse {
  0%   { transform: scale(1);   opacity: 0.4; }
  70%  { transform: scale(1.6); opacity: 0;   }
  100% { opacity: 0; }
}

/* Notification badge (unread counter) */
.divya-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--divya-navy-deep);
}
.divya-badge.show { display: inline-flex; animation: divyaPop .35s ease; }
@keyframes divyaPop {
  0%   { transform: scale(0);   }
  60%  { transform: scale(1.15);}
  100% { transform: scale(1);   }
}

/* ---------- 3. Panel container ---------- */
.divya-panel {
  position: absolute;
  left: 0;
  bottom: 78px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(160deg, var(--divya-navy-dark) 0%, var(--divya-navy-deep) 100%);
  border: 1px solid var(--divya-line);
  border-radius: var(--divya-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--divya-shadow-lg);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.divya-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.divya-panel.minimized { display: none; }

/* ---------- 4. Header ---------- */
.divya-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--divya-navy) 0%, var(--divya-navy-deep) 100%);
  border-bottom: 1px solid var(--divya-line);
  flex-shrink: 0;
}
.divya-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--divya-gold) 0%, var(--divya-gold-soft) 100%);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  position: relative;
}
.divya-avatar::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--divya-navy);
}
.divya-title {
  flex: 1; min-width: 0;
  color: var(--divya-text);
}
.divya-title strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.divya-title span {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--divya-text-mute);
  margin-top: 2px;
}
.divya-title span i.fa-circle { color: #22c55e; font-size: 7px; }

.divya-h-actions {
  display: flex; align-items: center; gap: 4px;
}
.divya-icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .2s, color .2s;
}
.divya-icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.divya-icon-btn:focus-visible { outline: 2px solid var(--divya-gold); }

/* ---------- 5. Body / messages ---------- */
.divya-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.divya-body::-webkit-scrollbar { width: 6px; }
.divya-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }

/* Welcome card */
.divya-welcome {
  background: linear-gradient(135deg, rgba(253,215,7,0.10), rgba(253,215,7,0.02));
  border: 1px solid rgba(253,215,7,0.25);
  border-radius: 16px;
  padding: 16px;
  color: var(--divya-text);
  animation: divyaFadeIn .5s ease both;
}
.divya-welcome-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.divya-welcome-head i {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--divya-gold);
  color: #000;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.divya-welcome h4 { margin: 0; font-size: 15px; font-weight: 600; }
.divya-welcome p {
  margin: 6px 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.85);
}
.divya-welcome ul {
  margin: 0; padding-left: 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.80);
  line-height: 1.7;
}

/* Message rows */
.divya-msg {
  display: flex;
  gap: 8px;
  max-width: 92%;
  animation: divyaFadeIn .35s ease both;
}
.divya-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.divya-msg.bot  { align-self: flex-start; }

.divya-mava {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(253,215,7,0.14);
  color: var(--divya-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.divya-msg-inner { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.divya-bubble {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 11px 14px;
  border-radius: var(--divya-radius-md);
  font-size: 14px;
  line-height: 1.55;
  color: var(--divya-text);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.divya-msg.bot .divya-bubble  { border-bottom-left-radius: 4px; }
.divya-msg.user .divya-bubble {
  background: var(--divya-user-bg);
  color: var(--divya-user-text);
  border: none;
  border-bottom-right-radius: 4px;
}
.divya-bubble a       { color: var(--divya-gold); text-decoration: underline; }
.divya-msg.user .divya-bubble a { color: #001529; }
.divya-bubble strong  { font-weight: 600; }
.divya-time {
  font-size: 10.5px;
  color: var(--divya-text-mute);
  padding: 0 6px;
}
.divya-msg.user .divya-time { text-align: right; }

/* Inline actions inside bot bubble */
.divya-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.divya-act {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--divya-radius-pill);
  background: rgba(253,215,7,0.14);
  color: var(--divya-gold);
  border: 1px solid rgba(253,215,7,0.28);
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color .25s, color .25s, transform .2s;
  font-family: inherit;
}
.divya-act:hover { background: var(--divya-gold); color: #000; transform: translateY(-1px); }
.divya-act:focus-visible { outline: 2px solid var(--divya-gold); outline-offset: 2px; }

/* Typing indicator */
.divya-typing .divya-bubble { padding: 12px 16px; }
.divya-dot {
  display: inline-block;
  width: 7px; height: 7px;
  margin: 0 2px;
  border-radius: 50%;
  background: var(--divya-gold);
  opacity: 0.5;
  animation: divyaBlink 1.2s infinite;
}
.divya-dot:nth-child(2) { animation-delay: 0.2s; }
.divya-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes divyaBlink {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-3px); }
}
@keyframes divyaFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 6. Suggestions / quick chips ---------- */
.divya-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 14px 8px;
  flex-shrink: 0;
}
.divya-chip {
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: var(--divya-radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.86);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
  font-family: inherit;
  white-space: nowrap;
}
.divya-chip:hover {
  background: var(--divya-gold);
  color: #001529;
  border-color: var(--divya-gold);
  transform: translateY(-1px);
}
.divya-chip:focus-visible { outline: 2px solid var(--divya-gold); }

/* ---------- 7. Lead capture + booking forms ---------- */
.divya-form {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--divya-line);
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.divya-form h5 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--divya-text);
}
.divya-field { display: flex; flex-direction: column; gap: 4px; }
.divya-field label {
  font-size: 11.5px;
  color: var(--divya-text-mute);
  font-weight: 500;
}
.divya-field input,
.divya-field select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .25s, background-color .25s;
}
.divya-field input::placeholder { color: rgba(255,255,255,0.4); }
.divya-field input:focus,
.divya-field select:focus {
  border-color: var(--divya-gold);
  background: rgba(255,255,255,0.08);
}
.divya-field select option { background: var(--divya-navy-deep); color: #fff; }
.divya-field.err input,
.divya-field.err select { border-color: #ef4444; }
.divya-field small.err {
  color: #ef4444;
  font-size: 11px;
  margin-top: 2px;
}
.divya-form-submit {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--divya-gold) 0%, var(--divya-gold-soft) 100%);
  color: #001529;
  border: none;
  border-radius: var(--divya-radius-pill);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  font-family: inherit;
}
.divya-form-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(253,215,7,0.35); }

/* Slot picker (demo booking) */
.divya-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.divya-slot {
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.86);
  cursor: pointer;
  font-size: 12.5px;
  font-family: inherit;
  transition: all .2s;
}
.divya-slot:hover,
.divya-slot.active {
  background: var(--divya-gold);
  border-color: var(--divya-gold);
  color: #001529;
  font-weight: 600;
}

/* ---------- 8. Input bar ---------- */
.divya-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--divya-line);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.divya-emoji-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
  font-size: 16px;
  transition: background-color .2s, color .2s;
}
.divya-emoji-btn:hover { background: rgba(255,255,255,0.10); color: var(--divya-gold); }

.divya-input-field {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--divya-radius-pill);
  padding: 11px 16px;
  color: #fff;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  transition: border-color .25s, background-color .25s;
}
.divya-input-field::placeholder { color: rgba(255,255,255,0.42); }
.divya-input-field:focus { border-color: var(--divya-gold); background: rgba(255,255,255,0.09); }

.divya-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--divya-gold) 0%, var(--divya-gold-soft) 100%);
  color: #001529;
  cursor: pointer;
  font-size: 15px;
  transition: transform .2s, box-shadow .2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.divya-send:hover { transform: scale(1.06); box-shadow: 0 8px 20px rgba(253,215,7,0.4); }
.divya-send:focus-visible { outline: 3px solid var(--divya-gold); outline-offset: 2px; }

/* Emoji panel */
.divya-emoji-panel {
  position: absolute;
  left: 12px;
  bottom: 76px;
  background: var(--divya-navy-dark);
  border: 1px solid var(--divya-line);
  border-radius: 14px;
  padding: 10px;
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  box-shadow: var(--divya-shadow-lg);
  max-width: 280px;
}
.divya-emoji-panel.open { display: grid; }
.divya-emoji-panel button {
  background: transparent;
  border: none;
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color .2s;
}
.divya-emoji-panel button:hover { background: rgba(255,255,255,0.08); }

/* Footer branding */
.divya-brand {
  font-size: 10.5px;
  text-align: center;
  padding: 6px 12px 10px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.divya-brand strong { color: var(--divya-gold); font-weight: 600; }

/* ---------- 9. Mobile / responsive ---------- */
@media (max-width: 640px) {
  #divya-chatbot { left: 14px; bottom: 14px; }
  .divya-panel {
    width: calc(100vw - 28px);
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    border-radius: 18px;
  }
  .divya-launch { width: 56px; height: 56px; font-size: 22px; }
}
@media (max-width: 420px) {
  #divya-chatbot.fullscreen { left: 0; right: 0; bottom: 0; top: 0; }
  #divya-chatbot.fullscreen .divya-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  #divya-chatbot.fullscreen .divya-launch { display: none; }
}

/* ---------- 10. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #divya-chatbot *,
  #divya-chatbot *::before,
  #divya-chatbot *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
