/* Chat Page Layout */
.chat-page-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  height: 100vh;
  padding: 20px;
  background: #f9fafc;
  transition: all 0.2s ease-in-out;
}

/* Left Panel Styles */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.left-card {
  border-radius: 20px;
  overflow: visible;
  background-color: transparent;
  margin-top: 0px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Panel Heading Container */
.panel-heading-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #e2e3e3;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* Panel Heading */
.panel-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

/* Left Panel Button Styling */
.add-channel-btn {
  background: #e2e3e3;
  border: none;
  border-radius: 4px;
  padding: 8px;
  padding-left: 16px;
  cursor: pointer;
  color: #0052d4;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
  margin: 0;
}

.add-channel-btn svg {
  font-size: 1.3rem;
}

.add-channel-btn:hover {
  background: #d0d0d0;
  transform: scale(1.05);
}

/* Create Channel Dialog */
.create-channel-dialog,
.edit-channel-dialog {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  border: 1px solid #e2e3e3;
  padding: 12px;
  margin: 8px 0;
}
.create-channel-dialog input,
.edit-channel-dialog input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.dialog-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}
.dialog-actions button:first-child {
  background: #0052d4;
  color: white;
}
.dialog-actions button:last-child {
  background: #f0f0f0;
  color: #333;
}
.dialog-actions button:hover {
  opacity: 0.9;
}

/* Left Card Content */
.left-card-content {
  background: #fff;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 20px;
  border: 1px solid #e2e3e3;
  min-height: 200px;
}
.left-card-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.left-card-content li {
  padding: 10px;
  border-radius: 8px;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.left-card-content li:last-child {
  margin-bottom: 0px;
}

.left-card-content li:hover {
  background: #f0f0f0;
  transform: translateX(4px);
}
.active-chat {
  background-color: #e3f2fd !important;
  font-weight: 600;
}

/* Channel Item Layout */
.channel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Channel Actions & Menu */
.channel-actions {
  position: relative;
}
.channel-menu-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}
.channel-menu-btn:hover {
  color: #0052d4;
}
.channel-menu {
  position: absolute;
  right: 0;
  top: 25px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  min-width: 140px;
  background-color: none;
}
.channel-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  font-size: 0.9rem;
  transition: background 0.2s;
  margin: 0;
}

.channel-menu-btn svg {
  font-size: 1.3rem;
}

.channel-menu button:hover {
  background: #f5f5f5;
  border-radius: 4px;
}

/* Chat Center Styles */
.chat-center2 {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header3 {
  background: #e2e3e3;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e2e3e3;
  gap: 20px;
  border-bottom: 1px solid #e2e3e3;
  border-radius: 20px;
}
.chat-header3 h3 {
  margin: 0;
  flex: 1;
}
.header-actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}
.header-actions button {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #0052d4;
  transition: color 0.2s, transform 0.2s;
}
.header-actions button:hover {
  color: #003c9f;
  transform: scale(1.1);
}

/* Messages Container */
.chat-messages2 {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  border: 1px solid #e2e3e3;
  border-radius: 20px;
  margin: 10px 0;
}

/* Message Animations */
@keyframes messageAppear {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes messageDelete {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    margin-bottom: 12px;
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
    max-height: 0;
    margin-bottom: 0;
    padding: 0;
  }
}
.chat-message2.adding {
  animation: messageAppear 0.4s cubic-bezier(0.2, 0, 0.1, 1);
  transform-origin: bottom center;
}
.chat-message2.deleting {
  animation: messageDelete 0.3s ease-out forwards;
  overflow: hidden;
}

/* Message Styling */
.chat-message2 {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: background 0.2s;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.msg-body {
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  width: max-content;
  flex: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  transition: background 0.2s;
}
.msg-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.msg-user {
  font-weight: 600;
  color: #333;
}
.msg-time {
  font-size: 0.85rem;
  color: #777;
}
.msg-text {
  margin-bottom: 6px;
  color: #444;
  line-height: 1.4;
}
.uploaded-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 6px;
}

/* Message Actions */
.msg-actions {
  display: none;
  position: absolute;
  right: 12px;
  bottom: 8px;
  gap: 6px;
}
.msg-body:hover .msg-actions {
  display: flex;
}
.msg-actions button {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #0052d4;
  transition: color 0.2s, transform 0.2s;
}
.msg-actions button:hover {
  transform: scale(1.1);
}

