/* Chat History Sidebar Styles */

.chat-top-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chat-top-menu .nav-link {
  cursor: pointer;
  margin: 0;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.chat-top-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.chat-history-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #dee2e6;
  z-index: 10;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.chat-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 1;
}

.chat-history-header h6 {
  margin: 0;
  font-weight: 600;
  color: #212529;
}

.chat-history-content {
  padding: 1rem;
}

.chat-history-section {
  margin-bottom: 1.5rem;
}

.chat-history-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-history-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-history-item:hover {
  background: #e9ecef;
  border-color: #dee2e6;
  transform: translateX(2px);
}

.chat-history-item.active {
  background: #e7f3ff;
  border-color: #0d6efd;
}

.chat-history-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #212529;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #6c757d;
}

.chat-history-item-type {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background: #ffffff;
  font-weight: 500;
}

.chat-history-item-type.type-general {
  color: #6c757d;
  background: #e9ecef;
}

.chat-history-item-type.type-lesson {
  color: #0d6efd;
  background: #e7f3ff;
}

.chat-history-item-type.type-task {
  color: #198754;
  background: #d1e7dd;
}

.chat-history-item-type.type-program {
  color: #fd7e14;
  background: #ffe5d0;
}

.chat-history-item-date {
  font-size: 0.7rem;
  color: #adb5bd;
}

.chat-history-item-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #6c757d;
}

/* Adjust chat widget when sidebar is visible */
#modalChat .modal-body {
  position: relative;
}

#modalChat .modal-body.with-sidebar #chat-widget {
  margin-left: 320px;
  transition: margin-left 0.3s ease;
}

/* Empty state */
.chat-history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
}

.chat-history-empty i {
  font-size: 3rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.chat-history-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chat-history-sidebar {
    width: 100%;
    max-width: 320px;
  }
  
  #modalChat .modal-body.with-sidebar #chat-widget {
    margin-left: 0;
    display: none;
  }
}
