/* CSS Variables */
:root {
  --primary-color: #1877f2;
  --primary-hover: #166fe5;
  --danger-color: #f44336;
  --danger-hover: #e53935;
  --border-color: #e4e6ea;
  --background-light: #f8f9fa;
  --background-white: #ffffff;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.2);
  --border-radius: 8px;
  --transition: all 0.2s ease;
  --editor-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--editor-font);
  background: none;
  min-height: 100vh;
}

/* Container */
.fcm_container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--background-white);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  overflow: hidden;
}

/* Header */
.fcm_header {
  background: var(--primary-color);
  color: var(--background-white);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.fcm_description {
  font-family: "Times New Roman", Times, serif !important;
}

.fcm_header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: fcm_shimmer 2s infinite;
}

@keyframes fcm_shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.fcm_header h1 {
  font-size: 40px !important;
  font-weight: bolder !important;
  margin-bottom: 10px;
  font-family: "Times New Roman", Times, serif !important;
}

/* Main Content */
.fcm_main-content {
    display: flex;
    min-height: 700px;
    width: 100%; /* Đảm bảo chiếm toàn bộ chiều rộng của container cha */
    max-width: 1400px; /* Đồng bộ với .fcm_container */
    font-family: 'Times New Roman', Times, serif !important;
}

.fcm_sidebar {
  width: 320px;
  background: var(--background-light);
  border-right: 1px solid var(--border-color);
  padding: 20px;
}

.fcm_post-content {
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #65676b;
}
.fcm_post-image-viewer {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
}
.fcm_upload-section,
.fcm_post-item {
  background: var(--background-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.fcm_menu-trigger {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #98999b;
  transition: var(--transition);
}

.fcm_menu-trigger:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.fcm_menu-trigger:focus {
  outline: none;
  background-color: rgba(216, 201, 201, 0.1);
}

.fcm_info-menu {
  position: absolute;
  top: 5px;
  right: 0;
  background: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 100;
  min-width: 80px;
}
.fcm_post-item.fcm_show-menu .fcm_info-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fcm_menu-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.fcm_menu-item:hover {
  background-color: var(--background-light);
}

.fcm_menu-item span {
  margin-left: 8px;
}

.fcm_menu-item.fcm_delete {
  color: var(--danger-color);
}

.fcm_menu-item.fcm_delete:hover {
  background-color: #ffebee;
}

.fcm_post-list {
  background: var(--background-white);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-light);
  overflow-y: auto;
  max-height: 310px;
}
.fcm_social-feed {
  max-height: 100%;
  overflow-y: auto;
  padding: 15px;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

.fcm_social-feed::-webkit-scrollbar {
  width: 8px;
}

.fcm_social-feed::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.fcm_social-feed::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.fcm_social-post {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
  cursor: pointer;
}

.fcm_social-post:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.fcm_social-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.fcm_social-author {
  display: flex;
  align-items: center;
}

.fcm_social-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

.fcm_social-author-info {
  display: flex;
  flex-direction: column;
}

.fcm_social-author-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.fcm_social-post-date {
  color: #888;
  font-size: 12px;
}

.fcm_social-post-content {
  margin-bottom: 10px;
}

.fcm_social-post-title {
  font-size: 18px;
  font-weight: bolder;
  color: #333;
  margin: 0 0 10px;
}

.fcm_social-post-body {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.fcm_social-post-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 10px;
  display: block;
}

.fcm_social-post-reactions {
  border-top: 1px solid #eee;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fcm_social-reaction-btn {
  background: none;
  border: none;
  font-size: 16px;
  padding: 5px 10px;
  cursor: not-allowed;
  /* opacity: 1; */
}

.fcm_social-reaction-placeholder {
  font-size: 16px;
}
/* Đảm bảo hình ảnh trong .fcm_social-post-body, .fcm_content-element và .fcm_html-content có tính responsive */
.fcm_social-post-body img,
.fcm_content-element img,
.fcm_html-content img {
    max-width: 100%; /* Đảm bảo chiều rộng hình ảnh không vượt quá container */
    height: auto; /* Giữ tỷ lệ khung hình */
    display: block; /* Ngăn khoảng cách dư do hình ảnh inline */
    margin: 10px auto; /* Căn giữa hình ảnh và thêm khoảng cách trên/dưới */
    border-radius: 8px; /* Tùy chọn: bo góc hình ảnh để đồng bộ với .fcm_social-post-image */
}

/* Đảm bảo container không bị tràn do hình ảnh */
.fcm_social-post-body,
.fcm_content-element,
.fcm_html-content {
    width: 100%; /* Container chiếm toàn bộ chiều rộng */
    box-sizing: border-box; /* Ngăn padding/margin gây tràn */
}

/* Tăng cường khả năng responsive trên thiết bị di động */
@media (max-width: 768px) {
    .fcm_social-post-body img,
    .fcm_content-element img,
    .fcm_html-content img {
        max-width: 100%; /* Đảm bảo hình ảnh không vượt quá container */
        height: auto; /* Giữ tỷ lệ khung hình */
        margin: 5px auto; /* Giảm khoảng cách trên/dưới cho di động */
    }

    .fcm_content-element {
        max-width: 100% !important; /* Ghi đè max-width: 210mm trên di động */
        overflow-x: auto; /* Cho phép cuộn ngang nếu cần */
    }

    .fcm_html-content {
        padding: 10px; /* Giảm padding trên di động */
    }

    .fcm_social-post {
        padding: 10px; /* Giảm padding trên di động */
    }
}
/* Responsive */
@media (max-width: 768px) {
  .fcm_social-feed {
    padding: 10px;
  }

  .fcm_social-post {
    padding: 10px;
    margin-bottom: 15px;
  }

  .fcm_social-post-title {
    font-size: 16px;
  }

  .fcm_social-post-body {
    font-size: 13px;
  }

  .fcm_social-author-name {
    font-size: 13px;
  }

  .fcm_social-post-date {
    font-size: 11px;
  }

  .fcm_social-reaction-btn {
    font-size: 16px;
    padding: 4px 8px;
  }
}
.fcm_post-header {
  margin-bottom: 15px;
}

.fcm_form-group {
  margin-bottom: 12px;
}

.fcm_form-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.fcm_form-row .fcm_form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Checkbox */
.fcm_checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
  font-size: 14px;
  color: #1c1e21;
}

.fcm_checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.fcm_checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: #f0f2f5;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  margin-right: 8px;
  transition: var(--transition);
}

