/* mentor popup styles - begins */
/* Base container */
.mentor-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

/* Mentor image */
.mentor-image {
  width: 150px;
  height: auto;
  max-height: 250px;
  opacity: 0.9;
  pointer-events: auto;
  cursor: pointer;
  object-fit: contain;
  display: block;
}

/* Mentor visibility */
.mentor-container.mentor-disabled {
  display: none !important;
}

.mentor-container.mentor-disabled .mentor-image {
  display: none;
}

/* Popup container */
.mentor-popup {
  display: none;
  pointer-events: auto;
  margin-right: 20px;
}

.mentor-popup.mentor-popup-visible {
  display: block;
}

/* Content area */
.mentor-content {
  position: relative;
  background-color: #fff;
  padding: 20px;
  width: 400px;
  max-width: 500px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  margin-right: 20px;
  margin-bottom: 0px;
}

/* Speech bubble triangle */
.mentor-content:after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: 30px;
  border: 10px solid transparent;
  border-left-color: #fff;
  border-right: 0;
}

/* Header */
.mentor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.close-mentor {
  font-size: 24px;
  cursor: pointer;
}

/* Message area */
.mentor-message {
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Actions area */
.mentor-actions {
  text-align: right;
  clear: both;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mentor-button {
  padding: 8px 12px;
  cursor: pointer;
  display: inline-block;
}

/* Mentor selector */
.mentor-selector {
  display: flex;
  gap: 5px;
}

.mentor-selector-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  flex-shrink: 0;
}

.mentor-selector-button.active {
  border-color: #4CAF50;
}

.mentor-selector-button:hover {
  border-color: #999;
}

/* Mentor selector background images */
.mentor-selector-button.mentor-1 {
  background-image: url('/mentor/src/images/mentor1.png');
}

.mentor-selector-button.mentor-2 {
  background-image: url('/mentor/src/images/mentor2.png');
}

.mentor-selector-button.mentor-3 {
  background-image: url('/mentor/src/images/mentor3.png');
}

.mentor-selector-button.mentor-4 {
  background-image: url('/mentor/src/images/mentor4.png');
}

/* Controls */
.mentor-controls {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  pointer-events: auto;
}

.mentor-toggle {
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.mentor-toggle input {
  display: none;
}

.mentor-toggle-icon {
  font-size: 16px;
  color: #555;
}

.mentor-toggle:hover::after {
  content: 'Mentor';
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

/* Tooltip */
.mentor-image-container {
  position: relative;
  display: inline-block;
}

.mentor-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  background-color: #fff;
  color: #333;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  width: 250px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.mentor-tooltip.show {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* Feedback */
.mentor-feedback {
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.mentor-feedback p {
  font-size: 14px;
  margin-bottom: 8px;
}

.mentor-feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 5px;
}

/* Chat interface */
.mentor-chat-interface {
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

/* Chat mode specific styles */
.mentor-content.chat-mode .mentor-message {
  display: none;
}

.mentor-content.chat-mode .mentor-actions .mentor-button {
  display: none;
}

.mentor-content.chat-mode .mentor-actions {
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.mentor-content.chat-mode .mentor-chat-interface {
  margin-top: 0;
  border-top: none;
}

.mentor-content.chat-mode .mentor-chat-history {
  max-height: 350px;
}

.mentor-chat-history {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px solid #eee;
  border-radius: 5px;
  scrollbar-width: thin;
}

.mentor-chat-history {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px solid #eee;
  border-radius: 5px;
  scrollbar-width: thin;
}

.mentor-chat-history::-webkit-scrollbar {
  width: 6px;
}

.mentor-chat-history::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.mentor-chat-message {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  max-width: 95%;
}

.mentor-chat-message-content {
  line-height: 1.5;
  font-size: 15px;
}

.mentor-chat-user {
  background-color: #e6f7ff;
  margin-left: auto;
  text-align: right;
}

.mentor-chat-mentor {
  background-color: #f0f0f0;
  margin-right: auto;
}

.mentor-chat-system {
  background-color: #f9f9f9;
  margin: 5px auto;
  text-align: center;
  font-style: italic;
  color: #666;
}

.mentor-chat-input-container {
  display: flex;
  gap: 5px;
}

#mentor-chat-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Table styles for AI responses */
.mentor-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}

.mentor-table th,
.mentor-table td {
  padding: 8px;
  text-align: left;
  border: 1px solid #ddd;
}

.mentor-table th {
  background-color: #f2f2f2;
  font-weight: bold;
}

.mentor-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.mentor-chat-message-content ul,
.mentor-chat-message-content ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

.mentor-chat-message-content li {
  margin-bottom: 5px;
}

.mentor-chat-message-content p {
  margin-bottom: 10px;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile styles */
@media (max-width: 767px) {
  .mentor-container {
    flex-direction: column;
    left: 5vw;
    right: 5vw;
    bottom: 10px;
  }
  
  .mentor-popup {
    width: 100%;
    margin-right: 0;
    order: 1;
  }
  
  .mentor-content {
    width: 90vw;
    max-width: none;
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .mentor-content:after {
    display: none;
  }
  
  .mentor-image {
    max-width: 80px;
    order: 2;
    align-self: flex-end;
  }
  
  .mentor-chat-message {
    max-width: 95%;
  }
  
  .mentor-tooltip {
    display: none;
  }
  
  .mentor-tooltip.show {
    display: block;
  }
}
/* mentor popup styles - ends */
