/* Chat History Panel */
.chat-history-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease, visibility 0.3s ease;
  border-radius: 24px;
  visibility: hidden;
  pointer-events: none;
}

.chat-history-panel.visible {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Header */
.chat-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  background: #da4e29;
  color: #fff;
}

.chat-history-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-history-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-history-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* List */
.chat-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-history-empty {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* Chat Item */
.chat-history-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.chat-history-item:hover {
  background: #f8f8f8;
}

.chat-history-item-content {
  flex: 1;
  min-width: 0;
}

.chat-history-item-preview {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.chat-history-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
}

.chat-history-item-delete {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  margin-left: 8px;
}

.chat-history-item-delete:hover {
  color: #e74c3c;
  background: #fef2f2;
}

/* Footer */
.chat-history-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e5e5;
}

.chat-history-clear {
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #e74c3c;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.chat-history-clear:hover {
  background: #fef2f2;
  border-color: #e74c3c;
}

/* History Button in Header */
.chat-history-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  transition: background 0.2s;
}

.chat-history-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-history-btn svg {
  width: 16px;
  height: 16px;
}
