* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Bricolage Grotesque", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  line-height: 1.6;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.logo {
  font-weight: 600 !important;
  line-height: 1.2;
}

.container {
  display: flex;
  flex: 1;
  gap: 1px;
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar {
  width: 25%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
}

.search-bar {
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  margin-top: 0.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
}

.search-bar input:focus {
  outline: none;
  border-color: #ffe162;
  box-shadow: 0 0 0 3px rgba(255, 225, 98, 0.1);
  transform: translateY(-1px);
}

.search-bar input::placeholder {
  color: #adb5bd;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ffe162 transparent;
}

.chat-list::-webkit-scrollbar {
  width: 4px;
}

.chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
  background: #ffe162;
  border-radius: 2px;
}

.chat-item {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  background-color: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.chat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffe162, #ffcc02);
  transition: width 0.3s ease;
}

.chat-item:hover {
  background-color: rgba(255, 225, 98, 0.05);
  transform: translateX(4px);
}

.chat-item:hover::before {
  width: 3px;
}

.chat-item.active {
  background: linear-gradient(135deg, #fff9e6 0%, #fff4c4 100%);
  border-left: 3px solid #ffe162;
  box-shadow: inset 0 0 20px rgba(255, 225, 98, 0.1);
}

.avatar {
  width: 45px;
  height: 45px;
  background: #cfcfcf;
  border-radius: 50%;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.chat-item:hover .avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-details {
  flex-grow: 1;
  min-width: 0;
}

.chat-details strong {
  color: #303030 !important;
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.chat-details p {
  font-size: 0.9rem;
  color: #666 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-date {
  font-size: 0.8rem;
  color: #999 !important;
  font-weight: 500;
}

.chat-window {
  flex: 1;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  flex-direction: column;
  position: relative;
}

.messages {
  padding: 2rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #ffe162 transparent;
}

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

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: #ffe162;
  border-radius: 3px;
}

.message {
  max-width: 65%;
  padding: 1.25rem;
  border-radius: 18px;
  font-size: 0.95rem;
  position: relative;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  animation: messageSlide 0.3s ease-out;
  line-height: 1.5;
}

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

.message.incoming {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.outgoing {
  background: linear-gradient(135deg, #ffe162 0%, #ffd700 100%);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  color: #333;
  font-weight: 500;
}

.message time {
  display: block;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.5);
  margin-top: 0.75rem;
  font-weight: 400;
}

.input-area {
  display: flex;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  align-items: center;
  position: relative;
  gap: 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.input-area input {
  flex: 1;
  padding: 1rem 1.25rem;
  border-radius: 25px;
  border: 2px solid #e9ecef;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
}

.input-area input:focus {
  outline: none;
  border-color: #ffe162;
  box-shadow: 0 0 0 3px rgba(255, 225, 98, 0.1);
  transform: translateY(-1px);
}

.input-area input::placeholder {
  color: #adb5bd;
}

.send-btn {
  background: linear-gradient(135deg, #ffe162 0%, #ffcc02 100%);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 225, 98, 0.4);
}

.send-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 225, 98, 0.6);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn img {
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.1rem;
}

.profile-icon {
  position: relative;
  display: inline-block;
}

.profile-icon img {
  cursor: pointer;
  border-radius: 50%;
  height: 1.8rem;
  object-fit: cover;
}

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  margin-top: 5px;
}

.profile-dropdown.show {
  display: block;
}

.profile-dropdown a {
  color: #303030;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.profile-dropdown a:hover {
  background-color: #f1f1f1;
  color: #ef8508;
}

.profile-dropdown a:first-child {
  border-radius: 8px 8px 0 0;
}

.profile-dropdown a:last-child {
  border-radius: 0 0 8px 8px;
}

@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  nav {
    gap: 1rem;
  }

  nav a {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
  }

  .sidebar {
    width: 35%;
  }

  .message {
    max-width: 85%;
  }

  .input-area {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    flex-direction: column;
  }

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

  .chat-window {
    flex: 1;
  }
}
