/* 🌈 Modern Chat App UI - style.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* ✨ Animated Gradient Background */
body {
  background: linear-gradient(-45deg, #7b2ff7, #f107a3, #00dbde, #fc00ff);
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 🧩 Card Layout */
.container {
  width: 100%;
  padding: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

/* ✨ Inputs */
input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  margin: 10px 0;
  font-size: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transition: background 0.3s ease;
}

input::placeholder {
  color: #ddd;
}

input:focus {
  background: rgba(255, 255, 255, 0.3);
}

/* 🟣 Buttons */
.btn {
  width: 48%;
  padding: 12px 0;
  background: linear-gradient(90deg, #00dbde, #fc00ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

.ghost {
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border: 2px solid #fff;
}

.logout-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transition: background 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* 💬 Chat Box */
#chat-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  height: 400px;
  overflow-y: auto;
  padding: 12px;
  margin: 15px 0;
}

.message-container {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.message-container.sent {
  justify-content: flex-end;
}

.message-container.received {
  justify-content: flex-start;
}

.message-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 80%;
}

.letter-circle {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(90deg, #00dbde, #fc00ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.username {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

.message-text {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 4px;
  font-size: 15px;
  word-wrap: break-word;
  color: white;
}

/* ✏️🗑️ Buttons */
.btn-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-left: 10px;
}

.edit-icon,
.delete-icon {
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin-left: 6px;
}

.edit-icon:hover,
.delete-icon:hover {
  transform: scale(1.3);
  opacity: 0.9;
}


/* 📱 Responsive Design */
@media (max-width: 600px) {
  .card {
    padding: 20px;
  }

  .message-wrapper {
    max-width: 95%;
  }

  input, .btn {
    font-size: 14px;
  }

  #chat-box {
    height: 350px;
  }
}

.small-note {
  margin-top: 12px;
  font-size: 12px;
  color: #eee;
  opacity: 0.9;
}