.fcm_checkbox-container:hover .fcm_checkmark {
  background-color: #e4e6e9;
}

.fcm_checkbox-container input:checked ~ .fcm_checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.fcm_checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--background-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.fcm_checkbox-container input:checked ~ .fcm_checkmark:after {
  display: block;
}

.fcm_checkbox-label {
  font-weight: 500;
}

/* Input and Select */
.fcm_title-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: var(--transition);
}

.fcm_title-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.fcm_category-select,
.fcm_type-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  margin-top: 10px;
  padding-right: 36px;
  background: var(--background-white)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")
    no-repeat right 12px center / 14px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: var(--transition);
}

.fcm_category-select:focus,
.fcm_type-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.fcm_type-group {
  display: none;
}

.fcm_category-select:not([value="post"]) ~ .fcm_type-group {
  display: block;
}

/* Textarea Styles */
.fcm_textarea-container {
  position: relative;
  margin-bottom: 15px;
}

#compactEditor,
#mobileEditor {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--editor-font);
  font-size: 14px;
  line-height: 1.6;
  background: var(--background-white);
  resize: vertical;
  transition: var(--transition);
}

#compactEditor:focus,
#mobileEditor:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

#compactEditor:hover,
#mobileEditor:hover {
  border-color: #d0d2d6;
}

.fcm_compact-editor-container {
  display: block;
}

#mobileEditor {
  display: none;
}

.fcm_preview-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 14px;
}

.fcm_remove-image-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--background-white);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fcm_image-preview-container.fcm_has-image .fcm_remove-image-btn {
  display: flex;
}

.fcm_remove-image-btn:hover {
  background: var(--danger-color);
  transform: scale(1.1);
}

