
.font-settings {
  background-color: #fff8f8 !important;
  border-radius: 10px;
  position: relative;
  margin: 20px 0 0 0;
  height: 60px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.font-settings > div {
  box-sizing: border-box;
  padding: 5px 10px;
}
.font-settings input.settings-input {
  width: 100%;
  min-height: 40px;
  padding: 5px 10px;
  margin: 0;
  color: #000000;
  background: #fff8f8;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #fff8f8;
  -webkit-appearance: none;
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
  -webkit-transition: border linear 0.2s, background-color 0.2s,
    box-shadow linear 0.2s;
  -moz-transition: border linear 0.2s, background-color 0.2s,
    box-shadow linear 0.2s;
  -ms-transition: border linear 0.2s, background-color 0.2s,
    box-shadow linear 0.2s;
  -o-transition: border linear 0.2s, background-color 0.2s,
    box-shadow linear 0.2s;
  transition: border linear 0.2s, background-color 0.2s, box-shadow linear 0.2s;
}

.font-settings .settings-input::placeholder {
    color: #777;
    opacity: 1;
}

/* Responsive mobile (≤ 767px) */
@media (max-width: 767px) {
  .font-settings input.settings-input {
  font-size: 16px !important;
  }
}
  
.font-settings .text {
  position: relative;
  width: 70%;
  padding: 10px 10px !important;
}
.font-settings-sizet {
    width: 30%;
}
.font-settings .text .settings-input {
  padding-right: 30px;
}
.fp-list {
  list-style-type: none;
  margin: 30px 0 0 0;
  padding: 0;
  margin-left: 0;
}
.fp-list li:after {
  background: linear-gradient(to left, #fff 0, rgba(255, 255, 255, 0) 15%);
  bottom: 0;
  content: "";
  height: 100%;
  pointer-events: none;
  position: absolute;
  width: 100%;
  right: 0;
}
.fp-list li,
.style-waterfall {
  padding: 10px 0 10px 0;
  margin-bottom: 20px;
  display: block;
  width: 100%;
  position: relative;
}

.fp-list li span {
  font-size: 12px;
  text-transform: uppercase;
  top: 0;
  position: absolute;
  background: #8150fa;
  display: inline-block;
  border-radius: 10px;
  padding: 2px 10px;
  margin: 0 20px;
  color: #ffffff;
  line-height: 20px;
}

.style-waterfall-head {
  display: block;
  font-size: 10px;
  line-height: 1;
  top: -1px;
  position: absolute;
  width: 100%;
}
.font-test-waterfall h2 {
  font-size: 14px;
  margin: 0 0 20px 0;
  padding: 0;
}
.font-test-waterfall h2:after {
  content: "";
  background: #eff0f4;
  width: 50px;
  height: 1px;
  display: block;
  margin: 10px 0;
  padding: 0;
}
.style-waterfall-headl {
  display: block;
  float: left;
  background: #e8eaf0;
  color: #5a608e;
  line-height: 1;
  padding: 7px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  font-weight: 700;
}
.style-waterfall-headr {
  display: block;
  float: right;
  background: #63bd80;
  color: #fff;
  line-height: 1;
  padding: 7px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  font-weight: 700;
}
.style-waterfall-headr a,
.style-waterfall-headr a:hover {
  color: #fff;
  font-weight: 700;
}
.style-waterfall-headr:hover {
  background: #248142;
}

.waterfall-wrap.mright {
  margin-right: 10px !important;
}
.waterfall-wrap.mleft {
  margin-left: 10px !important;
}
.waterfall-wrap {
  margin: 0 0 20px 0;
  padding: 0;
  overflow: hidden;
}
.waterfall-wrap span {
  font-size: 10px;
  color: #9093b2;
  padding: 10px 0;
  display: block;
}
.waterfall-section {
  border-bottom: 1px solid #e8eaf0;
  padding: 10px 0 20px 0;
}
.waterfall-section.noborder {
  border: none;
}
.align-with-header {
  float: right !important;
  position: absolute;
  top: 50px;
  right: 0;
}
#fp-font-loading {
    position: absolute;
    z-index: 100;
    padding: 2px 10px;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    border-radius: 5px;
    font-size: 12px;
    background: #000;
    color: #fff;
    pointer-events: none;
}
.minmimalsup {
  font-size: 14px;
}
.fp-font-preview-pallate h2 {
  margin: 0 !important;
}
.fp-font-title {
  font-size: 16px;
  margin: 0;
}
#fp-glyph-generate h3 {
  font-size: 24px;
  line-height: 1.4;
  margin-bottom: 20px;
}
.fp-glyph-list {
  margin: 20px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}
