.my-editor-container {
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.my-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  user-select: none;
  gap: 4px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #edf0f5 100%);
  border-bottom: 1px solid #d0d7de;
  border-radius: 10px 10px 0 0;
  position: relative;
}
.my-editor-toolbar .my-editor-btn,
.my-editor-toolbar .my-editor-select {
  border: 1px solid #E3E6EA;
  background: transparent;
  padding: 4px 10px;
  user-select: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  height: 32px;
  box-sizing: border-box;
  color: #1f2937;
  position: relative;
}
.my-editor-toolbar .my-editor-btn {
  min-width: 32px;
  text-align: center;
  background: rgba(255,255,255,0.9);
}
.my-editor-toolbar .my-editor-btn:hover {
  background: #ffffff;
  border-color: #b0b8c4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.my-editor-toolbar .my-editor-btn:disabled,
.my-editor-toolbar .my-editor-select:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.my-editor-toolbar .my-editor-select {
  background: white;
  border-color: #d0d7de;
  padding: 2px 6px;
  font-weight: 400;
}
.my-editor-toolbar .my-editor-select:hover,
.my-editor-toolbar .my-editor-color-wrapper:hover {
  border-color: #7AA1DF;
}
.my-editor-toolbar .my-editor-color-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  color: #4b5563;
  background: rgba(255,255,255,0.6);
  padding: 4px 5px;
  border-radius: 5px;
  border: 1px solid #E3E6EA;
  position: relative;
}
.my-editor-toolbar .my-editor-color-wrapper.disabled {
  opacity: 0.4;
  pointer-events: none; 
}
.fake-selection-highlight {
  background-color: rgba(0, 123, 255, 0.3) !important; 
  color: inherit !important;
}
.my-editor-color-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid #ccc;
  border-radius: 2px;
  cursor: pointer;
  display: inline-block;
}
.my-editor-color-wrapper input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
  top: 45px;
  z-index: -1;
}
.my-editor-color-wrapper.left-side input[type="color"] {
  left: 0;
}
.my-editor-color-wrapper.right-side input[type="color"] {
  right: 0;
}
.my-editor-toolbar .my-editor-btn.active,
.my-editor-color-wrapper.is-active,
.my-editor-dropdown.active > button  {
  background: #E4F7FA;
  border-color: #93b4e8;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  color: #1e4b8a;
}
.my-editor-select.active {
  border-color: #7AA1DF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.my-editor-dropdown-image {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  background: #ffffff;
  user-select: none;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 150px;
  margin-top: 8px;
}
.my-editor-dropdown-image.show {
  display: block;
}
.my-editor-dropdown-image button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  color: #1f2937;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.my-editor-dropdown-image button:hover {
  background: #f1f3f5;
}
.my-editor-dropdown-image::before {
  content: '';
  position: absolute;
  top: -6px; 
  left: 12px; 
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #d0d7de;
  border-top: 1px solid #d0d7de;
  transform: rotate(45deg);
  z-index: -1;
}
.my-editor-image-popup {
  position: absolute !important;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  color: #1f2937;
  pointer-events: auto;
}
.popup-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.popup-section:first-child {
  border-bottom: 1px solid #EEEFEF;
}
.popup-label {
  font-weight: 500;
  color: #6b7280;
  margin-right: 4px;
  font-size: 11px;
  width: 20px;
}
.popup-btn {
  border: 1px solid #e3e6ea;
  background: transparent;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #1f2937;
  transition: background 0.15s;
}
.popup-btn:hover {
  background: #f1f3f5;
}
.popup-btn:active {
  background: #e5e9f0;
}
.popup-btn[data-size="plus"],
.popup-btn[data-size="minus"] {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: bold;
  line-height: 1;
  padding: 0;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #d0d7de;
}
.popup-btn[data-size="plus"]:hover,
.popup-btn[data-size="minus"]:hover {
  background: #e5e9f0;
}
.size-display {
  min-width: 40px;
  text-align: center;
  font-size: 11px;
  color: #4b5563;
  font-weight: 500;
}
.popup-btn svg {
  display: block;
  margin: 0 auto;
  color: inherit;
}
.my-editor-toolbar .separator {
  width: 1px;
  height: 26px;
  background: #d0d7de;
  margin: 0 4px;
  display: inline-block;
}
.my-editor-workspace {
  padding: 16px 20px;
  height: 100% !important;
  width: 100% !important;
  outline: none;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 0 0 8px 8px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  resize: none;
  color: #1f2937;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.my-editor-workspace:empty::before {
  content: attr(placeholder);
  color: #9ca3af;
  pointer-events: none;
}
.my-editor-workspace:focus {
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}
.my-editor-htmlarea {
  display: none;
  width: 100% !important;
  height: 100% !important;
  padding: 16px 20px;
  border: none;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  background: #ffffff;
  color: #494C4D !important;
  font-family:  monospace;
  border-radius: 0 0 8px 8px;
  hite-space: pre-wrap; 
  word-wrap: break-word;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1 !important;
  -webkit-overflow-scrolling: touch;
}
.my-editor-htmlarea:focus {
  outline: none;
  background: #ffffff;
}
.my-editor-workspace::-webkit-scrollbar,
.my-editor-htmlarea::-webkit-scrollbar {
  width: 4px;
}
.my-editor-workspace::-webkit-scrollbar-track,
.my-editor-htmlarea::-webkit-scrollbar-track {
  background: #d1d5db; 
  border-radius: 8px;
}
.my-editor-workspace::-webkit-scrollbar-thumb,
.my-editor-htmlarea::-webkit-scrollbar-thumb {
  background: #a0a0a0;
  border-radius: 8px;
}
.my-editor-workspace,
.my-editor-htmlarea {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.my-editor-highlight-display {
  display: none;
  width: 100% !important;
  height: 100% !important;
  padding: 16px 20px;
  border: none;
  font-size: 13px;
  line-height: 1.6;
  box-sizing: border-box;
  background: #1e1e1e; 
  color: #d4d4d4; 
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  border-radius: 0px;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.my-editor-highlight-display::-webkit-scrollbar {
  width: 4px;
}
.my-editor-highlight-display::-webkit-scrollbar-track {
  background: #d1d5db; 
  border-radius: 8px;
}
.my-editor-highlight-display::-webkit-scrollbar-thumb {
  background: #5F6061;
  border-radius: 8px;
}
.my-editor-highlight-display {
  scrollbar-width: thin;
  scrollbar-color: #5F6061 transparent;
}
.my-editor-highlight-display pre {
  margin: 0;
  white-space: pre-wrap; 
  word-wrap: break-word;
}
.hl-tag {
  color: #569cd6; 
  font-weight: bold;
}
.hl-attr {
  color: #9cdcfe;
  font-style: italic;
}
.hl-value {
  color: #ce9178; 
}
.my-editor-dropdown {
  position: relative;
  display: inline-block;
}
.my-editor-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 12px;
  min-width: 200px;
  margin-top: 8px; 
}
.my-editor-dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px; 
  left: 12px; 
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #d0d7de;
  border-top: 1px solid #d0d7de;
  transform: rotate(45deg);
  z-index: -1;
}
.my-editor-dropdown-content.show {
  display: block;
}
.my-editor-dropdown-content input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 11px;
  box-sizing: border-box;
  color: #4A4B4C;
  margin-bottom: 13px;
}
.my-editor-dropdown-content input[type="text"]::placeholder {
  color: #D4D4D4;
}
.my-editor-dropdown-content input[type="text"]:focus {
  outline: none;
  border-color: #4f8ef0;
}
.my-editor-dropdown-content .my-editor-dropdown-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.my-editor-dropdown-content .my-editor-dropdown-actions button {
  padding: 4px 8px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 10px;
  transition: background 0.15s;
}
.my-editor-dropdown-content .my-editor-dropdown-actions button:hover {
  background: #e5e9f0;
}
.my-editor-table-grid {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 4px;
  padding: 4px;
}
.my-editor-table-grid .cell {
  width: 30px;
  height: 30px;
  background: #f0f2f5;
  border: 1px solid #d0d7de;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s;
}
.my-editor-table-grid .cell:hover,
.my-editor-table-grid .cell.highlight {
  background: #4f8ef0;
  border-color: #4f8ef0;
}
.my-editor-table-grid .cell.highlight {
  background: #6ca0f0;
}
.my-editor-table-info {
  text-align: center;
  font-size: 12px;
  color: #4b5563;
  margin-top: 4px;
  height: 20px;
}
.my-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  font-size: 13px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  color: #555;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  flex-wrap: wrap;
  gap: 6px;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.editor-version {
  font-weight: 600;
  color: #333;
  background: #e9ecef;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10px;
}
.footer-divider {
  color: #ccc;
  font-weight: 300;
}
.powered-by {
  font-size: 11px;
  color: #777;
}
.powered-by strong {
  color: #007bff;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.word-count {
  font-style: italic;
  background: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  font-size: 11px;
  color: #333;
}
.powered-link {
  color: #2E2323;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.powered-link:hover {
  color: #0056b3;
}