.fcm_image-preview img {
  display: none; /* Không dùng thẻ img */
}

/* Buttons */
.fcm_upload-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.fcm_upload-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.fcm_upload-btn:disabled {
  background-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed;
  opacity: 0.7;
}

.fcm_upload-btn.fcm_cloud {
  background: #e3f2fd;
  color: #1976d2;
}

.fcm_upload-btn.fcm_image {
  background: transparent;
  border: #00c8ff solid 2px;
  color: #00c8ff;
}
.fcm_upload-btn.fcm_image:hover {
  background: #7ec4f678;
}

.fcm_upload-btn:hover,
.fcm_post-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.fcm_post-btn {
  width: 100%;
  background: var(--primary-color);
  color: var(--background-white);
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.fcm_disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  background-color: #cccccc;
}
.fcm_post-btn:hover {
  background: var(--primary-hover);
}
/* Card xem trước PDF */
.fcm_pdf-preview-container {
    display: none;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.fcm_pdf-preview {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 10px;
}

.fcm_pdf-preview-title,
.fcm_pdf-preview-size {
    font-size: 14px;
    margin-bottom: 5px;
}

.fcm_remove-pdf-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
}

.fcm_remove-pdf-btn:hover {
    background: #e60000;
}

/* Ẩn nút Đăng bài ban đầu */
.fcm_post-btn {
    display: none;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.fcm_post-btn:hover {
    background: #0056b3;
}
/* Post List */
.fcm_post-item {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  position: relative;
}

.fcm_post-item:hover {
  background: var(--background-light);
  transform: translateX(5px);
}

.fcm_post-item.fcm_active {
  background: #e3f2fd;
  border-left: 4px solid var(--primary-color);
}

.fcm_post-item:last-child {
  border-bottom: none;
}

.fcm_post-title {
  font-weight: 600;
  color: #1c1e21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.fcm_post-actions {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  top: 5px;
  right: 15px;
}

/* Menu */
.fcm_post-item.fcm_show-menu .fcm_info-menu,
.fcm_book-item.fcm_show-menu .fcm_info-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.fcm_menu-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  transition: all 0.2s;
  white-space: nowrap;
}

.fcm_menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.fcm_menu-item:hover {
  background: #f8f9fa;
  color: var(--primary-color);
}

.fcm_menu-item.fcm_delete {
  color: #dc3545;
}

.fcm_menu-item.fcm_delete:hover {
  background: #fef2f2;
  color: #dc3545;
}

/* Book Slideshow */
.fcm_book-slideshow {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 20px 0;
  background: var(--background-white);
  border-radius: var(--border-radius);
  margin: 0 auto 20px;
  box-shadow: var(--shadow-light);
  overflow-x: auto; /* Đảm bảo cuộn ngang */
  overflow-y: hidden;
}
.fcm_slideshow-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    padding: 10px 20px;
    box-sizing: border-box;
}

.fcm_slideshow-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.fcm_slideshow-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.fcm_slideshow-scroll-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.fcm_slideshow-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.fcm_books-container {
  display: flex;
  gap: 15px;
  flex-wrap: nowrap;
  padding: 0;
  width: max-content;
  min-height: 220px;
  box-sizing: content-box;
}

.fcm_book-item {
  flex: 0 0 160px;
  width: 160px;
  height: 220px;
  background: linear-gradient(135deg, #f5faf8 0%, #6dc7b8 100%);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.fcm_book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fcm_book-item.fcm_active {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 16px 32px rgba(24, 119, 242, 0.3);
  border: 2px solid var(--primary-color);
}

.fcm_book-item-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fcm_book-details {
  flex-grow: 1;
  margin-top: 50%;
}

.fcm_book-title {
  font-size: 14px;
  font-weight: 600;
  color: #1c1e21;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.fcm_book-date {
  font-size: 12px;
  color: #65676b;
  text-align: center;
  margin-top: 8px;
}

.fcm_book-info {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #b2f9fc;
  border-radius: 50%;
  border: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary-color);
  cursor: pointer;
  z-index: 2;
}

