@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.chat-container {
  width: 400px;
  height: 600px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 15px;
  margin-right: 15px;
}

header {
  background: rgba(0, 0, 0, 0.1);
  color: white;
  padding: 15px;
  text-align: center;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.header,
h1 {
  font-weight: bold;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: transparent;
}

.message {
  margin: 10px 0;
  padding: 15px;
  border-radius: 10px;
  max-width: 80%;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-message {
  background: rgba(42, 123, 155, 1);
  color: #fff;
  margin-left: auto;
  align-self: flex-end;
}

.bot-message {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  align-self: flex-start;
}

.input-area {
  display: flex;
  padding: 10px;
  background: rgba(0, 0, 0, 0.1);
}

#user-input {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  border-radius: 8px;
}

#send-btn {
  background: #006aff;
  color: #fff;
  border: none;
  padding: 10px 15px;
  margin-left: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

#send-btn:hover {
  background: #00b3ff;
}

.default-message {
  display: none;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 10;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 15px;
  text-align: left;
}

.sidebar button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 10px;
}

.history-item {
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.no-history {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  margin-right: 10px;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

header .menu-btn {
  position: absolute;
  left: 15px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: black;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  transition: background 0.2s;
  gap: 10px;
}

.history-item:hover {
  background: gray;
}

.history-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-btn {
  background: none;
  border: none;
  color: #777;
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px; /* extra spacing */
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #e11d48;
}

.close-sidebar-btn {
  display: block;
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: -10px;
  margin-bottom: 15px;
}

.close-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
  .close-sidebar-btn {
    display: block;
  }
}

/* Large tablets and below */
@media (max-width: 992px) {
    .header, h1 {
        font-size: 1.75rem;
    }
}

/* Tablets and large phones */
@media (max-width: 768px) {
    .header, h1 {
        font-size: 1.5rem;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .header, h1 {
        font-size: 1.25rem;
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .header, h1 {
        font-size: 1.1rem;
    }
}
