:root {
  --vw-base: 19.2; /* 1vw = 19.2px trên màn hình 1920px */
}

/* calc (calc(150 / var(--vw-base) * 1vw)); */
.hidden {
  display: none !important;
}

.contact-circle-2 {
  width: 62.5vw;
  height: 62.5vw;
  top: 70%;
  left: -30%;
}

.yellow-circle {
  position: absolute;
  background: radial-gradient(circle, #fade83 0%, transparent 100%);
  border-radius: 50%;
  filter: blur(7.8125vw);
  z-index: 0;
  opacity: 0.6;
}

.contacts-page {
  display: flex;
  justify-content: flex-start; /* Đẩy các phần tử về phía trái */
  align-items: flex-start; /* Đẩy các phần tử lên phía trên */
  gap: 2.6042vw;
  margin-top: 2.6042vw;
  padding: 50px 0 ;
}

.sidebar {
  position: relative;
  align-self: flex-start;
  left: 0;
  max-width: 13.0208vw;
  width: 100%;
  /* height: calc(100vh - 10.4167vw); */
  transform: translateX(-100%);
  background: linear-gradient(to right, #d0b872, #8b6329);
  border: 0.0521vw solid #000;
  border-top-right-radius: 1.0417vw;
  border-bottom-right-radius: 1.0417vw;
  transition: transform 0.3s ease;
}

.sidebar.open {
  transform: translateX(0); /* Hiển thị sidebar khi mở */
}

.toggle-btn {
  position: absolute;
  right: -25px; /* Đặt nút toggle ở bên phải của sidebar */
  width: 100%;
  max-width: 3.125vw;
  height: 9.77vw;
  border: 1px solid transparent;
  background: linear-gradient(#524226, #524226) padding-box,
    linear-gradient(to bottom, var(--color-yellow), #8b632900, var(--color-yellow)) border-box;
  border-left: none;
  color: white;
  font-size: 1.0417vw;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0.5208vw 0.5208vw 0;
}

.toggle-btn::before {
  content: "►"; /* Mũi tên phải (khi sidebar đóng) */
  margin-left: 1.302vw;
}

.sidebar.open .toggle-btn::before {
  content: "◄"; /* Mũi tên trái (khi sidebar mở) */
}

.user-profile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.0417vw;
  width: 100%;
  height: 100%;
  max-height: 11.4583vw;
  background-color: #201e27; /* Dark background for user section */
  color: white;
  border: 0.0521vw solid transparent;
  background: linear-gradient(#201e27, #201e27) padding-box,
    linear-gradient(to bottom, var(--color-yellow), #8b632900, var(--color-yellow)) border-box;
  border-left: none;
  border-bottom: none;
  border-bottom-right-radius: 1.0417vw; /* Match the sidebar's border-radius */
  border-top-right-radius: 1.0417vw;
}

.user-icon {
  max-width: 7.2917vw;
  max-height: 7.2917vw;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  margin-bottom: 0.5208vw;
}

.user-name {
  font-size: 0.8333vw;
}

.sidebar-menu {
  list-style: none;
  padding: 1.0417vw 0;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  margin-top: 0.625vw;
  position: relative;
}

.sidebar-menu > button {
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.8333vw;
  text-align: left;
  padding-top: 1.8229vw;
  padding-bottom: 1.8229vw;
}

.sidebar-link {
  width: 80%;
  display: block;
  padding: 0.5208vw 1.0417vw;
  color: #fff;
  font-size: 0.8333vw;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  z-index: 1;
  position: relative;
}

.sidebar-indicator {
  position: absolute;
  left: 0;
  width: 100%;
  height: calc(85 / var(--vw-base) * 1vw);
  background: url("../images/Group172.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  border-top-left-radius: 1.0417vw;
  border-bottom-left-radius: 1.0417vw;
  transition: all 0.3s ease-in;
  /* margin-right: -0.2604vw; */
  transform: scale(1.05);
  border-radius: 0 20px 20px 0;
  transition: top 0.3s ease;
  z-index: 0;
}

/* chat message */
.chat-container {
  display: flex;
  flex: 1 1 100%;
  height: 80vh;
  margin-right: 1.5625vw;
  width: 100%;
  border-radius: 0.5208vw;
  position: relative;
  padding: 1.5625vw;
  border: 0.0521vw solid transparent;
  background: linear-gradient(var(--color-dark), var(--color-dark)) padding-box,
    linear-gradient(135deg, var(--color-yellow), #8b6329, var(--color-yellow)) border-box;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chỉnh contacts list */
.contacts-list {
  width: 100%;
  padding: 1.0417vw;
  max-width: 20.8333vw;
  transition: width 0.3s ease;
  display: flex;
  border-radius: 0.5208vw;
  flex-direction: column;
}

.sidebar.open ~ .chat-container {
  margin-left: 2.6042vw;
}

.contacts-list > .list > .contact > span {
  font-size: 0.75em;
  transition: all 0.3s ease-in;
}

.contacts-list > .list > .contact > .message__contact {
  display: block;
  opacity: 1;
  max-height: 6.7708vw;
  overflow: hidden;
  transition: opacity 0.3s ease-in, max-height 0.3s ease-in;
}

.sidebar.open ~ .chat-container > .contacts-list > .list > .contact > .message__contact {
  opacity: 0;
  max-height: 0;
  transition: opacity 0.3s ease-in, max-height 0.3s ease-in;
}

.contacts-list > .list > .contact > div > .time {
  display: block;
  opacity: 1;
  max-height: 6.7708vw;
  overflow: hidden;
  transition: opacity 0.3s ease-in, max-height 0.3s ease-in;
}

.sidebar.open ~ .chat-container > .contacts-list > .list > .contact > div > .time {
  opacity: 0;
  max-height: 0;
  transition: opacity 0.3s ease-in, max-height 0.1s ease-in-out;
}

.contacts-list > h1 {
  font-size: 1.25em;
  margin-bottom: 1.0417vw;
}

/* Chỉnh danh sách contacts */
.contacts-list > .list > .contact {
  padding-right: 15px;
  border-radius: 1.0417vw;
  margin-bottom: 1.5208vw;
  display: flex;
  align-items: flex-start;
  width: 90%;
  position: relative;
  padding: 0.5208vw 0.7812vw;
  color: #fff;
  height: 100%;
  border: 0.1042vw solid transparent;
  background: linear-gradient(var(--color-dark), var(--color-dark)) padding-box,
    linear-gradient(45deg, #94834d50, #fade83, #8b632950) border-box;
  padding: 1.0417vw;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  transition: all 0.3s ease-in;
}

.contacts-list > .list > .contact > div {
  transition: all 0.3s ease-in;
}

/* scroller Bar */
.contacts-list > .list {
  overflow-x: hidden;
  overflow-y: auto;
  flex-grow: 1;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

/* Trạng thái active */
.contacts-list > .list > .contact.active {
  background: linear-gradient(#2a2932, #2a2932) padding-box,
    linear-gradient(45deg, #94834d50, #fade83, #8b632950) border-box;
}

/* Trạng thái unread */
.contacts-list > .list > .unread {
  background: linear-gradient(#302a1c, #302a1c) padding-box,
    linear-gradient(45deg, #94834d50, #fade83, #8b632950) border-box;
}

/* Biểu tượng */
.contacts-list > .list > .contact > .contact-icon {
  width: 1.5625vw;
  height: 1.5625vw;
  border-radius: 50%;
  background: #ccc;
}

.contacts-list > .list > .contact > div {
  display: flex;
  justify-content: space-around;
  gap: 1.0417vw;
  align-items: center;
}

.contacts-list > .list > .contact > div > .time {
  font-size: 0.75em;
  color: #e3e3e3;
  margin-left: auto;
}

.contacts-list > .list > .contact > div > .contact-icon {
  width: 1.5625vw;
  height: 1.5625vw;
  border-radius: 50%;
  background: #ccc;
}
.contact .contact-name {
  font-size: 1.25vw;
}
/* Dấu chấm thông báo unread */
.unread-dot {
  width: 0.5208vw;
  height: 0.5208vw;
  border-radius: 50%;
  background: #ffcc00;
  position: absolute;
  right: 0.5208vw;
  top: 15%;
  transform: translateY(-50%);
}

.contacts-list > .list::-webkit-scrollbar {
  width: 0.3125vw;
  margin: 5px;
}

.contacts-list > .list::-webkit-scrollbar-track {
  background: #ffffff0d;
}

.contacts-list > .list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 0.5208vw;
  min-height: 1.0417vw;
}

.contacts-list > .list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Chat Window */
.chat-window {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border-radius: 1.0417vw;
  border: 0.0521vw solid transparent;
  background: linear-gradient(var(--color-dark), var(--color-dark)) padding-box,
    linear-gradient(135deg, var(--color-yellow), #8b632900, var(--color-yellow)) border-box;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 0.7812vw 1.0417vw;
  background: var(--color-button);
  border-radius: 1.0417vw;
  border-bottom: 0.0521vw solid #8b6329;
}

.chat-header .contact-icon {
  width: 1.5625vw;
  height: 1.5625vw;
  background: #d9d9d9;
  border-radius: 50%;
  margin-right: 0.5208vw;
}

.chat-header .contact-name {
  flex-grow: 1;
  font-size: 0.8333vw;
  color: #fff;
}

.chat-header .search-input {
  width: 1.8229vw;
  height: 1.8229vw;
  padding: 0;
  background: url("../images/search-icon.png") no-repeat center center;
  background-size: 0.9375vw;
  border-radius: 0.3125vw;
  cursor: pointer;
  outline: none;
  border: none;
  transition: all 0.2s ease;
  background-color: transparent;
}

.chat-messages {
  flex-grow: 1;
  padding: 1.0417vw;
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

/* scroll Bar */
.date-divider {
  text-align: center;
  color: var(--color-gray);
  font-size: 0.625vw;
  margin: 1.0417vw 0;
  position: relative;
}

.date-divider::before {
  left: 0;
}

.date-divider::after {
  right: 0;
}

.message {
  max-width: 70%;
  margin-bottom: 1.0417vw;
  padding: 0.5208vw 0.7812vw;
  position: relative;
  border-radius: 1.5625vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.message.received p {
  padding: 1.5208vw 1.5208vw;
  color: #fff;
  font-size: 0.7292vw;
  background: linear-gradient(var(--color-dark), var(--color-dark)) padding-box,
    linear-gradient(135deg, var(--color-yellow), #94834d00, var(--color-yellow)) border-box;
  border-radius: 1.0417vw;
  border: 0.0521vw solid transparent;
  box-shadow: 0.0vw 0.0vw 0.5208vw 0.0vw #fade8366;
}

.message.sent {
  align-items: flex-end;
  margin-left: auto;
}

.message.sent p {
  background: linear-gradient(#302a1c, #302a1c) padding-box,
    linear-gradient(135deg, var(--color-yellow), #94834d00, var(--color-yellow)) border-box;
  border-radius: 1.0417vw;
  border: 0.0521vw solid transparent;
  padding: 1.5208vw 1.5208vw;
  box-shadow: 0.0vw 0.0vw 0.5208vw 0.0vw #fade8366;
}

.message p {
  color: #ffffff;
  opacity: 1 !important;
  font-size: 0.7292vw;
}

.timestamp {
  display: block;
  font-size: 0.625vw;
  color: #aeaeae;
  margin-top: 0.2604vw;
  text-align: right;
}

.chat-input {
  display: flex;
  align-items: center;
  padding: 0.7812vw 1.0417vw;
  border: 0.0521vw solid #8b6329;
  border-radius: 1.0417vw;
}

.chat-input input {
  flex-grow: 1;
  padding: 0.5208vw;
  font-size: 0.7292vw;
  outline: none;
  background-color: transparent;
  border: none;
  color: #fff;
}

.chat-input input::placeholder {
  color: #888;
}

.file-upload {
  position: relative;
}

#file-input {
  display: none;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 0.4167vw;
  background-color: transparent;
  color: #ffd700;
  border-radius: 0.2604vw;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.paperclip-icon {
  width: 100%;
  height: 100%;
}

.chat-input .send-button {
  border: none;
  border-radius: 1.0417vw;
  background: var(--color-button);
  padding: 0.5208vw 0.7812vw;
  height: 100%;
  font-size: 1.0417vw;
  margin-left: 0.5208vw;
  cursor: pointer;
  color: #fff;
}



/* Form Container */
.form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
}

.password-form {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border-radius: 15px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
}

.form-group label {
  color: #ffffff;
  font-size: 16px;
  width: 150px;
  flex-shrink: 0;
}

.form-group input {
  flex-grow: 1;
  padding: 20px;
  border-radius: 25px;
  color: #ffffff;
  font-size: 1em;
  outline: none;
  background: var(--color-dark);
  border: 1px solid transparent;
  background: linear-gradient(var(--color-darker), var(--color-darker)) padding-box,
    linear-gradient(185deg, #94834d50, #fade83, #8b632950) border-box;
}

.btn-primary.confirm-button {
  align-self: flex-end;
  font-size: 1.25em;
  height: 50px;
  padding-top: 2px;
  padding-bottom: 2px;
  cursor: pointer;
  border: none;
}

/* Navbar */
.nav-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 1.0417vw;
}

.nav-bar {
  display: flex;
  border: 1px solid transparent;
  background: linear-gradient(#302a1c, #302a1c) padding-box,
    linear-gradient(135deg, var(--color-yellow), #8b632900, var(--color-yellow)) border-box;
  border-radius: 10px;
  position: relative;
  box-shadow: 0.0vw 0.0vw 0.5208vw 0.0vw #fade8366;
}

.nav-button {
  background: var(--color-dark);
  color: #d4af37;
  padding: 0.5208vw 1.0417vw;
  font-size: 0.8333vw;
  cursor: pointer;
  transition: background-color 0.5s, color 0.3s;
  border: none;
}

.nav-button:nth-child(1) {
  border-bottom-left-radius: 10px;
  border-top-left-radius: 10px;
}

.nav-button:nth-last-child(1) {
  border-bottom-right-radius: 10px;
  border-top-right-radius: 10px;
}

.nav-button.active {
  background: linear-gradient(to right, #d0b872, #8b6329);
  color: #2a2a2a;
  border-radius: 0.5208vw;
}

/* Payment */
.payment-container {
  gap: 1.0417vw;
  padding: 1.0417vw;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card {
  border: 0.0521vw solid transparent;
  background: linear-gradient(var(--color-dark), var(--color-dark)) padding-box,
    linear-gradient(135deg, var(--color-yellow), #8b632900, var(--color-yellow)) border-box;
  border-radius: 0.7812vw;
  overflow: hidden;
  box-shadow: 0 0.2083vw 0.4167vw rgba(0, 0, 0, 0.3);
  height: 100%;
  width: 100%;
  max-width: 16.6667vw;
}

.info-card {
  flex: 2;
  width: 100%;
  max-width: 28.6458vw;
  height: 23.8333vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.0417vw;
}

.info-section,
.payment-section {
  padding: 1.0417vw;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.info-section p {
  margin-bottom: 1.0417vw;
  font-size: 0.8333vw;

  font-weight: var(--fw-regular);
}

.info-section strong {
  color: #ffffff;
}

.payment-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.payment-section h3 {
  margin-bottom: 0.7812vw;
  font-size: 1em;
  color: #ffffff;
  font-weight: 800;
}

.payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5208vw;
  margin: 1.5625vw;
}

.payment-logo {
  width: 5.2083vw;
  height: 2.8646vw;
  background-color: #ffffff;
  padding: 0.2604vw;
  border-radius: 0.2604vw;
}
/* Base styles remain the same for desktop, but we override for mobile */
@media (max-width: 768px) {
  /* Main container */
  .contacts-page {
    flex-direction: column;
    margin-top: 0;
    gap: 20px;
  }

  /* Sidebar */
  .sidebar {
    position: fixed;
    top: 106px;
    left: 0;
    max-width: 250px;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1000;
    transition: transform 0.3s ease;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .user-profile {
    max-height: 150px;
    padding: 15px;
  }

  .user-icon {
    width: 50px;
    height: 50px;
  }

  .user-name {
    font-size: 14px;
  }

  .sidebar-menu > button {
    padding-top: 20px;
    padding-bottom: 20px;
    font-size: 14px;
  }

  .sidebar-link {
    font-size: 14px;
    padding: 8px 15px;
  }

  /* Chat Container */
  .chat-container {
    margin-right: 0;
    padding: 15px;
    height: calc(100vh - 60px);
    border: none;
  }

  /* Contacts List */
  .contacts-list {
    max-width: 100%;
    padding: 10px;
    display: none;
  }

  .contacts-list.active {
    display: flex;
  }

  .contacts-list > h1 {
    font-size: 1em;
    margin-bottom: 10px;
  }

  .contacts-list > .list > .contact {
    max-width: 100%;
    max-height: 60px;
    margin: 10px 0;
    padding: 8px 10px;
  }

  .contacts-list > .list > .contact > .contact-icon {
    width: 25px;
    height: 25px;
  }

  .unread-dot {
    width: 8px;
    height: 8px;
  }

  .chat-header {
    padding: 10px 15px;
  }

  .chat-header .contact-icon {
    width: 25px;
    height: 25px;
  }

  .chat-header .contact-name {
    font-size: 14px;
  }

  .chat-header .search-input {
    width: 25px;
    height: 25px;
    background-size: 16px;
  }

  .chat-messages {
    padding: 15px;
  }

  .message {
    max-width: 85%;
    padding: 8px 12px;
  }

  .message p {
    font-size: 13px;
  }

  .message.received p {
    font-size: 13px;
  }

  .timestamp {
    font-size: 10px;
  }

  .chat-input {
    padding: 10px 15px;
  }

  .chat-input input {
    font-size: 13px;
    padding: 8px;
  }

  .chat-input .send-button {
    padding: 8px 12px;
    font-size: 16px;
  }

  .file-label {
    padding: 8px;
  }

  /* Payment */
  section {
    padding: 50px 0 !important;
  }

  .payment-container {
    padding: 10px;
 
  }
 

  .info-section p {
    font-size: 14px;
    margin-bottom: 15px;
    margin: 30px;
  }

  .payment-section h3 {
    font-size: 16px;
  }

  .payment-options > img {
    width: 70px;
    height: 50px;
  }

  .payment-logo {
    width: 70px;
    height: 40px;
  }

  .form-container {
    padding: 15px;
  }

  .password-form {
    padding: 20px;
    max-width: 100%;
  }

  .form-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .form-group label {
    width: 100%;
    font-size: 14px;
  }

  .form-group input {
    width: 100%;
    font-size: 14px;

  }

  .confirm-button {
    width: 100%;
    padding: 10px;
  }

  .nav-button {
    font-size: 13px;
    padding: 12px 12px;
  }
  

  /* Sidebar */
  .sidebar {
    max-width: 200px;
  }

  .toggle-btn {
    right: -25px;
    max-width: 30px;
    height: 60px;
    border-radius: 9px;
    font-size: 3.0417vw;
  }

  .toggle-btn::before {
    margin-left: 0px;
  }

  .user-profile {
    max-height: 120px;
    padding: 10px;
  }

  .user-icon {
    width: 40px;
    height: 40px;
  }

  .user-name {
    font-size: 12px;
  }

  .sidebar-menu > button {
    padding-top: 15px;
    padding-bottom: 15px;
    font-size: 12px;
  }

  .sidebar-link {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* Chat Container */
  .chat-container {
    padding: 10px;
    height: calc(100vh - 50px);
  }

  /* Contacts List */
  .contacts-list {
    padding: 5px;
  }

  .contacts-list > h1 {
    font-size: 0.9em;
    margin-bottom: 5px;
  }

  .contacts-list > .list > .contact {
    max-height: 50px;
    margin: 5px 0;
    padding: 6px 8px;
  }

  .contacts-list > .list > .contact > .contact-icon {
    width: 20px;
    height: 20px;
  }

  .unread-dot {
    width: 6px;
    height: 6px;
    right: 5px;
  }

  /* Chat Window */
  .chat-window {
    border-radius: 20px;
  }

  .chat-header {
    padding: 8px 10px;
  }

  .chat-header .contact-icon {
    width: 20px;
    height: 20px;
  }

  .chat-header .contact-name {
    font-size: 12px;
  }

  .chat-header .search-input {
    width: 20px;
    height: 20px;
    background-size: 14px;
  }

  .chat-messages {
    padding: 10px;
  }

  .message {
    max-width: 90%;
    padding: 6px 10px;
    border-radius: 20px;
  }

  .message p {
    font-size: 12px;
  }

  .timestamp {
    font-size: 9px;
  }

  .chat-input {
    padding: 8px 10px;
  }

  .chat-input input {
    font-size: 12px;
    padding: 6px;
  }

  .chat-input input::placeholder {
    font-size: 12px;
  }

  .chat-input .send-button {
    padding: 6px 10px;
    font-size: 14px;
  }

  .file-label {
    padding: 6px;
  }

  .paperclip-icon {
    width: 16px;
    height: 16px;
  }

  /* Payment */
  .payment-container {
    padding: 8px;
  }
  .info-card {
    height: 100%;
    width: 100%;
  }

  .info-section,
  .payment-section {
    padding: 10px;
  }

  .info-section p {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .payment-section h3 {
    font-size: 15px;
  }

  .payment-options {
    gap: 5px;
    margin: 15px 0;
  }

  .payment-logo {
    width: 60px;
    height: 35px;
  }

  .form-container {
    padding: 10px;
  }

  .password-form {
    padding: 15px;
  }

  .form-group {
    gap: 5px;
  }

  .form-group label {
    font-size: 13px;
  }

 
  

  .confirm-button {
    padding: 8px;
    font-size: 14px;
  }

  .nav-container {
    padding: 10px;
  }

  .nav-bar {
    height: 30px;
  }

  .nav-button {
    font-size: 11px;
    padding: 5px 8px;
  }

  .overlay.active {
    display: block;
  }
 
}

