@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Open+Sans:wght@400;700&family=Lato:wght@400;700&family=Montserrat:wght@400;700&family=Oswald:wght@400;700&family=Source+Sans+Pro:wght@400;700&family=Impact&family=Georgia&family=Palatino+Linotype&family=Comic+Sans+MS&family=Lucida+Sans&family=Tahoma&family=Trebuchet+MS&family=Verdana&family=Courier+New&family=Lucida+Console&display=swap');

.fapvl-wrap {
  width: fit-content;
  max-width: 100%;
  margin: 20px auto;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Open Sans, Lato, Montserrat, Oswald, Source Sans Pro, Impact, Helvetica Neue, Arial, Georgia, "Palatino Linotype", "Times New Roman", "Arial Black", "Comic Sans MS", "Lucida Sans", Tahoma, "Trebuchet MS", Verdana, "Courier New", "Lucida Console";
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  overflow: visible;
}

@media (max-width: 768px) {
  .fapvl-wrap {
    padding: 10px;
  }
  .fapvl-head {
    flex-direction: column;
    gap: 8px;
  }
  .fapvl-head,
  .fapvl-select,
  .fapvl-title,
  .fapvl-tags-container,
  .fapvl-drop,
  .fapvl-url,
  #fapvl-preview .fapvl-media-wrap,
  #fapvl-preview img,
  #fapvl-preview video,
  .fapvl-meme-canvas,
  #fapvl-canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  #fapvl_switch_to_meme {
    min-width: 120px;
    padding: 10px 15px;
    font-size: 14px;
  }
}

.fapvl-notice {
  padding: 12px;
  background: #fff7e6;
  border: 1px solid #ffe0a6;
  border-radius: 8px;
  margin-bottom: 8px !important;
}

.fapvl-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px !important;
  width: 100%;
}

.fapvl-select,
.fapvl-title,
.fapvl-drop,
.fapvl-url input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px !important;
  margin-bottom: 8px !important;
  box-sizing: border-box;
  background: #fff;
}

.fapvl-url {
  display: flex;
  gap: 12px;
  margin-bottom: 8px !important;
  width: 100%;
}

.fapvl-drop {
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  background: #fafafa;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}

.fapvl-placeholder {
  font-size: 14px;
  color: #999;
  text-align: center;
  display: block;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  opacity: 0.7;
}

.fapvl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px !important;
  width: 100%;
}

.fapvl-btn {
  padding: 10px;
  border-radius: 999px;
  border: 0;
  background: #efefef !important;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  height: 38px;
  transition: background 0.3s, color 0.3s;
  position: relative;
}

.fapvl-btn i {
  margin: 0;
  color: #000;
  font-size: 16px;
  line-height: 1;
}

.fapvl-btn:hover {
  background: #fef2f2 !important;
  color: #be123c;
}

.fapvl-btn:hover i {
  color: #be123c;
}

#fapvl-font-family:hover,
#fapvl-text-fill-color:hover,
#fapvl-text-outline-color:hover {
  background: #fff !important;
  color: inherit;
}

#fapvl-font-family:hover i,
#fapvl-text-fill-color:hover i,
#fapvl-text-outline-color:hover i {
  color: inherit;
}

.fapvl-btn[for="fapvl_file"],
#fapvl_switch_to_meme {
  background: #fff !important;
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
  width: auto;
  min-width: 120px;
  flex: 1;
  white-space: nowrap;
  padding: 10px 20px;
  cursor: pointer;
  pointer-events: auto;
  gap: 6px;
  height: 38px;
  border-radius: 10px;
}

.fapvl-btn[for="fapvl_file"] i,
#fapvl_switch_to_meme i {
  color: #0ea5e9;
}

#fapvl_submit {
  background: #0ea5e9 !important;
  color: #fff;
  padding: 10px 20px;
  border: none;
  width: auto;
  height: 38px;
  gap: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

#fapvl_submit:hover {
  background: #0284c7 !important;
  color: #fff;
}

#fapvl_submit i {
  color: #fff;
}

#fapvl_submit:hover i {
  color: #fff;
}

#fapvl_submit:disabled {
  background: #e6e6e6 !important;
  color: #888;
  cursor: not-allowed;
  pointer-events: none;
}

#fapvl-preview {
  text-align: center;
  margin: 12px auto 8px;
  width: 100%;
  max-width: 600px;
}