.fcm_book-info:hover {
  background: rgba(183, 183, 183, 0.8);
}

.fcm_book-tooltip {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: var(--background-white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 200px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  text-align: center;
  z-index: 10;
}

.fcm_book-item:hover .fcm_book-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.fcm_no-books-message {
  width: 100%;
  text-align: center;
  padding: 20px;
  color: #65676b;
}

.fcm_content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 320px); /* Trừ chiều rộng của .fcm_sidebar (320px) */
  overflow: hidden; /* Ngăn nội dung tràn ra ngoài */
}

.fcm_content-display * {
  font-family: "Times New Roman", Times, serif !important;
}

.fcm_content-display p {
  justify-content: center;
}

.fcm_content-display {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  max-height: 600px;
}

.fcm_content-display.fcm_view-mode {
  background: var(--background-white);
}

.fcm_content-viewer {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  color: #1c1e21;
}

.fcm_content-viewer h1,
.fcm_content-viewer h2,
.fcm_content-viewer h3 {
  margin-bottom: 20px;
}

/* PDF Viewer Styles */
.fcm_file-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: transparent;
}

#pdfCanvas {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  display: block;
  /* Xóa scale và margin-top không cần thiết vì scale được xử lý trong JavaScript */
}

/* Navigation Controls */
.fcm_content-viewer {
    display: flex;
    flex-direction: column;
    position: relative;
    height: 500px;
    width: 100%;
    overflow-y: auto;
    align-items: center; /* Căn giữa theo chiều ngang */
    justify-content: space-between; /* Đảm bảo các phần tử con phân bố đều */
}

.fcm_file-viewer {
    width: 100%;
    text-align: center;
}

.fcm_pdf-canvas {
    max-width: 100%;
    height: auto;
}
.fcm_text-content {
    padding: 20px;
    text-align: left;
}

.fcm_viewer-error {
    padding: 20px;
    color: red;
}

.fcm_html-content {
    padding: 20px;
}

.fcm_post-image-viewer {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.fcm_content-element {
    text-align: left;
    max-width: 210mm !important;
    overflow-x: hidden
}
.fcm_content-title {
    font-size: 24px;
    font-weight: bolder !important;
    margin-bottom: 20px;
    text-align: center;
}
.fcm_navigation-controls {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #e4e6ea;
    width: 100%;
    max-width: 800px; /* Đồng bộ với .fcm_content-viewer */
    position: relative;
    margin-top: 10px;
    order: 999;
    box-sizing: border-box; /* Đảm bảo padding không làm tràn */
}

.fcm_nav-btn {
    padding: 5px 10px;
    margin: 0 5px;
    background-color: #007bff;
    color: white;
    border: none;
     align-items: center !important;
    justify-content: center !important;
    border-radius: 4px;
    cursor: pointer;
}

.fcm_nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.fcm_page-info {
    margin: 0 10px;
    white-space: nowrap;
}

.fcm_page-input {
    width: 60px;
    margin: 0 5px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.fcm_go-to-page {
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  margin: 0 5px;
  cursor: pointer;
  font-size: 14px;
}

.fcm_go-to-page:hover {
  background-color: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
.fcm_content-viewer {
        align-items: center; /* Đảm bảo căn giữa trên mobile */
        padding: 10px; /* Giảm padding nếu cần */
    }

    .fcm_navigation-controls {
        display: none; /* Đảm bảo ẩn mặc định */
        flex-direction: row;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%; /* Tránh vượt quá container */
        padding: 8px;
        margin-top: 10px;
    }

    .fcm_nav-btn,
    .fcm_go-to-page {
        padding: 4px 8px;
        font-size: 13px;
    }

    .fcm_page-info,
    .fcm_page-input {
        font-size: 13px;
    }

    .fcm_page-input {
        width: 50px;
    }
}

/* Fullscreen Quill Editor */
.fcm_fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  padding: 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  align-items: flex-start;
  transition: opacity 0.3s ease;
}

.fcm_fullscreen-overlay.fcm_show {
  display: flex;
  opacity: 1;
}

.fcm_fullscreen-editor {
  width: 100%;
  max-width: 794px; /* A4 width at 96dpi */
  min-height: 1123px; /* A4 height at 96dpi */
  background: var(--background-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  margin: 20px auto;
  display: flex;
  flex-direction: column;
}

#fullscreenEditor {
  flex: 1;
  overflow-y: auto;
  background: var(--background-white);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  font-family: "Times New Roman", Times, serif !important;
}
#fullscreenEditor * {
  font-family: "Times New Roman", Times, serif !important;
}
.ql-container {
  font-family: var(--editor-font);
  font-size: 14px;
  line-height: 1.6;
  border: none !important;
}

