/* ====== GLOBAL ====== */
* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  margin: 0;
  background: #f7f8fa;
}
.dashboard {
  display: flex;
  height: 100vh;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 15px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logout-btn {
  background: #ff5e5e;
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* ====== PHONE NUMBERS ====== */
.phone-list {
  flex: 1;
  margin-top: 10px;
  overflow-y: auto;
}
.phone-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f5f6f8;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.phone-item.active {
  background: #e1e9ff;
  border-left: 4px solid #4a6cf7;
}
.phone-dot {
  width: 10px;
  height: 10px;
  background: #00cc66;
  border-radius: 50%;
}
.new-number-btn {
  background: #4a6cf7;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

/* ====== CONVERSATIONS ====== */
.conversations {
  width: 320px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}
.new-msg-btn {
  background: #4a6cf7;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
#searchBox {
  margin: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.convo-item {
  background: #f7f8fb;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}

/* ====== CHAT AREA ====== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chat-header {
  padding: 15px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}

/* ====== NEW MESSAGE AREA ====== */
.new-message-area {
  padding: 20px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}
.new-message-area.hidden {
  display: none;
}
.new-message-area input {
  width: 80%;
  padding: 8px;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.new-message-area button {
  margin-left: 10px;
  padding: 8px 12px;
  background: #4a6cf7;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
}

/* ====== CHAT MESSAGES ====== */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f7f8fa;
}
.message {
  max-width: 70%;
  margin: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

/* Sent message → Right */
.message.sent {
  background: #0078ff;
  color: #fff;
  margin-left: auto;
  text-align: right;
  border-bottom-right-radius: 0;
}

/* Received message → Left */
.message.received {
  background: #e5e5ea;
  color: #000;
  margin-right: auto;
  text-align: left;
  border-bottom-left-radius: 0;
}

/* Photo message */
.message img {
  max-width: 220px;
  border-radius: 10px;
  display: block;
  background: transparent;
}

/* Sent tick (✅) */
.message .tick {
  font-size: 12px;
  color: #dfffd6;
  position: absolute;
  bottom: 4px;
  right: 8px;
}

/* ====== CHAT INPUT ====== */
.chat-input {
  display: flex;
  align-items: center;
  padding: 8px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}
.icon-btn {
  background: #f2f3f5;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.icon-btn:hover {
  background: #e1e4e8;
}
.icon-btn img {
  width: 22px;
  height: 22px;
}
.send-btn {
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s;
}
.send-btn:hover {
  background: #3753c6;
}

/* ====== LOGIN / CREATE BOX ====== */
.center-box {
  width: 350px;
  margin: 100px auto;
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}
.center-box input {
  width: 90%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.center-box button {
  background: #4a6cf7;
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.center-box button:hover {
  background: #3753c6;
}
.new-message-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.new-message-popup.hidden {
  display: none;
}

.popup-content {
  background: white;
  padding: 30px 40px;
  border-radius: 12px;
  width: 350px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.popup-content h4 {
  margin-bottom: 10px;
}

.popup-content input {
  width: 90%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.popup-actions {
  display: flex;
  justify-content: space-around;
}

.popup-actions button {
  background: #4a6cf7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.popup-actions .cancel-btn {
  background: #e74c3c;
}
.new-message-area {
  background: #ffffff;
  border-top: 1px solid #ddd;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.new-msg-box {
  background: #f8f9ff;
  padding: -16px;
  border-radius: 15px;
  width: 500px;
  text-align: center;
  box-shadow: 11 12px 16px rgba(0,0,0,0.1);
}

.new-msg-box input {
  width: 90%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.new-msg-box button {
  background: #4a6cf7;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin: 5px;
}

.cancel-btn {
  background: #ff5e5e !important;
}
.chat-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-top: 1px solid #ddd;
  background: #fff;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  margin-right: 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.2s;
}

.icon-btn:hover {
  opacity: 1;
}

#chatText {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 25px;
  padding: 10px 15px;
  font-size: 15px;
  outline: none;
  margin: 0 10px;
}

.send-btn {
  background: #4a6cf7;
  border: none;
  color: #fff;
  font-size: 18px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: 0.2s;
}

.send-btn:hover {
  background: #3652d3;
}
/* ===== Toast Notification Style ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
