body {
  background-color: #f0f2f5;
  height: 100vh;
  overflow: hidden;
}

.chat-container {
  height: 100vh;
  display: flex;
}

/* Sidebar */
.contacts-sidebar {
  width: 350px;
  background-color: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  background-color: #ffe900;
  color: w#000;
}

.sidebar-header h4 {
  margin: 0;
  font-size: 1.2rem;
}

.sidebar-header small {
  display: block;
  margin-top: 5px;
  opacity: 0.9;
}

.owner-info {
  font-size: 0.85rem;
  margin-top: 5px;
  opacity: 0.95;
  font-weight: normal;
}

.search-container {
  padding: 10px 20px;
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
}

.search-input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #075e54;
}

.search-input::placeholder {
  color: #999;
}

.back-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
  font-size: 1.3rem;
}

.back-button:hover {
  opacity: 0.8;
}

.header-content {
  display: flex;
  align-items: center;
}

.contacts-list {
  flex: 1;
  overflow-y: auto;
}

.contact-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-item:hover {
  background-color: #f5f5f5;
}

.contact-item.active {
  background-color: #e8f5e9;
}

.contact-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 600;
  color: #000;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-phone {
  font-size: 0.85rem;
  color: #667781;
}

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #e5ddd5;
}

.chat-header {
  padding: 15px 20px;
  background-color: #ffe900;
  color: #000;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  margin-right: 10px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  color: #075e54;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.chat-header-info h5 {
  margin: 0;
  font-size: 1rem;
}

.chat-header-info p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23e5ddd5" width="100" height="100"/><circle fill="%23d9d9d9" cx="50" cy="50" r="1" opacity="0.1"/></svg>');
}

.message {
  display: flex;
  margin-bottom: 12px;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.outgoing {
  justify-content: flex-end;
}

.message.incoming {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  word-wrap: break-word;
}

.message.outgoing .message-bubble {
  background-color: #e8f576;
  border-bottom-right-radius: 2px;
}

.message.incoming .message-bubble {
  background-color: white;
  border-bottom-left-radius: 2px;
}

.message-text {
  margin-bottom: 4px;
  color: #000;
  line-height: 1.4;
}

.message-time {
  font-size: 0.7rem;
  color: #667781;
  text-align: right;
  margin-top: 4px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #667781;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #667781;
}

.load-more-btn {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  margin: 10px 20px;
  border-radius: 8px;
}

.badge-count {
  background-color: #d4e20e;
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    color: #000;
  }

  .contacts-sidebar {
    width: 100%;
    position: absolute;
    z-index: 10;
    height: 100vh;
    transform: translateX(0);
    transition: transform 0.3s;
  }

  .contacts-sidebar.hide {
    transform: translateX(-100%);
  }

  .chat-area {
    width: 100%;
  }
}