.fp-glyph-list li {
  width: 100% !important;
  height: auto !important;
  padding: 15px;
  border: 0.5px solid #ccc;
  min-height: 100px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin: 0;
  line-height: 1em;
}
#fp-glyph-generate {
  margin-bottom: 30px;
}

ul.fp-list {
  display: block;
}



.fp_font_files_fes {
  display: flex;
  gap: 10px;
}
#font-repeater-wrapper input[type="text"],
#font-repeater-wrapper input[type="url"] {
  background: #e9edf7;
  border-color: #e9edf7;
  border-radius: 10px;
}
#font-repeater-wrapper label {
  font-weight: 600;
  margin-bottom: 5px;
}
.fes_font_enbale_label {
  font-weight: 600;
}
.fes-repeater-fields h3,
#font-repeater-section h3 {
  margin: 15px 0;
  font-size: 18px;
}
#font-repeater-section {
  margin-bottom: 20px;
}
.upload-font-button.button {
  background: #e4d3ff;
  max-height: 50px;
  border: 2px solid #e4d3ff;
  border-radius: 10px;
  padding: 5px 20px;
  color: #5a00f0;
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  font-size: 15px;
}
.remove-repeater-item.button {
  background: #ffd6d6;
  border: 2px solid #ffd6d6;
  border-radius: 10px;
  padding: 5px 15px;
  color: #ff0000;
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  padding: 0;
  align-items: center;
  border-radius: 50%;
  font-size: 11px;
}
.remove-repeater-item.button:hover {
  background: #ff0000;
  border-color: #ff0000;
  color: #fff;
}
#add-repeater-item {
  background: #5a00f0;
  border-color: #5a00f0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
}
.fp_font_fes_repeater_item {
  padding: 20px;
  border: 1px solid #e9edf7;
  margin: 15px 0;
  border-radius: 10px;
  position: relative;
}
/* Mobile view: 2 columns */
@media (max-width: 600px) {
  .fp-glyph-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .font-settings .text {
    width: 100%;
  }
  .font-settings-sizet {
    width: 100%;
    margin: 20px;
}
  .fp-font-preview {
    width: 100%;
    float: left;
  }
}

/* Tablet view: 3 columns */
@media (min-width: 601px) and (max-width: 900px) {
  .fp-glyph-list {
    grid-template-columns: repeat(4, 1fr);
  }
  .font-settings .text {
    width: 100%;
  }
  .fp-font-preview {
    width: 100%;
    float: left;
  }
}

/* Larger screens: 10 columns */
@media (min-width: 901px) {
  .fp-glyph-list {
    grid-template-columns: repeat(10, 1fr);
  }
}

/* Nút Glyphs */
button#fp-show-glyphs {
  display: inline-flex;
  align-items: center;
  background-color: #000000;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8em;
  border-style: solid;
  border-radius: 10px;
  padding: 2px 12px 2px 12px;
  margin-bottom: 20px;
  z-index: 999;
  position: relative;
}
#fp-show-glyphs svg {
  display: inline-block;
  margin-right: 5px;
}

