/* Modern monochrome design with smooth animations and glows */

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Changed to monochrome gradient from dark to slightly lighter gray */
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #e5e5e5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.6;
}

a,
button {
  font-family: inherit;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  /* Updated to monochrome with subtle transparency */
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0;
  /* Updated text shadow for lowercase "basically" */
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#meDisplay {
  font-size: 0.875rem;
  color: #a0a0a0;
  font-weight: 500;
  padding: 0.5rem 1rem;
  /* Monochrome background */
  background: rgba(30, 30, 30, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

button {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  /* Monochrome gradient for buttons */
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
  /* White glow on buttons */
  box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

button:hover {
  transform: translateY(-1px);
  /* Enhanced white glow on hover */
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
}

button:active {
  transform: translateY(0);
}

.hidden {
  display: none;
}

/* Auth box */
#authBox {
  max-width: 380px;
  margin: 3rem auto;
  padding: 2rem;
  /* Monochrome with transparency */
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

#authBox input {
  width: 100%;
  /* Dark monochrome input background */
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e5e5;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
}

#authBox input:focus {
  outline: none;
  /* White border and glow on focus */
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 0 15px rgba(255, 255, 255, 0.15);
}

#authBox input::placeholder {
  color: #666666;
}

.auth-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-buttons button {
  flex: 1;
}

/* Chat container */
.chat-container {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  width: 280px;
  /* Monochrome sidebar background */
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  height: 600px;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  /* Gray scrollbar */
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar h2 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #a0a0a0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.sidebar h2:first-child {
  margin-top: 0;
}

.sidebar input {
  width: 100%;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e5e5;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.sidebar input:focus {
  outline: none;
  /* White glow on focus */
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.sidebar input::placeholder {
  color: #666666;
}

.sidebar button {
  width: 100%;
  padding: 0.625rem;
  font-size: 0.875rem;
}

.userItem,
.requestItem {
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: rgba(10, 10, 10, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  /* Add position relative for badge positioning */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.userItem:hover,
.requestItem:hover {
  /* White glow on hover instead of blue */
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Add styles for unread message indicator */
.userItem.has-unread {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.userItem.has-unread:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  color: #0a0a0a;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.4), 0 0 25px rgba(255, 255, 255, 0.3);
  }
}

.requestItem {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.requestItem button {
  padding: 0.5rem;
  font-size: 0.8125rem;
}

/* Chat section */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 600px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#chatInfo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#chatWith {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

#chatIdentity {
  font-size: 0.875rem;
  color: #a0a0a0;
  margin-left: 0.5rem;
}

.friend-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.friend-buttons button {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

#friendStatus {
  font-size: 0.8125rem;
  color: #a0a0a0;
  padding: 0.375rem 0.75rem;
  background: rgba(10, 10, 10, 0.4);
  border-radius: 6px;
}

#messages {
  flex: 1;
  background: rgba(10, 10, 10, 0.4);
  padding: 1.25rem;
  border-radius: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-track {
  background: rgba(10, 10, 10, 0.3);
  border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.msg {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 70%;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  word-wrap: break-word;
  animation: slideIn 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.me {
  /* Monochrome gradient for user messages with subtle glow */
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

/* Added message text styling */
.msg-text {
  line-height: 1.5;
}

/* Simplified message metadata - only timestamp now */
.msg-meta {
  display: flex;
  align-items: center;
  font-size: 0.6875rem;
  color: #888888;
  margin-top: 0.125rem;
}

.msg-time {
  font-weight: 500;
}

/* Removed .msg-read styles */

.send-message {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.send-message input {
  flex: 1;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e5e5;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.send-message input:focus {
  outline: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 0 15px rgba(255, 255, 255, 0.15);
}

.send-message input::placeholder {
  color: #666666;
}

.send-message button {
  padding: 0.875rem 1.75rem;
}

/* Version text */
.version-text {
  margin-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
  color: #666666;
  font-size: 0.8125rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .chat-container {
    flex-direction: column;
    padding: 1rem;
  }

  .sidebar {
    width: 100%;
    height: 300px;
  }

  .chat-section {
    height: 500px;
  }
}
