/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #001f3f; /* Dark Navy Blue Background */
  color: #ffffff;
  line-height: 1.6;
  padding: 1rem;
}

/* Chat Container */
.chat-container {
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

/* Header */
.chat-container h2 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 1rem;
}

/* Messages Area */
#messages {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual Message */
.message {
  padding: 10px 14px;
  border-radius: 10px;
  position: relative;
  width: fit-content;
  max-width: 80%;
  word-wrap: break-word;
}

.message.mine {
  background-color: #6a00ff;
  color: white;
  align-self: flex-end;
}

.message.other {
  background-color: #24243e;
  color: white;
  align-self: flex-start;
}

.message .timestamp {
  font-size: 0.75rem;
  color: #bbb;
  position: absolute;
  bottom: -16px;
  right: 10px;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.top-bar button {
  background-color: transparent;
  color: white;
  border: 1px solid #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.top-bar button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Typing Status */
#typingStatus {
  font-style: italic;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: #aaa;
}

/* Chat Input */
.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.chat-input input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #666;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chat-input input[type="text"]::placeholder {
  color: #bbb;
}

.chat-input button {
  background-color: #6a00ff;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.chat-input button:hover {
  background-color: #5000c8;
  transform: translateY(-2px);
}

/* File Input Label */
.chat-input label {
  font-size: 20px;
  cursor: pointer;
}

/* Image Preview */
#preview {
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  display: none;
}

/* Emoji Picker Styling */
emoji-picker {
  position: absolute;
  bottom: 60px;
  right: 20px;
  z-index: 1000;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  background: #1e1e2f;
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

emoji-picker.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Dark Mode Support (optional toggle) */
body.dark-mode {
  background: #0c0c1e;
  color: #f1f1f1;
}

body.dark-mode .chat-container {
  background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .chat-input input[type="text"] {
  background-color: rgba(255, 255, 255, 0.08);
  color: #f1f1f1;
}

body.dark-mode .top-bar button {
  border-color: #ccc;
}