.ql-editor {
  min-height: 800px; /* Ensure sufficient editable area */
  padding: 12px;
  background: var(--background-white);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.ql-editor:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.ql-toolbar {
  position: sticky;
  top: 60px;
  z-index: 10;
  background: var(--background-light);
  border-bottom: 1px solid var(--border-color) !important;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  padding: 8px;
}

.ql-toolbar .ql-formats {
  margin-right: 10px;
}

.ql-toolbar button,
.ql-toolbar .ql-picker-label {
  border-radius: 4px;
  transition: var(--transition);
}

.ql-toolbar button:hover,
.ql-toolbar .ql-picker-label:hover {
  background: var(--primary-color);
  color: var(--background-white);
}

.fcm_editor-header {
  background: var(--background-white);
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.fcm_editor-title {
  display: flex;
  gap: 15px;
  align-items: center;
  flex: 1;
  max-width: 80%;
}

.fcm_fullscreen-overlay .fcm_title-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  background: var(--background-light);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: var(--transition);
}

.fcm_fullscreen-overlay .fcm_title-input::placeholder {
  color: #999;
}

.fcm_fullscreen-overlay .fcm_title-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
  background: var(--background-white);
}

.fcm_editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fcm_btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: none !important;
}

.fcm_btn.fcm_btn-save {
  background: var(--primary-color);
  color: var(--background-white);
}
.fcm_btn.fcm_btn-merge {
  background: rgb(37, 173, 0);
  color: var(--background-white);
}
.fcm_btn.fcm_btn-save:hover {
  background: var(--primary-hover);
}

.fcm_btn.fcm_btn-cancel {
  background: var(--danger-color);
  color: var(--background-white);
}

.fcm_btn.fcm_btn-cancel:hover {
  background: var(--danger-hover);
}

/* Modal Styles */
.fcm_modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex !important; /* Luôn là flex để căn giữa */
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fcm_modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.fcm_modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

.fcm_modal-overlay.show .fcm_modal {
  transform: scale(1);
}

.fcm_modal-overlay * {
  font-family: "Times New Roman", Times, serif !important;
}

.fcm_modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f7f7f7;
  border-bottom: 1px solid #e5e5e5;
}

.fcm_modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.fcm_modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.fcm_modal-close:hover {
  color: #333;
}

.fcm_modal-body {
  padding: 20px;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60px; /* Chiều cao tối thiểu nhỏ hơn để phù hợp với thông báo ngắn */
  height: auto; /* Chiều cao tự điều chỉnh theo nội dung */
}

.fcm_modal-body.has-spinner {
  min-height: 100px; /* Chiều cao lớn hơn khi có spinner */
}

.fcm_modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  background: #f7f7f7;
  border-top: 1px solid #e5e5e5;
  gap: 10px;
}

.fcm_btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.fcm_btn-confirm {
  background: #007bff;
  color: #fff;
}

.fcm_btn-confirm:hover {
  background: #0056b3;
}

.fcm_btn-close {
  background: #6c757d;
  color: #fff;
}