#fapvl-preview .fapvl-media-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#fapvl-preview img,
#fapvl-preview video {
  width: 100%;
  height: auto;
  max-width: 600px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.fapvl-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  margin-bottom: 8px !important;
  width: 100%;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.fapvl-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e11d48 !important;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.fapvl-remove i {
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.fapvl-remove:hover {
  background: #be123c !important;
  transform: scale(1.05);
}

.fapvl-progress {
  width: 100%;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  margin-bottom: 8px !important;
  height: 24px;
}

.fapvl-progress-bar {
  height: 24px;
  background: #0ea5e9;
  color: #fff;
  text-align: center;
  line-height: 24px;
  font-weight: 600;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.fapvl-posts {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  width: 100%;
}

.fapvl-posts h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.fapvl-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fapvl-posts li {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e6e6e6;
}

.fapvl-posts li:last-child {
  border-bottom: none;
}

.fapvl-post-actions-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fapvl-post-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}

.entry-content .fapvl-post-actions {
  width: 100%;
  clear: both;
}

.fapvl-delete-post {
  background: #fff !important;
  border: 1px solid #e11d48;
  color: #e11d48;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: auto;
  transition: background 0.3s, color 0.3s;
}

.fapvl-delete-post:hover {
  background: #fef2f2 !important;
  color: #be123c;
}

.fapvl-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 10000;
  font-weight: 600;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  will-change: transform;
  overflow: hidden;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

#fapvl-meme-editor {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.meme-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px !important;
  padding: 5px;
  background: #f0f0f0;
  border-radius: 10px;
  width: 100%;
  order: 1;
}

.meme-controls .fapvl-layer-remove {
  display: none !important;
}

.fapvl-meme-canvas {
  text-align: center;
  margin: 0 auto;
  margin-bottom: 8px !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  position: relative;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  order: 3;
  overflow: visible !important;
}

#fapvl-canvas {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

#fapvl-font-size-slider,
#fapvl-outline-size-slider {
  padding: 5px;
  height: 38px;
  border-radius: 999px;
  width: 80px;
  border: 1px solid #e6e6e6;
}

#fapvl-text-fill-color,
#fapvl-text-outline-color {
  padding: 0;
  height: 30px;
  width: 30px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  cursor: pointer;
}

#fapvl-font-family {
  padding: 12px;
  height: auto;
  border-radius: 10px;
  width: 200px;
  border: 1px solid #e6e6e6;
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Open Sans, Lato, Montserrat, Oswald, Source Sans Pro, Impact, Helvetica Neue, Arial, Georgia, "Palatino Linotype", "Times New Roman", "Arial Black", "Comic Sans MS", "Lucida Sans", Tahoma, "Trebuchet MS", Verdana, "Courier New", "Lucida Console";
}

.meme-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  margin-bottom: 8px !important;
  width: 100%;
  order: 4;
}

.fapvl-layers-panel {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 8px !important;
  padding: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #f9f9f9;
  order: 2;
}

.fapvl-layers-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fapvl-layers-panel h3::before {
  content: "\f5fd";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #000;
  background: #efefef;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fapvl-layers-panel h3:hover::before {
  background: #fef2f2;
  color: #be123c;
}

.fapvl-layers-panel h3 span {
  flex-grow: 1;
}

.fapvl-layer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #e6e6e6;
  cursor: move;
  user-select: none;
  transition: background 0.2s;
}

.fapvl-layer-item:hover {
  background: #f0f0f0;
}

.fapvl-layer-item.dragging {
  opacity: 0.5;
}

.fapvl-layer-controls {
  display: flex;
  gap: 5px;
}

.fapvl-layer-remove {
  background: #efefef;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.fapvl-layer-remove:hover {
  background: #fef2f2;
  color: #be123c;
}

.fapvl-layer-remove::before {
  content: "\f2ed";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #000;
}

.fapvl-layer-remove:hover::before {
  color: #be123c;
}

.fapvl-layer-remove i.fa-times {
  display: none;
}

#fapvl-download-meme,
#fapvl-finish-meme {
  background: #0ea5e9 !important;
  color: #fff;
  padding: 10px 20px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  height: 38px;
  font-weight: 600;
}

#fapvl-download-meme i,
#fapvl-finish-meme i {
  color: #fff;
}

#fapvl-download-meme:hover,
#fapvl-finish-meme:hover {
  background: #0284c7 !important;
  color: #fff;
}

#fapvl-download-meme:hover i,
#fapvl-finish-meme:hover i {
  color: #fff;
}

.fapvl-tabs {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px !important;
  border-bottom: 2px solid #e6e6e6;
  width: 100%;
  position: relative;
  z-index: 10;
}

.fapvl-tab {
  flex: 1;
  text-align: center;
  padding: 10px 20px;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  pointer-events: auto;
}

.fapvl-tab.active {
  border-bottom: 2px solid #0ea5e9;
  color: #0ea5e9;
}

.fapvl-tab-content {
  position: relative;
  width: 100%;
}

.fapvl-tab-pane {
  display: none;
}

.fapvl-tab-pane.active {
  display: block;
}

