/* chat typing section */

.chat-typing-sec-container {
  width: 100%;
  position: absolute;
  bottom: 0;
  height: fit-content;
  display: flex;
  background-color: var(--secondBackground);
}

.chat-typing-sec {
  width: 100%;
  background-color: var(--tertiary);
  border-radius: 26px;
  padding: 8px 12px 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0px 14px 14px 14px;
  overflow: hidden;
  /* temporary  */
}

.chat-typing-sec textarea {
  width: 100%;
  border: none;
  outline: none;
  max-height: 200px;
  resize: none;
  background-color: var(--tertiary);
  color: var(--onTertiary);
  font-size: 14px;
  padding: 8px 16px;
  /* transition: height 0.5s ease; */
  line-height: 20px;
  box-sizing: border-box;
}

.chat-typing-sec textarea::placeholder {
  color: var(--placeholder);
}

.chat-typing-sec textarea::-webkit-scrollbar {
  width: 8px;
}

.chat-typing-sec textarea::-webkit-scrollbar-thumb {
  background-color: var(--tertiary);
  /* White thumb */
  border-radius: 6px;
}

.chat-typing-sec textarea::-webkit-scrollbar-track {
  background-color: var(--tertiary);
  /* White track */
}

.chat-typing-sec textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--tertiary) var(--tertiary);
  /* thumb color, track color */
}

.chat-typing-sec-container .sent {
  margin: auto 0px 2px 0px;
  background-color: var(--primary);
  display: flex;
  border-radius: 20px;
  padding: 8px 16px;
  border: 0;
  transition: all 0.2s ease;
}

