/* --- Hidden State --- */
.dm-modal-overlay.hidden {
  display: none;
}

/* --- Fullscreen Overlay --- */
.dm-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
   animation: slideup 0.3s ease-out;
  justify-content: flex-end;
} 

/* --- Modal Box Drawer --- */
.dm-modal-box {
  position: relative;
  background: #fff;
  width: 98%;
  max-width: 580px;
  margin: 0 auto;
  height: 80vh;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25); 
  overflow: hidden;
  padding: 0;
}
.dm-modal-overlay.show .dm-modal-box {
  transform: translateY(0);
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
/* --- Close Button --- */
.dm-close-button {
  position: absolute;
  right: 10px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.dm-close-button:hover {
  color: #000;
}

/* --- Optional Drag Handle --- */
.dm-drag-handle {
  width: 50px;
  height: 5px;
  background: #ccc;
  border-radius: 4px;
  margin: 12px auto;
}

/* --- Header --- */
.dm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f8f8;
  border-bottom: 1px solid #ddd;
}
.dm-header-back,
.dm-header-flag {
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.dm-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.dm-header-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dm-header-handle {
  font-weight: bold;
  font-size: 15px;
}
.dm-header-status {
  font-size: 11px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dm-header-follow {
  margin-left: auto;
  padding-right: 10px;
  display: flex;
  align-items: center;
}

.dm-header-follow button {
  background-color: #c00;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.dm-header-follow button:hover {
  background-color: #a00;
}

.dm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

/* --- Thread Body (Scrollable) --- */
.dm-thread-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: #fff;
}

/* --- Message Wrapper --- */
.dm-message-wrapper {
  width: 100%;
  margin-bottom: 20px;
}
.dm-message-date {
  text-align: center;
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

/* --- Message Row --- */
.dm-message-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
}
.dm-message-wrapper.received .dm-message-row {
  justify-content: flex-start;
}
.dm-message-wrapper.sent .dm-message-row {
  justify-content: flex-end;
  padding-right: 10px;
}

/* --- Avatar --- */
.dm-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
}

/* --- Message Box --- */
.dm-message-box {
  position: relative;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 70%;
  word-wrap: break-word;
}
.dm-message-box.received {
  background: #f1f0f0;
  color: #000;
}
.dm-message-box.sent {
  background: #cce5ff;
  color: #000;
  margin-left: auto;
}

/* --- Share Icon --- */
.dm-share-icon {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 6px;
  right: -20px;
  cursor: pointer;
}

/* --- Footer --- */
.dm-footer {
  flex: 0 0 auto;
  padding: 1px 6px 2px 6px;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

/* --- Input Wrapper --- */
.dm-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dm-input-wrapper textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 6px;
  min-height: 40px;
  resize: none;
}

/* --- Send Button --- */
.dm-send-button {
  padding: 6px 10px;
  border: none;
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

/* --- Slide Animation --- */
@keyframes dm-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.dm-typing-indicator {
  font-style: italic;
  font-size: 0.7em;
  color: #888;
  margin-top: 8px;
}
