@charset "utf-8";

/* Container Layout */
.message-write-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px; /* Increased width for 3 columns */
  margin: 0 auto;
  font-family: "Pretendard", sans-serif;
  color: #333;
  flex-wrap: nowrap; /* Prevent wrapping if possible */
  align-items: flex-start;
}

.message-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.message-left-panel {
  flex: 1;
  min-width: 320px;
}

.message-preview-panel {
  width: 320px;
  min-width: 300px;
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.message-right-panel {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  min-width: 320px;
}

.message-right-panel .form-section {
  flex: 1;
  padding-bottom: 30px;
}

/* Common Section Styles */

.section-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  color: #111;
}

.input-helper {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
  display: block;
}

/* Message Title */
.input-title {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

/* Message Content Area */
.message-content-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.msg-type-badge {
  display: inline-block;
  background-color: #e3f2fd;
  color: #1976d2;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin: 15px 15px 0 15px;
}

.opt-chk-wrap {
  float: right;
  margin: 15px 15px 0 0;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.opt-chk-wrap input {
  margin-right: 5px;
}

.message-textarea {
  width: 100%;
  height: 250px;
  border: none;
  resize: none;
  padding: 15px;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
  outline: none;
}

.msg-toolbar {
  background-color: #f8f9fa;
  padding: 10px 15px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toolbar-btns button {
  background: #fff;
  border: 1px solid #ddd;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 5px;
  color: #555;
}

.toolbar-btns button:hover {
  background: #f0f0f0;
}

.byte-counter {
  font-size: 12px;
  color: #ff5252;
  font-weight: bold;
}

.byte-info {
  font-size: 13px;
  color: #888;
  margin-top: 8px;
  line-height: 1.4;
}

/* Image Attachment */
.attach-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 4px;
}

.btn-attach {
  background-color: #555;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 13px;
}

.btn-attach:hover {
  background-color: #333;
}

.btn-attach i {
  margin-right: 5px;
}

.attach-right-btns button {
  background: #fff;
  border: 1px solid #aaa;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 5px;
  color: #333;
}

/* Phone Mockup Styles */
.phone-mockup {
  width: 280px;
  height: 520px;
  background: #333;
  border-radius: 35px;
  padding: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  box-sizing: border-box;
  border: 4px solid #444;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #eef1f5;
  border-radius: 25px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Status Bar Mock */
.phone-status-bar {
  height: 25px;
  background: rgba(255, 255, 255, 0.5);
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

/* Chat Screen Area */
.phone-content {
  padding: 40px 15px 15px 15px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Message Bubble */
.preview-bubble {
  background: #fff;
  padding: 12px 15px;
  border-radius: 15px;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  max-width: 90%;
  word-break: break-all;
  position: relative;
  min-height: 20px;
}

.preview-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  background: #fff; /* Match bubble color */
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

/* Receiver Section */
.receiver-input-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
}

.input-receiver-name,
.input-receiver-phone {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  box-sizing: border-box;
}

.input-receiver-name {
  flex: 1;
}
.input-receiver-phone {
  flex: 2;
}

.btn-add-receiver {
  background-color: #444;
  color: #fff;
  border: none;
  padding: 0 15px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  flex: 0 0 auto;
}

.receiver-list-box {
  border: 1px solid #ddd;
  border-radius: 4px;
  height: 400px;
  overflow-y: auto;
  background: #fff;
  position: relative;
}

/* Style for the dynamically loaded list items */
#phone_temp_list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#phone_temp_list li {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#phone_temp_list li:last-child {
  border-bottom: none;
}

#phone_temp_list .name {
  font-weight: bold;
  font-size: 14px;
  width: 30%;
}

#phone_temp_list .phone {
  font-size: 14px;
  color: #555;
  width: 50%;
}

#phone_temp_list .btn-del {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #ff4d4d;
  background: transparent;
  font-size: 16px;
  border: 0;
}

.receiver-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  color: #333;
}

.total-count {
  font-weight: bold;
  color: #e53935;
}

.btn-delete-all {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  color: #ff4d4d;
  align-items: center;
}

.action-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  margin-bottom: 15px;
}

.btn-action-outline {
  flex: 1;
  padding: 10px;
  border: 1px solid #333;
  background: #fff;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-action-outline i {
  margin-right: 5px;
}

.btn-action-outline:hover {
  background: #f0f0f0;
}

/* Sender & Submit Section */
.sender-section {
  width: 320px;
  background: #f1f3f5;
  padding: 15px;
  border-radius: 4px;
  margin-top: 35px;
}

.sender-section input[type="text"] {
  width: 100%;
  height: 46px;
  margin-right: 12px;
  padding: 0 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 18px;
  box-sizing: border-box;
}

.select-sender {
  width: 100%;
  padding: 10px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  margin-top: 5px;
  cursor: pointer;
}