.fcm_btn-close:hover {
  background: #5a6268;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Spinner */
.fcm_loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.fcm_loading-gif {
  width: 40px;
  height: 40px;
  object-fit: contain; /* Đảm bảo GIF không bị méo */
}

.fcm_loading-spinner p {
  margin-top: 10px;
  font-size: 1em;
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .fcm_modal {
    width: 95%;
  }
  .fcm_modal-body {
    font-size: 14px;
    min-height: 50px; /* Chiều cao tối thiểu nhỏ hơn trên di động */
  }
  .fcm_modal-body.has-spinner {
    min-height: 80px; /* Chiều cao khi có spinner trên di động */
  }
  .fcm_btn {
    padding: 6px 12px;
    font-size: 13px;
  }
  .fcm_loading-gif {
    width: 32px;
    height: 32px;
  }
}
/* Cập nhật style cho modal cắt ảnh */
.fcm_crop-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.fcm_crop-modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.fcm_crop-modal-header {
  padding: 15px;
  border-bottom: 1px solid #ddd;
}

.fcm_crop-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-family: "Times New Roman", Times, serif !important;
}

.fcm_crop-modal-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fcm_crop-preview-container {
  flex: 1;
  text-align: center;
}

.fcm_crop-preview-container input[type="file"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
  cursor: pointer;
}

.fcm_crop-preview-container input[type="file"]:hover {
  border-color: #2196f3;
}

.fcm_crop-preview-container img#fcmCropImagePreview {
  max-width: 100%;
  max-height: 400px;
  display: none;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.fcm_crop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fcm_crop-size-display {
  font-size: 1rem;
  color: #333;
}

.fcm_crop-resize-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.fcm_crop-resize-inputs .fcm_form-group {
  flex: 1;
  min-width: 120px;
}

