/* === General Page Styling === */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* === Container === */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* === Top Bar (Logo + Title) === */
.top-bar {
  background: linear-gradient(to right, #ffffff, #fdf6e3); /* white → cream */
  color: #333;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-bar .logo {
  height: 50px; /* increased for visibility */
  width: auto;
  margin-right: 12px;
}

.top-bar h2 {
  font-size: 20px;
  margin: 0;
}

/* === Messages Container === */
.messages-main {
  flex: 1;
  overflow-y: auto;
}

#messagesContainer {
  padding: 15px;
  max-height: 70vh;
  overflow-y: auto;
  background: #fafafa;
}

/* === Message Bubble === */
.message {
  display: flex;
  margin: 10px 0;
}

.message.user {
  justify-content: flex-end;
}

.message.other {
  justify-content: flex-start;
}

.message-content {
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 65%;
  word-wrap: break-word;
  position: relative;
  font-size: 14px;
  line-height: 1.4;
}

.message.user .message-content {
  background: #fdf6e3; /* cream shade for own messages */
  border: 1px solid #e0e0e0;
}

.message.other .message-content {
  background: #ffffff;
  border: 1px solid #f0f0f0;
}

/* === Timestamp === */
.timestamp {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

/* === File Link === */
.file-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #0077cc;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

/* === Action Buttons (Edit/Delete) === */
.message-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.message-actions button {
  background: #f0f0f0;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-actions button:hover {
  background: #ddd;
}

/* === Input Bar (Bottom Fixed) === */
.message-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: #fff;
}

.message-input-bar input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.message-input-bar input[type="file"] {
  font-size: 12px;
}

.message-input-bar button {
  padding: 10px 15px;
  background: #0077cc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.message-input-bar button:hover {
  background: #005fa3;
}

/* === Bottom Navigation === */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  background: linear-gradient(to right, #ffffff, #fdf6e3);
  border-top: 1px solid #ddd;
}

.bottom-nav button {
  background: none;
  border: none;
  font-size: 14px;
  color: #333;
  padding: 6px 12px;
  cursor: pointer;
}

.bottom-nav button:hover {
  color: #0077cc;
}