.chat-typing-sec-container .sent span {
  color: var(--onPrimary);
  text-transform: uppercase;
  margin-right: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.chat-typing-sec-container .sent svg {
  width: 16px;
  height: 16px;
  fill: var(--onPrimary);
  margin: auto;
}

.chat-typing-sec-container .sent:disabled {
  background-color: var(--primaryDisabled);
}

.chat-typing-sec-container .sent:disabled span,
.chat-typing-sec-container .sent:disabled svg {
  color: var(--onPrimaryDisabled);
  fill: var(--onPrimaryDisabled);
}

.chat-typing-sec-container .icon {
  margin: auto 0px 0px 0px;
  background-color: transparent;
  border: none;
  width: 28px;
  height: 40px;
  display: flex;
  border-radius: 6px;
  border: 0;
}

.chat-typing-sec-container .icon svg {
  width: 24px;
  height: 24px;
  margin: auto;
  fill: var(--placeholder);
}
.chat-typing-sec-container .icon svg:hover {
  fill: var(--placeholderHover);
}

/* reply on textarea */

.reply-preview {
  width: 100%;
  border-bottom: 1px solid var(--border);
  padding: 8px 4px 8px 12px;
  margin-bottom: 8px;
  background-color: color-mix(in srgb, var(--tertiary), #000 8%);
  border-radius: 8px 8px 0 0;
  position: relative;
}

.reply-preview-content {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  position: relative;
}

.reply-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.reply-to-text {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.reply-preview-message {
  font-size: 14px;
  color: var(--onTertiary);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.reply-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.reply-close-btn svg {
  width: 12px;
  height: 12px;
  fill: var(--placeholder);
}

.reply-close-btn svg {
  fill: var(--primary);
}

.reply-preview {
  animation: slide-down 0.3s ease forwards;
}

.reply-preview-media {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

.reply-media-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background-color: rgba(var(--primary-rgb), 0.1); */
  border-radius: 6px;
  flex-shrink: 0;
}

.reply-media-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  fill: none;
}

.reply-media-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.reply-media-type {
  font-size: 14px;
  color: var(--onTertiary);
  font-weight: 500;
  margin-bottom: 2px;
  opacity: 0.9;
}

.reply-media-filename {
  font-size: 12px;
  color: var(--placeholder);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
  opacity: 0.8;
}

.reply-preview-message {
  font-size: 14px;
  color: var(--onTertiary);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  line-height: 1.3;
  padding: 2px 0;
}

/* Hover effects for better interactivity */
.reply-preview:hover {
  background-color: color-mix(in srgb, var(--tertiary), #000 12%);
}

.reply-preview:hover .reply-media-icon {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}
.reply-preview-media {
  animation: fade-in 0.2s ease forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mic-button {
  background-color: var(--primary);
  border: none;
  border-radius: 50%;
  padding: 8px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto 0px 0px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
}

.mic-button svg {
  width: 20px;
  height: 20px;
  stroke: var(--onPrimary);
}

.mic-button:hover {
  background-color: var(--primaryHover);
}

.recording-container {
  display: flex;
  align-items: center;
  background-color: rgba(255, 0, 0, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 10px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }

  70% {
    box-shadow: 0 0 0 5px rgba(255, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

.recording-time {
  color: var(--onTertiary);
  font-size: 14px;
  margin-right: 10px;
}

.recording-stop-btn {
  background-color: #e15454;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.recording-stop-btn svg {
  width: 14px;
  height: 14px;
  stroke: white;
  fill: white;
}

/* attachment file */

/* File attachments preview styles */
.file-attachments-preview {
  width: 100%;
  padding: 12px 8px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  background-color: color-mix(in srgb, var(--tertiary), #000 4%);
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 90px;
  overflow-y: auto;
  animation: slide-down 0.2s ease forwards;
}

.attachment-item {
  position: relative;
  background-color: var(--tertiary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Image attachment styles */
.attachment-image {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
}

.attachment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-image .attachment-remove {
  position: absolute;
  top: 0px;
  right: 0px;
  background-color: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.attachment-image:hover .attachment-remove {
  opacity: 1;
  background-color: rgba(255, 0, 0, 0.1);
}
.attachment-image .attachment-remove:hover {
  background-color: rgba(255, 0, 0, 0.2);
}

.attachment-image .attachment-remove svg {
  width: 10px;
  height: 10px;
  fill: var(--placeholder);
}
.attachment-image:hover .attachment-remove svg {
  fill: #e74c3c;
}

/* File attachment styles */
.attachment-file {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  min-width: 200px;
  max-width: 280px;
  gap: 10px;
  position: relative;
}

.attachment-file-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  border-radius: 6px;
  flex-shrink: 0;
}

.attachment-file-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--onPrimary);
  fill: none;
}

.attachment-file-info {
  flex: 1;
  min-width: 0;
}

.attachment-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--onTertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 200px;
  margin-right: 10px;
}

.attachment-file-size {
  font-size: 11px;
  color: var(--placeholder);
  margin-top: 2px;
  line-height: 1.2;
}

.attachment-file .attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

.attachment-file:hover .attachment-remove {
  opacity: 1;
  background-color: rgba(255, 0, 0, 0.1);
}

.attachment-file .attachment-remove:hover {
  background-color: rgba(255, 0, 0, 0.2);
}

.attachment-file .attachment-remove svg {
  width: 10px;
  height: 10px;
  stroke: var(--placeholder);
}

.attachment-file:hover .attachment-remove svg {
  fill: #e74c3c;
}

/* Scrollbar for attachments preview */
.file-attachments-preview::-webkit-scrollbar {
  width: 4px;
}

.file-attachments-preview::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.file-attachments-preview::-webkit-scrollbar-track {
  background-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .attachment-file {
    min-width: 180px;
    max-width: 240px;
    padding: 6px 10px;
  }

  .attachment-image {
    width: 70px;
    height: 70px;
  }

  .file-attachments-preview {
    max-height: 150px;
  }
}

/* Enhanced hover effects */
.attachment-item {
  transition: all 0.2s ease;
}

.attachment-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Multiple files grid layout */
.file-attachments-preview {
  display: flex;
  gap: 8px;
  align-items: start;
}

.attachment-file {
  grid-column: span 2;
}

@media (max-width: 480px) {
  .attachment-file {
    grid-column: span 3;
  }
}