.fcm_crop-resize-inputs .fcm_crop-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.fcm_crop-modal-footer {
  padding: 15px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.fcm_btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.fcm_btn.fcm_btn-close {
  background: #f44336;
  color: #fff;
}

.fcm_btn.fcm_apply-resize {
  background: #2196f3;
  color: #fff;
  margin-bottom: 12px;
}

.fcm_btn:hover {
  opacity: 0.9;
}
.cropper-container {
  max-width: 100%;
  max-height: 400px;
  margin: 0 auto;
}
.highlight {
  color: var(--primary-color);
  font-weight: bolder !important;
}

/* Page break divider */
.fcm_page-break {
    display: block;
    height: 1px;
    border: 0;
    border-top: 2px dashed var(--border-color);
    margin: 20px 0;
    width: 100%;
    cursor: default;
}
/* Page list container */
.fcm_page-list {
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap on both mobile and desktop */
  align-items: center;
  gap: 8px; /* Increased gap for better spacing */
  padding: 12px 10px; /* Slightly more padding for comfort */
  background: var(--background-light, #f5f5f5);
  border-bottom: 1px solid var(--border-color, #ddd);
  overflow-x: auto; /* Enable horizontal scroll if needed */
  position: sticky;
  top: 60px; /* Stick below .fcm_editor-header */
  z-index: 10;
  scroll-behavior: smooth;
}

/* Page item */
.fcm_page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--background-white, #fff);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color, #333);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-width: 70px; /* Slightly smaller for mobile */
  max-width: 100px; /* Prevent overly wide items */
  box-shadow: var(--shadow-light, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.fcm_page-item:hover {
  background: var(--hover-background, #e3f2fd);
  border-color: var(--primary-color, #007bff);
}

.fcm_page-item.active {
  background: var(--primary-color, #007bff);
  color: var(--background-white, #fff);
  border-color: var(--primary-color, #007bff);
}

/* Page delete button */
.fcm_page-delete-btn {
  width: 20px;
  height: 20px;
  background: #f98f99;
  color: var(--background-white, #fff);
  border: none;
  border-radius: 50%;
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.fcm_page-delete-btn:hover {
  background: var(--danger-hover, #c82333);
  transform: scale(1.1);
}

.fcm_page-delete-btn:disabled {
  background: var(--disabled-color, #cccccc);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Page number span */
.fcm_page-item span {
  flex: 1;
  text-align: center;
  font-weight: 500;
}

/* Active state for delete button */
.fcm_page-item.active .fcm_page-delete-btn {
  background: #f98f99
}

.fcm_page-item.active .fcm_page-delete-btn:hover:enabled {
  background: var(--danger-hover, #c82333);
}

/* Page break button */
.fcm_page-break-btn {
  padding: 4px 8px;
  background: var(--primary-color, #007bff);
  color: var(--background-white, #fff);
  border: none;
  border-radius: 10px;
  font-size: 12px;
  line-height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-light, 0 2px 4px rgba(0, 0, 0, 0.1));
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0; /* Prevent shrinking */
}

.fcm_page-break-btn:hover:enabled {
  background: var(--primary-hover, #0056b3);
  transform: scale(1.1);
}

.fcm_page-break-btn.disabled {
  background: var(--disabled-color, #cccccc);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fcm_page-list {
    gap: 6px;
    padding: 10px 8px;
  }
.fcm_type-select {
  min-width: 100px;
}
  .fcm_page-item {
    min-width: 60px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .fcm_page-delete-btn {
    width: 18px;
    height: 18px;
    font-size: 11px;
    margin-right: 4px;
  }

  .fcm_page-break-btn {
    font-size: 10px;
    line-height: 28px;
  }
}

@media (max-width: 480px) {
  .fcm_page-list {
    gap: 5px;
    padding: 8px 6px;
  }

  .fcm_page-item {
    min-width: 55px;
    max-width: 90px;
    font-size: 12px;
  }
}
/* Print Styles for Quill Editor */
@media print {
  .fcm_fullscreen-overlay {
    position: static;
    background: var(--background-white);
    padding: 0;
  }

  .fcm_fullscreen-editor {
    box-shadow: none;
    margin: 0;
    max-width: 100%;
    min-height: 100%;
  }

  .fcm_editor-header,
  .ql-toolbar {
    display: none;
  }

  #fullscreenEditor,
  .ql-container,
  .ql-editor {
    padding: 0;
    margin: 0;
    min-height: auto;
    box-shadow: none;
    border: none;
  }

  .ql-editor {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* Media Queries */
@media (max-width: 768px) {
  .fcm_header h1 {
    font-size: 30px !important;
  }
  .fcm_default-content h2 {
    font-size: 20px !important;
  }
  .fcm_main-content {
    flex-direction: column;
  }

  .fcm_sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .fcm_content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
  }
  .fcm_book-slideshow {
    padding: 10px 0;
    margin: 0;
    border-radius: 0;
    width: 100%;
    overflow: visible;
  }

  .fcm_book-item {
    flex: 0 0 180px;
    width: 180px;
    height: 240px;
  }

  .fcm_compact-editor-container {
    display: none;
  }

  #mobileEditor {
    display: block;
  }

  .fcm_fullscreen-btn {
    display: block;
  }

  .fcm_fullscreen-editor {
    max-width: 100%;
    margin: 10px;
    min-height: 90vh;
  }

  /* PDF Viewer on Mobile */
  .fcm_file-viewer {
    padding: 10px;
    max-width: 100%;
  }

  #pdfCanvas {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  .fcm_navigation-controls {
    bottom: 10px;
    padding: 8px 16px;
    gap: 8px;
  }

  .fcm_nav-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .fcm_page-info {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .fcm_book-item {
    flex: 0 0 140px;
    width: 140px;
    height: 200px;
  }

  .fcm_content-display {
    padding: 15px;
  }

  /* PDF Viewer on Small Mobile */
  .fcm_file-viewer {
    padding: 5px;
  }

  #pdfCanvas {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  .fcm_navigation-controls {
    bottom: 5px;
    padding: 6px 12px;
    gap: 6px;
  }

  .fcm_nav-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .fcm_page-info {
    font-size: 11px;
  }
}

.active {
  display: block;
}
.fcm_social-reaction-btn {
  background: none;
  border: rgb(8, 43, 148) 1px solid;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s ease;
}

.fcm_like-btn.fcm_liked {
  color: #1877f2;
  font-weight: bold;
}

.fcm_social-reaction-placeholder {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 16px;
  user-select: none;
  border: rgb(215, 190, 26) 1px solid;
  border-radius: 10px;
}

.fcm_reaction-popup, .fcm_reaction-list {
  display: none;
  position: absolute;
  bottom: 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 8px;
  z-index: 1000;
  flex-direction: row;
  gap: 8px;
}

.fcm_reaction-item {
  font-size: 24px;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.fcm_reaction-item.fcm_reaction-hovered {
  transform: scale(1.5);
}

.fcm_social-post-reactions {
  position: relative;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .fcm_reaction-popup, .fcm_reaction-list {
    bottom: 50px;
    padding: 6px;
  }

  .fcm_reaction-item {
    font-size: 20px;
  }
}
.fcm_social-author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
  .fcm_social-author-img {
    width: 32px;
    height: 32px;
  }
}

/* Đảm bảo bố cục fcm_social-author căn chỉnh tốt */
.fcm_social-author {
  display: flex;
  align-items: center;
}

/* Modal Merge Content */
.fcm_merge_modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1003;
    display: flex;
    justify-content: center;
    align-items: center;
}
.fcm_merge_modal-overlay * {
  font-family: 'Times New Roman', Times, serif !important;
}
.fcm_merge_modal {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.fcm_merge_modal-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.fcm_merge_modal-header h3 {
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    font-family: 'Times New Roman', Times, serif !important;
    color: #333;
}

.fcm_merge_modal-body {
    padding: 15px;
}

.fcm_merge_tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.fcm_merge_tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    color: #555;
    background: #f5f5f5;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    transition: background 0.2s, color 0.2s;
}

.fcm_merge_tab:hover {
    background: #e0e0e0;
}

.fcm_merge_tab.active {
    background: #0073aa;
    color: #fff;
    font-weight: bold;
}

.fcm_merge_tab-content {
    display: none;
}

.fcm_merge_tab-content.active {
    display: block;
}

.fcm_merge_loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #555;
}

.fcm_merge_loading .fcm_merge_spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.fcm_merge_list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    padding: 10px;
    background: #fafafa;
}

.fcm_merge_list div {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.fcm_merge_list div:last-child {
    border-bottom: none;
}

.fcm_merge_list input[type="checkbox"] {
    margin-right: 10px;
}

.fcm_merge_list button {
    margin-left: 10px;
    padding: 5px 10px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.fcm_merge_list button:hover {
    background: #005177;
}

.fcm_merge_modal-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.fcm_merge_btn-confirm,
.fcm_merge_btn-close {
    padding: 8px 15px;
    margin-left: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.fcm_merge_btn-confirm {
    background: #0073aa;
    color: #fff;
}

.fcm_merge_btn-confirm:hover {
    background: #005177;
}

.fcm_merge_btn-close {
    background: #d63638;
    color: #fff;
}

.fcm_merge_btn-close:hover {
    background: #a5282a;
}

/* Responsive */
@media (max-width: 600px) {
    .fcm_merge_modal {
        width: 95%;
    }
    .fcm_preview_modal-overlay {
      width: 100%;
    }

    .fcm_merge_tab {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .fcm_merge_list {
        max-height: 200px;
    }

    .fcm_merge_loading {
        font-size: 0.9em;
    }

    .fcm_merge_spinner {
        width: 20px;
        height: 20px;
    }
}

.fcm_preview_modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}
.fcm_preview_modal-overlay *{
  font-family: 'Times New Roman', Times, serif !important;
}
.fcm_preview_modal {
    background: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.fcm_preview_modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.fcm_preview_content.ql-editor {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.fcm_preview_content.ql-editor p {
    margin-bottom: 10px;
}

.fcm_merge_modal-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.fcm_merge_modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.fcm_merge_modal-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.fcm_btn.fcm_preview_btn-close {
    background: #636262;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.fcm_btn.fcm_preview_btn-close:hover {
    background: #aaa;
}
.fcm-btn_view{
  font-size: 10px;
  border: 2px solid #18be02 !important;
  background-color: transparent !important;
  color: #18be02 !important;
}

/* Ảnh được chọn */
.fcm-img-selected {
  border: 5px dashed #2196f3;
  user-select: none;
}

/* Khung resize */
.fcm-img-resizer {
  position: absolute;
  border: none;
  cursor: nwse-resize;
  user-select: none;
  touch-action: none;
  z-index: 999999;
}

