/* container */
#pm-threads {
  width: 40%;
	border-right: 1px solid #ddd;
  height: 400px;
  overflow-y: auto;
}
#pm-conversation {
  width: 60%;
  height: 600px;
  display: flex;
  flex-direction: column;
}
.pm-header {
  margin-bottom: 1em;
  display: flex;
  align-items: center;
}
.pm-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-right: 0.5em;
}
/* badge and global shortcode span */
.pm-unread-badge,
.pm-unread-count {
  background: #e74c3c;
  color: #fff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.9em;
}

/* threads */
.pm-thread {
  padding: 0.5em;
  cursor: pointer;
  position: relative;
  display:flex;
  flex-direction: row;
}
.pm-thread:hover {
  background: #f5f5f5;
}
.pm-thread.active {
  background: #eef;
}
.new-thread {
  font-weight: bold;
}
.pm-thread-title {
    max-width: calc(100% - 10px);
    text-overflow: ellipsis;
    vertical-align: middle;
}
.pm-unread-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: red;
    border-radius: 50%;
    vertical-align: middle;
	border:none;
}
.pm-hide-thread-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}
.pm-thread-buttons {
	  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  width: 12px;
	position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.pm-thread:hover .pm-hide-thread-btn {
    display: block;
}
.pm-hide-thread-btn:hover {
    color: #333;
}


/* conversation messages */
.pm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1em;
  display: flex;
  flex-direction: column;
}
.pm-message {
  display: flex;
  margin-bottom: 0.6em;
}
.pm-message.me {
  justify-content: flex-end;
}
.pm-message.other {
  justify-content: flex-start;
}
.bubble {
  max-width: 60%;
  padding: 0.6em 1em;
  border-radius: 16px;
  position: relative;
}
.pm-message.me .bubble {
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}
.pm-message.other .bubble {
  background: #fff;
  border-bottom-left-radius: 4px;
  border: 1px solid #ddd;
}
/* wrap at ~42 chars */
.bubble .text {
  max-width: 42ch;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
/* meta (sender/time/report) */
.meta {
  font-size: 0.75em;
  color: #666;
  margin-top: 4px;
  display: flex;
	align-items: start;
  flex-direction: column;
}
.meta .sender {
  font-weight: bold;
  margin-right: 0.5em;
}
.meta .time {
  margin-right: 0.5em;
}
/* make report very obvious */
.pm-report-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  padding: 2px 6px;
  margin-left: 0.5em;
}
.pm-report-btn:hover {
  background: #c0392b;
}
.reported-indicator {
  color: #999;
  font-size: 0.75em;
  margin-left: 0.5em;
}

/* send form */
#pm-send-form {
  display: flex;
  padding: 0.5em;
  border-top: 1px solid #ddd;
}
#pm-send-form textarea {
  flex: 1;
  resize: none;
  padding: 0.6em;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#pm-send-form button {
  margin-left: 0.5em;
  padding: 0 1em;
  border: none;
  background: var(--primary-color);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

/* Report Modal Styles */
#pm-report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pm-report-modal-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#pm-report-modal-content h2 {
    margin-top: 0;
}

#pm-report-modal-content textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
    resize: vertical;
}

#pm-open-chat {
  margin: 0 auto;
  font-weight: 700;
  font-size: 18px;
  width: 50%;
  height: 50px;
  cursor: pointer;
}

.pm-modal-actions {
    text-align: right;
}
.pm-modal-actions button {
    margin-left: 10px;
    padding: 8px 16px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
}
.pm-modal-actions .button-primary {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

#pm-app-container {
	border: 5px solid var(--primary-color);
	padding: 20px;
	margin: 0 0 20px 0;
	display:flex;
}


@media (max-width: 1350px) {
	#pm-app-container{
		display:flex;
		flex-direction:column;
}
	#pm-threads,
	#pm-conversation {
		width:100%;	
	}
	.meta {
	align-items: end;
  	flex-direction: column;
	}
}