* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  height: 100vh;
  background: #f5f5f5;
}

#sidebar {
  width: 260px;
  background: #2c3e50;
  color: white;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #34495e;
}

#sidebar-header {
  padding: 15px;
  background: #34495e;
  border-bottom: 1px solid #465a6d;
}

#new-chat-btn {
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
}

#new-chat-btn:hover {
  background: #2980b9;
}

#history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.history-item {
  padding: 12px;
  margin-bottom: 8px;
  background: #343541;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item:hover {
  background: #465a6d;
}

.history-item.active {
  background: #3498db;
}

.history-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.delete-history-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.delete-history-btn:hover {
  opacity: 1;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

#header-bar {
  padding: 15px 20px;
  background: #34495e;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2c3e50;
}

#header-bar h1 {
  font-size: 20px;
  font-weight: 600;
}

#header-bar select {
  padding: 8px 12px;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  cursor: pointer;
}

#model-select {
  border-color: #00aa66;
}

#profile-select {
  border-color: #0066cc;
}

#header-bar button {
  padding: 8px 16px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

#header-bar button:hover {
  background: #c0392b;
}



#input-box {
  padding: 15px 20px;
  background: white;
  border-top: 2px solid #e0e0e0;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#user-input {
  flex: 1;
  padding: 12px;
  border: 2px solid #3498db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 100px;
  max-height: 50vh;
}

#user-input:focus {
  outline: none;
  border-color: #2980b9;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-group button {
  padding: 12px 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.button-group button:hover {
  background: #2980b9;
}

#emoji-picker {
  position: absolute;
  bottom: 100px;
  right: 20px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
}

#emoji-picker.show {
  display: block;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.emoji-item {
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.emoji-item:hover {
  background: #f0f0f0;
}