.send-submit-area {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-submit-send {
  width: 100%;
  background: #fa8a62; /* Orange-ish from design */
  color: #fff;
  border: none;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-submit-send:hover {
  background: #e97247;
}

/* Hidden inputs visual fix */
/* input[type="file"] {
  display: none;
} */

/* Responsiveness */
@media (max-width: 1024px) {
  .message-write-container {
    flex-wrap: wrap;
  }
  .message-preview-panel {
    order: 2;
    width: 100%;
    margin-bottom: 20px;
  }
  .message-right-panel {
    order: 3;
    width: 100%;
  }
}

/* 주소록 모달 */
/* 모달 배경 */
.common-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* 모달 컨텐츠 (가로폭 900px 확보) */
.common-modal-content {
  background: #fff;
  width: 900px;
  max-width: 95%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 헤더 */
.common-modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
}
.common-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.common-title {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}
.common-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
}

/* 컨트롤 패널 */
.common-select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.no-selected-item {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: #666;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
  padding: 10px;
  gap: 5px;
}

.common-control-panel .label {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  display: block;
}

.commom-search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

/* 바디 (좌우 배치를 위한 핵심 Flex) */
.common-flex-body {
  display: flex !important;
  flex-direction: row !important; /* 가로 배치 */
  gap: 20px;
  padding: 20px;
  height: 450px; /* 고정 높이 */
  overflow: hidden;
  background: #fff;
}

.common-flex-body .left {
  flex: 1.8;
}

/* 좌측 테이블 영역 */
.common-table-container {
  overflow-y: auto;
  height: calc(100% - 50px);
  border: 1px solid #eee;
  border-radius: 8px;
}

.common-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: center;
}
.common-table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  padding: 12px;
  border-bottom: 2px solid #eee;
  z-index: 10;
}
.common-table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

/* 우측 선택 리스트 영역 */
.common-selected-container {
  flex: 1;
  min-width: 250px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
}

.common-selected-header {
  padding: 10px;
  background: #f1f1f1;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
}

.common-selected-list {
  list-style: none;
  padding: 10px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
.common-selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 7px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  border: 1px solid #eee;
  font-size: 12px;
}

.common-remove-item {
  cursor: pointer;
  color: #ff4d4d;
  border: none;
  background: none;
  font-weight: bold;
}

/* 푸터 및 버튼 */
.common-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  text-align: right;
}
.common-btn-action {
  padding: 8px 16px;
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 5px;
  font-size: 13px;
}
.common-btn-secondary {
  padding: 8px 16px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 5px;
  font-size: 13px;
}

.common-btn-small {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background-color: #fff;
  font-weight: 600;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.common-input {
  width: 200px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* 외부파일 불러오기 */
/* 모달 배경 */
.import-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* 모달 본체 */
.import-modal {
  width: 550px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 헤더 */
.import-modal-header {
  background: #333;
  color: #fff;
  padding: 15px 20px;
  text-align: center;
}
.import-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

/* 컨텐츠 */
.import-modal-body {
  padding: 25px;
  color: #444;
  line-height: 1.6;
}
.import-notice-box {
  font-size: 14px;
  margin-bottom: 20px;
}
.import-notice-box p {
  margin: 5px 0;
}
.import-notice-box strong {
  color: #000;
  font-weight: 700;
}

.import-download-area {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}
.import-download-link {
  color: #333;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 600;
}

/* 파일 업로드 영역 */
.import-upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.import-label {
  font-weight: 700;
  margin-right: 5px;
}
.import-file-input {
  display: none;
}
.import-file-label {
  padding: 6px 12px;
  background: #f4f4f4;
  border: 1px solid #ccc;
  cursor: pointer;
  border-radius: 3px;
}
.import-file-name {
  color: #888;
}

/* 푸터 버튼 */
.import-modal-footer {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
  background: #f9f9f9;
}
.import-btn-submit {
  background: #4a90e2;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}
.import-btn-close {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 10px 25px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}
.import-btn-submit:hover {
  background: #1e6fa5;
}
.import-btn-close:hover {
  background: #eee;
}

@media (max-width: 768px) {
  .message-write-container {
    flex-direction: column;
  }
  .message-left-panel,
  .message-right-panel,
  .message-preview-panel {
    width: 100%;
  }
}

/* Modal Style for Send Confirmation */
#phone_02 {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  width: 400px;
  height: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  overflow: hidden;
  display: none;
  border: 1px solid #eee;
  font-family: "Pretendard", sans-serif;
}

#phone_02 .btn_close {
  position: absolute;
  top: 50%;
  right: 15px;
  left: auto;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
}

#phone_02 .btn_close:hover img {
  opacity: 1;
}

/* Modal Header */
#phone_02 .title_bg {
  position: relative;
  background: #007bff; /* Primary Blue */
  color: #fff;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

/* Modal Content */
#phone_02 .phone_list_wrap {
  padding: 25px;
  overflow: hidden;
}

#phone_02 .phone_list01,
#phone_02 .phone_list02 {
  list-style: none;
  padding: 0;
  margin: 0;
}

#phone_02 .phone_list01 li,
#phone_02 .phone_list02 li {
  font-size: 14px;
  color: #444;
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
}

#phone_02 .phone_list02 li {
  color: #666;
  font-size: 13px;
}

/* Modal Footer / Confirm Button */
#phone_02 ul:last-child {
  list-style: none;
  padding: 0;
  margin-top: 25px;
  text-align: center;
}

#phone_02 .btn-wrap {
  display: flex;
  justify-content: center;
  text-align: center;
  padding: 20px;
  border-top: 1px solid #ddd;
}

#phone_02 .phone_btn01 {
  display: inline-block;
  background-color: #007bff;
  color: #fff;
  margin: 0;
  width: auto;
  padding: 10px 40px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

#phone_02 .phone_btn01:hover {
  background-color: #0056b3;
}

/* 광고성 문자 안내 모달 */
.ad-alert-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.ad-alert-modal.is-open {
  display: flex;
}

.ad-alert-content {
  width: 520px;
  max-width: 90%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
}

.ad-alert-header {
  background: #333;
  color: #fff;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-alert-body {
  padding: 20px;
  color: #333;
  font-size: 14px;
  line-height: 1.7;
}

.ad-alert-body .ad-alert-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 16px;
}

.ad-alert-body ol {
  margin: 0;
  padding-left: 0;
}

.ad-alert-footer {
  padding: 12px 20px 20px;
  text-align: right;
}

.ad-alert-close {
  background: #fa8a62;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.ad-alert-close:hover {
  background: #e97247;
}