/* Highlight Animation */
.highlight {
  background: #007bff10 !important;
  box-shadow: 0 0 0 2px #007bff;
  border-radius: 8px;
  animation: highlight-pulse 1.5s ease-out;
}
@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(0, 123, 255, 0);
  }
}

/* Reply Styling */
.reply-container {
  display: flex;
  align-items: flex-start;
  background: #e3f2fd;
  border-left: 3px solid #0052d4;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.reply-container:hover {
  background: #d1e9ff;
  transform: translateX(2px);
}
.reply-user {
  font-weight: 700;
  color: #0052d4;
  font-size: 0.9rem;
}
.reply-text {
  padding-left: 8px;
  font-size: 0.9rem;
  color: #37474f;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reply-container.deleted-reply {
  border-left-color: #dc3545 !important;
  background: #f8d7da;
  cursor: not-allowed;
  animation: deleted-pulse 2s ease-in-out infinite;
}
.reply-container.deleted-reply .reply-user {
  color: #dc3545 !important;
}
.reply-container.deleted-reply .reply-text {
  color: #721c24 !important;
}
.reply-container.deleted-reply:hover {
  background: #f5c6cb;
  border-left-color: #c82333 !important;
}
.reply-container.deleted-reply:hover .reply-user {
  color: #c82333 !important;
}
@keyframes deleted-pulse {
  0% {
    opacity: 0.95;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.95;
  }
}

/* Input Area */
.chat-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: #e2e3e3;
  border-radius: 20px;
  border: 1px solid #fff;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.chat-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  transition: border 0.2s;
}
.chat-input input:focus {
  border: 1px solid #0052d4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}
.chat-input button {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #0052d4;
  transition: color 0.2s;
}
.chat-input button:hover {
  color: #003c9f;
  transform: scale(1.1);
}

/* Image Preview */
.image-preview-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: flex-start;
}
.image-preview {
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
}
.remove-image-btn1 {
  position: absolute;
  top: 8px;
  right: 11px;
  background: rgba(144, 108, 108, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  transition: all 0.2s ease-in-out;
}
.remove-image-btn1:hover {
  background: rgba(0, 82, 212, 0.1) !important;
  color: #003c9f !important;
  transform: scale(1.2);
}

/* Reply Preview */
.reply-preview {
  display: flex;
  align-items: center;
  background: #f2f3f5;
  padding: 8px 12px;
  border-radius: 10px;
  gap: 8px;
}
.reply-preview span {
  font-size: 0.9rem;
  color: #555;
}
.cancel-reply1 {
  position: absolute;
  right: 3.6%;
  background: none !important;
  border: none;
  color: #0052d4 !important;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  transition: all 0.2s ease-in-out;
}
.cancel-reply1:hover {
  background: rgba(0, 82, 212, 0.1) !important;
  color: #003c9f !important;
  transform: scale(1.2);
}
.cancel-reply1 svg {
  width: 18px;
  height: 18px;
  transition: all 0.2s ease-in-out;
}

.channel-edit-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-edit-container input.task-edit-input {
  flex: 1;
  /* Optionally adjust padding, font-size, etc. as needed */
}

.channel-edit-container button {
  background: #0052d4;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.channel-edit-container button:hover {
  background: #003c9f;
  transform: scale(1.05);
}

/* Adjust channel-actions if needed */
.channel-actions {
  position: relative;
  display: inline-block;
}

/* Modal Styles for Chat Page */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.confirm-btn {
  background: #ef4444;
  color: white;
}

.confirm-btn:hover {
  background: #dc2626;
}

.cancel-btn {
  background: #e2e8f0;
  color: #1e293b;
}

.cancel-btn:hover {
  background: #cbd5e0;
}

/* Ask AI Button */
.ask-ai-button {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #0052d4;
  transition: color 0.2s, transform 0.2s;
}

.ask-ai-button:hover {
  color: #003c9f;
  transform: scale(1.1);
}

/* Rotating Fan Icon */
.rotating-fan-icon {
  animation: spin 2s linear infinite; /* 2s spin, infinite loop */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