#fapvl-image-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
  margin: 0 !important;
  padding: 0 !important;
}

.fapvl-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  padding-right: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  border: 1px solid #e0e0e0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.fapvl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

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

.fapvl-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 10px 0;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
  width: 100%;
}

.fapvl-image-list::-webkit-scrollbar {
  width: 6px;
}

.fapvl-image-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.fapvl-image-list::-webkit-scrollbar-thumb {
  background: #0ea5e9;
  border-radius: 10px;
  border: none;
}

.fapvl-image-list::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}

.meme-thumb-wrapper {
  width: 100px;
  height: 100px;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.25s ease;
  cursor: pointer;
  background: #f0f0f0;
  will-change: transform;
  position: relative;
  contain: layout style paint;
}

.meme-thumb-wrapper:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
  z-index: 5;
}

.meme-thumb-wrapper img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 10px !important;
  position: absolute;
  top: 0;
  left: 0;
}

.meme-thumb-wrapper.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  animation: pulse 1.5s infinite;
  z-index: 1;
}

.meme-thumb-wrapper.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #000;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 2;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

#fapvl-canvas,
.fapvl-meme-canvas {
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  will-change: transform;
}

.meme-controls [data-tooltip] {
  position: relative;
}

.meme-controls [data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: #1f2937;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.meme-controls [data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  border: 5px solid transparent;
  border-top-color: #1f2937;
  z-index: 1000;
}

.meme-controls [data-tooltip].tooltip-hidden:hover::after,
.meme-controls [data-tooltip].tooltip-hidden:hover::before {
  display: none !important;
}

.fapvl-dropdown {
  position: relative;
  display: inline-block;
}

.fapvl-dropdown-content {
  display: none;
  position: absolute;
  background: #fff;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 8px;
  top: 100%;
  left: 0;
  padding: 4px;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.fapvl-dropdown:hover .fapvl-dropdown-content {
  display: flex;
}

.fapvl-dropdown-content a {
  color: #000;
  padding: 6px 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 14px;
  border-radius: 4px;
  gap: 8px;
}

.fapvl-dropdown-content a i {
  color: #000;
  font-size: 16px;
}

.fapvl-dropdown-content a span {
  font-weight: 500;
  color: #000 !important;
}

.fapvl-dropdown-content a:hover {
  background: none;
}

.fapvl-dropdown-content a:hover i,
.fapvl-dropdown-content a:hover span {
  color: #000 !important;
}

.fapvl-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fapvl-slider-group label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.fapvl-slider-group input[type="range"] {
  flex: 1;
  margin: 0;
}

.fapvl-slider-group input[type="color"] {
  flex: 0 0 auto;
  margin: 0;
}

.fapvl-btn:focus,
.fapvl-tab:focus,
.fapvl-remove:focus,
.fapvl-delete-post:focus,
.fapvl-dropdown-content a:focus,
.fapvl-layer-item:focus,
.fapvl-layer-remove:focus,
#fapvl-font-size-slider:focus,
#fapvl-outline-size-slider:focus,
#fapvl-text-fill-color:focus,
#fapvl-text-outline-color:focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

#fapvl-draw {
  background: #efefef !important;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

#fapvl-draw:hover {
  background: #fef2f2 !important;
  color: #be123c;
}

#fapvl-draw i {
  color: #000;
  font-size: 16px;
  transition: transform 0.2s;
}

#fapvl-draw:hover i {
  color: #be123c;
}

#fapvl-draw.active-draw {
  background: #0ea5e9 !important;
  color: #fff;
}

#fapvl-draw.active-draw i {
  color: #fff;
  transform: scale(1.2);
}

#fapvl-reset {
  background: #efefef !important;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
}

#fapvl-reset:hover {
  background: #fef2f2 !important;
  color: #be123c;
}

#fapvl-reset i {
  color: #000;
}

#fapvl-reset:hover i {
  color: #be123c;
}

.fapvl-tags-section {
  width: 100%;
  margin-bottom: 8px !important;
}

.fapvl-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  min-height: 42px;
  align-items: center;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fapvl-tags-container:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

.fapvl-tag-chip {
  display: flex;
  align-items: center;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  gap: 6px;
}

.fapvl-tag-chip .tag-text {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fapvl-tag-chip .remove-tag {
  background: none;
  border: none;
  color: #0369a1;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.fapvl-tag-chip .remove-tag:hover {
  color: #b91c1c;
  transform: scale(1.2);
}

.fapvl-tags-input {
  flex: 1;
  min-width: 150px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 14px;
  padding: 4px 0;
  background: transparent;
  color: #374151;
  cursor: text;
}

.fapvl-tags-input:focus,
.fapvl-tags-input:active,
.fapvl-tags-input:hover {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
}

.fapvl-tags-input::placeholder {
  color: #9ca3af;
}

.fapvl-suggested-tags-wrapper {
  margin-top: 8px;
}

.fapvl-suggested-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggested-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: #1d4ed8;
}