/* Ẩn popup ban đầu */
#fp-popup {
  display: none !important; /* Đảm bảo không bị override */
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Hiển thị popup khi có class .active */
#fp-popup.active {
  display: flex !important;
}

/* Nội dung popup */
.fp-popup-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  min-width: 80%;
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

#fp-glyph-generate {
  display: none;
}

#fp-popup.active #fp-glyph-generate {
  display: block;
}

/* Responsive mobile (≤ 767px) */
@media (max-width: 767px) {
  .fp-popup-content {
    max-width: 90%;
    max-height: 90%;
    width: 90%;
    height: 90%;
  }

  .fp-glyph-list {
    grid-template-columns: repeat(5, 1fr);
  }

  .fp-glyph-list li {
    min-height: 80px;
    padding: 5px;
  }

  .font-settings .text {
    max-width: 100%;
    margin-bottom: -20px;
  }

  .font-settings-size {
    margin-top: 25px;
  }
}

/* Scrollbar cho Chrome, Edge, Safari */
.fp-popup-content::-webkit-scrollbar {
  width: 8px;
  border-radius: 10px;
}

.fp-popup-content::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.fp-popup-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px; /* Bo góc thanh cuộn */
}

.fp-popup-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.fp-close-popup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: red;
}
.fp-close-popup:hover {
  color: var(--e-global-color-secondary);
}

.glyph-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.glyph-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e8e8e8;
  background-color: #f9f9f9;
  border-radius: 10px;
  text-shadow: 0.04em 0.04em 0 #ffffff, 0 0 0 #e6e6e6;
}

/* Glyph character */
.glyph-char {
  font-size: 34px;
  line-height: 1.2;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  transition: transform 0.3s ease;
}

.glyph-item:hover .glyph-char {
  transform: scale(2);
}

/* Glyph name */
.glyph-name {
  font-size: 12px;
  text-align: center;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: nowrap;
  color: #a0a0a0;
  font-family: -apple-system, "system-ui", Segoe UI, roboto, helvetica, arial,
    sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
}

svg.e-font-icon-svg.e-far-copy {
  width: 15px;
  height: 15px;
}

/* Nút copy nằm trong góc, không chiếm layout vì absolute */
.glyph-copy-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 28px;
  height: 28px;
    padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.glyph-item:hover .glyph-copy-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.glyph-copy-btn.is-copied {
  background: #f7c600;
}

#font-preview {
  scroll-margin-top: 200px;
}



:root {
  --fp-font-size: 30px;
  --fp-glyph-size: 36px;
}




.glyph-container .glyph-char {
  font-size: var(--fp-glyph-size);
  line-height: 1.4;
}

/* Tối ưu nhiều glyph */
.glyph-container {
  contain: layout paint style;
  content-visibility: auto;
}



.font-size-control .size-slider {
  accent-color: #8150fa;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.font-size-control .size-label {
  font-size: 12px;
  line-height: 1;
  opacity: 0.8;
}
.font-size-control .size-label:last-of-type {
  font-size: 22px;
}

.size-slider {
  flex: 1;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  outline: none;
}
.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
}
.size-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
}

.size-tooltip {
  position: absolute;
  top: -20px;
  left: 0;
  transform: translateX(-50%);
  padding: 0 6px;
  border-radius: 5px 5px 0 5px;
  font-size: 12px;
  background: #000;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, left 0.05s linear;
}
.font-size-control.is-active .size-tooltip {
  opacity: 1;
}

.fp-preview-block .preview-text {
  font-family: inherit;
  font-size: var(--fp-font-size);
  line-height: 1.4;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.5em;
  overflow: hidden;
  border-radius: 10px;
  padding: 25px 20px 20px 20px;
  color: #000;
  transition: font-size 40ms linear;
  border: 1px solid #eaeaea;
}

.fp-preview-block:not([data-font-ready="1"]) .preview-text, .fp-preview-block:not([data-font-ready="1"]) .glyph-container { visibility: hidden; }