/* ----- Custom Popup (Modal) ----- */
body.custom-popup-open{
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
}
.my-editor-custom-popup-overlay {
    display: flex; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(1px); 
    -webkit-backdrop-filter: blur(1px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.my-editor-custom-popup-overlay.open {
    visibility: visible;
    opacity: 1;
}
.my-editor-custom-popup-box {
    background: #ffffff;
    border-radius: 15px;
    max-width: 600px !important;
    max-height: 80% !important;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 20, 40, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
    min-width: 400px !important;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.my-editor-custom-popup-overlay.open .my-editor-custom-popup-box {
    transform: scale(1);
}
.my-editor-custom-popup-box:after{
  content: '';
  position: absolute;
  top: -130px;
  left: -130px;
  height: 200px;
  width: 200px;
  background: gray;
  filter: drop-shadow(0 20px 60px rgba(0, 20, 40, 0.08));
  transform: rotate(-45deg);
  z-index: -1;
  opacity: 0.1;
}
.my-editor-custom-popup-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9; 
    color: #64748b;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%; 
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0;
}
.my-editor-custom-popup-close:hover {
    background: #e2e8f0; 
    color: #1e293b;
    transform: rotate(90deg); 
}
.my-editor-custom-popup-close:active {
    transform: scale(0.9); 
}