.suggested-tag-pill:hover {
  background: #dbeafe;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}

.suggested-tag-pill strong {
  font-weight: 700;
}

@media (hover: none) {
  .meme-controls [data-tooltip]::after,
  .meme-controls [data-tooltip]::before {
    display: none !important;
  }
}

.fapvl-tags-container {
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.fapvl-title:focus,
.fapvl-select:focus,
.fapvl-url input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
  outline: none;
}

.fapvl-title {
  padding-right: 70px !important;
}

.fapvl-title {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.fapvl-title.max-length {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

#title-counter {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #666;
  font-size: 12px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.fapvl-tag-chip.shake {
  animation: shake 0.5s ease-in-out;
}

@media (max-width: 480px) {
  #fapvl-image-modal {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
  }
  .fapvl-modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }
  .fapvl-modal-header {
    padding: 8px 0;
  }
  .fapvl-image-list {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 8px !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .meme-thumb-wrapper {
    width: 100% !important;
    height: 120px !important;
  }
}

#fapvl_submit {
    transition: none !important;
    will-change: auto !important;
}

#fapvl_submit,
#fapvl_submit:not(:disabled) {
    background: #0ea5e9 !important;
    color: #fff !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

#fapvl_submit:disabled {
    background: #e6e6e6 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

#fapvl_submit.fapvl-post {
    background: #0ea5e9 !important;
    color: #fff !important;
}

#tag-counter {
  margin-left: auto !important;
}

.meme-thumb-wrapper.loading {
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.meme-thumb-wrapper.loading::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: skeleton-sweep 1.5s infinite;
}

@keyframes skeleton-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.lazy-meme {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-meme[src] {
    opacity: 1;
}

.fapvl-meme-canvas.drag-active {
    border-color: #0ea5e9;
    background-color: rgba(14, 165, 233, 0.05);
}

#fapvl-meme-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.meme-controls {
    order: 1 !important;
}

.fapvl-meme-canvas {
    order: 2 !important;
    margin-bottom: 5px !important;
}

.fapvl-layers-panel {
    order: 3 !important;
    max-height: 180px; 
    overflow-y: auto;
    border: 1px solid #e6e6e6;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 8px;
}

.fapvl-layers-panel::-webkit-scrollbar {
    width: 6px;
}
.fapvl-layers-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.meme-footer {
    order: 4 !important;
    margin-top: 5px;
}

.fapvl-layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px; 
    margin-bottom: 5px; 
    border: 1px solid #eee;
    border-radius: 8px; 
    background-color: #fff;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    font-size: 13px; 
    color: #444;
}

.fapvl-layer-item:hover {
    background-color: #f9fafb;
    border-color: #ddd;
}

.fapvl-layer-item.active-layer {
    background-color: #f0f9ff !important;
    border-color: #0ea5e9 !important;
    color: #0369a1;
}

.fapvl-layer-remove {
    background: transparent;
    color: #999;
    border: none;
    border-radius: 6px;
    width: 24px; /* Thu nhỏ nút xóa */
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2;
}

.fapvl-layer-remove:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

#fapvl-layers-list {
    padding: 0;
    list-style: none;
    margin: 0;
}

.fapvl-meme-canvas {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc; 
}

.fapvl-canvas-placeholder {
    position: absolute;
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #999;
    z-index: 1;
}

.fapvl-canvas-placeholder i {
    font-size: 40px;
    opacity: 0.5;
}

.fapvl-canvas-placeholder span {
    font-size: 14px;
    font-weight: 500;
}

.fapvl-meme-canvas.has-content .fapvl-canvas-placeholder {
    display: none;
}

.fapvl-meme-canvas.has-content {
    border-style: solid; 
}

.fapvl-meme-canvas {
    cursor: pointer; 
    transition: all 0.3s ease;
}

.fapvl-meme-canvas:hover {
    background-color: #f8fafc;
    border-color: #0ea5e9;
}


.fapvl-meme-canvas.has-content {
    cursor: default;
    border-style: solid;
}

.fapvl-meme-canvas:not(.has-content) {
    cursor: pointer !important;
}

.fapvl-meme-canvas:not(.has-content) .upper-canvas {
    cursor: pointer !important;
}

.fapvl-canvas-placeholder {
    pointer-events: none; 
}

.fapvl-meme-canvas.has-content {
    cursor: default;
}

.fapvl-drop:hover {
    border-color: #0ea5e9; 
    background: #f0f9ff;    
}