/* ===============================
   FLOATING AI BUTTON
=============================== */
#ai-float-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s ease;
}

#ai-float-btn:hover {
  transform: scale(1.05);
}

/* ===============================
   AI MODAL
=============================== */
#ai-modal {
  position: fixed;
  right: 18px;
  bottom: 78px;
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
}

/* ===============================
   HEADER
=============================== */
/* HEADER */
.ai-header {
  position: relative;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

/* CLOSE BUTTON */
#ai-close {
  position: absolute;
  top: 10px;
  right: 12px;

  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.15);
  color: #fff;

  border: none;
  border-radius: 50%;

  font-size: 16px;
  font-weight: bold;
  cursor: pointer;

  line-height: 1;
  padding: 0;

  transition: background 0.2s ease;
}

#ai-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile notch / status bar safe */
@media (max-width: 480px) {
  .ai-header {
    padding-top: 18px;
  }
}

/* ===============================
   MODE & SUBJECT
=============================== */
.ai-controls {
  padding: 8px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e5e7eb;
}

.ai-controls select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 13px;
}

/* ===============================
   CHAT HISTORY (WHATSAPP STYLE)
=============================== */
#ai-chat-history {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f8fafc;
}

/* Messages */
.ai-msg {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 82%;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.ai-user {
  background: #2563eb;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.ai-bot {
  background: #e5e7eb;
  color: #111827;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

/* ===============================
   INPUT BAR (CHATGPT / WHATSAPP)
=============================== */
#ai-question {
  width: calc(100% - 80px);
  height: 38px;
  margin: 8px;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  resize: none;
  outline: none;
}

#ai-question:focus {
  border-color: #2563eb;
}

/* SEND BUTTON */
#ai-ask {
  position: absolute;
  right: 14px;
  bottom: 12px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

#ai-ask:hover {
  background: #1e40af;
}

/* ===============================
   QUIZ STYLE
=============================== */
.ai-quiz ul {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 20px;
}

.ai-quiz li {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  background: white;
}

.ai-quiz li.correct {
  background: #d1fae5;
  border-color: #10b981;
}

.ai-quiz li.wrong {
  background: #fee2e2;
  border-color: #ef4444;
}

.ai-quiz li.disabled {
  pointer-events: none;
  opacity: 0.85;
}

#mcq-quiz{
  font-style: oblique;
  font-weight: bold;
}

/* ===============================
   INTERVIEW / CARD UI
=============================== */
.ai-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #ffffff;
}

.ai-card b {
  color: #111827;
}

/* ===============================
   MOBILE
=============================== */
@media (max-width: 480px) {
  #ai-modal {
    right: 0;
    left: 0;
    bottom: 0;
    top: auto;

    width: 100%;
    height: 85vh;   /* 🔥 90vh ki jagah */

    border-radius: 16px 16px 0 0; /* chat app feel */
  }
}




/* ===============================
   Code Lines explanation / CARD UI
=============================== */

.explain-code{
    padding: 2px 6px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: white;
}