.pdfb-context-menu {
  position: fixed !important;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  z-index: 9999 !important;
  min-width: 200px !important;
  max-width: 280px !important;
  padding: 8px 0 !important;
  animation: contextMenuFadeIn 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform-origin: top left !important;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.pdfb-context-menu-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 36px;
  border: none;
  background: transparent;
}

.pdfb-context-menu-item:hover:not(.disabled) {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pdfb-context-menu-item:active:not(.disabled) {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  transform: translateX(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.pdfb-context-menu-item.disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
}

.pdfb-context-menu-item.disabled:hover {
  background-color: transparent;
  transform: none;
  box-shadow: none;
}

.pdfb-context-menu-icon {
  margin-right: 12px;
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

.pdfb-context-menu-label {
  flex: 1;
  font-weight: 500;
  color: #334155;
}

.pdfb-context-menu-separator {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #e2e8f0 20%,
    #e2e8f0 80%,
    transparent 100%
  );
  margin: 6px 0;
  border: none;
}

/* ============================================================================
   CANVAS MODAL STYLES - For React Editor Template Settings Modal
   ============================================================================ */

/* Styles de base des modals */
.pdfb-canvas-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
  animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  /* Centrage sans display flex par défaut pour éviter l'ouverture automatique */
  align-items: center;
  justify-content: center;
}

/* Retirer le sélecteur conditionnel qui ne sert plus */

/* Animations d'entrée améliorées */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header du modal - Style premium */
.pdfb-canvas-modal-header {
  background: #1e293b;
  color: #ffffff;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cbd5e1;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.pdfb-canvas-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdfb-canvas-modal-header h3 span {
  font-size: 28px;
  animation: iconBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1;
}

@keyframes iconBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.pdfb-canvas-modal-close {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.pdfb-canvas-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: rotate(90deg) scale(1.1);
}

.pdfb-canvas-modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

/* Corps du modal */
.pdfb-canvas-modal-body {
  padding: 28px 32px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
}

/* Scrollbar personnalisée */
.pdfb-canvas-modal-body::-webkit-scrollbar {
  width: 8px;
}

.pdfb-canvas-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.pdfb-canvas-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  transition: background 0.2s ease;
}

.pdfb-canvas-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Groupes de paramètres */
.pdfb-setting-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pdfb-setting-group:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  transform: translateY(-2px);
}

.pdfb-setting-label {
  display: block;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Styles pour les inputs */
.pdfb-setting-input,
.pdfb-setting-textarea,
.pdfb-setting-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  color: #334155;
  font-family: inherit;
}

.pdfb-setting-input::placeholder,
.pdfb-setting-textarea::placeholder {
  color: #cbd5e1;
}

.pdfb-setting-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
}

/* Désactivation forcée de l'autocomplete du navigateur */
.pdfb-setting-input:-webkit-autofill,
.pdfb-setting-input:-webkit-autofill:hover,
.pdfb-setting-input:-webkit-autofill:focus,
.pdfb-setting-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: #334155 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.pdfb-setting-input:-webkit-autofill::first-line {
  font-family: inherit;
  color: #334155;
}

/* Style pour masquer les suggestions autocomplete du navigateur */
.pdfb-setting-input::-webkit-credentials-auto-fill-button,
.pdfb-setting-input::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
}

.pdfb-setting-input:focus,
.pdfb-setting-textarea:focus,
.pdfb-setting-select:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pdfb-setting-textarea {
  resize: vertical;
  min-height: 80px;
  padding: 12px 14px;
}

.pdfb-setting-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdfb-setting-input-separator {
  color: #94a3b8;
  font-weight: bold;
  font-size: 16px;
}

.pdfb-setting-unit {
  color: #666;
  font-size: 12px;
}

.pdfb-setting-input-disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

/* Checkboxes */
.pdfb-setting-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdfb-setting-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 6px 8px;
  border-radius: 6px;
  user-select: none;
}

.pdfb-setting-checkbox-label:hover {
  background: rgba(59, 130, 246, 0.05);
}

.pdfb-setting-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdfb-setting-checkbox:hover {
  transform: scale(1.15);
}

.pdfb-setting-checkbox:checked {
  accent-color: #2563eb;
}

/* Status tags */
.pdfb-setting-status-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pdfb-status-tag {
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  border: 1px solid;
}

.pdfb-status-new {
  background: #e0f2fe;
  color: #0369a1;
  border-color: rgba(3, 105, 161, 0.2);
}

.pdfb-status-modified {
  background: #fef3c7;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
}

.pdfb-status-editing {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: rgba(126, 34, 206, 0.2);
}

/* Info text */
.pdfb-setting-info {
  font-size: 13px;
  color: #475569;
  line-height: 1.8;
  background: #f0f7ff;
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

.pdfb-setting-info div {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdfb-setting-info div:last-child {
  margin-bottom: 0;
}

/* Hints */
.pdfb-setting-hint {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin-top: 6px;
  padding: 8px;
  background: rgba(59, 130, 246, 0.05);
  border-left: 2px solid #3b82f6;
  border-radius: 4px;
}

/* Footer du modal */
.pdfb-canvas-modal-footer {
  background: #f8fafc;
  padding: 20px 32px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
}

.pdfb-canvas-modal-btn {
  padding: 11px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  min-width: 100px;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.pdfb-canvas-modal-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.5s,
    height 0.5s;
  z-index: -1;
}

.pdfb-canvas-modal-btn:hover::before {
  width: 300px;
  height: 300px;
}

.pdfb-canvas-modal-btn-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.pdfb-canvas-modal-btn-secondary:hover {
  background: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.pdfb-canvas-modal-btn-secondary:active {
  transform: translateY(0);
}

.pdfb-canvas-modal-btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pdfb-canvas-modal-btn-primary:hover {
  background: #2563eb;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.pdfb-canvas-modal-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ============================================================================
   CANVAS SETTINGS CARDS - For Settings Page Canvas Tab
   ============================================================================ */

.pdfb-canvas-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.pdfb-canvas-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.pdfb-canvas-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.pdfb-canvas-card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdfb-canvas-card-header-left {
  display: flex;
  align-items: center;
}

.pdfb-canvas-card-icon {
  font-size: 28px;
  line-height: 1;
}

.pdfb-canvas-card-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.2px;
}

.pdfb-canvas-card-content {
  padding: 20px 24px;
}

.pdfb-canvas-card-content p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.pdfb-canvas-card-preview {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* Dimensions Preview - Visual Canvas Representation */
.pdfb-dimensions-preview-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pdfb-canvas-preview-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.pdfb-ruler {
  position: absolute;
  background: #94a3b8;
  display: flex;
  z-index: 1;
}

.pdfb-ruler-horizontal {
  top: 8px;
  left: 30px;
  right: 30px;
  height: 14px;
  border-radius: 3px;
  justify-content: space-between;
  padding: 0 2px;
}

.pdfb-ruler-vertical {
  left: 8px;
  top: 30px;
  bottom: 30px;
  width: 14px;
  border-radius: 3px;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
}

.pdfb-ruler-tick {
  background: #ffffff;
  opacity: 0.7;
}

.pdfb-ruler-horizontal .pdfb-ruler-tick {
  width: 1px;
  height: 6px;
  margin: auto 0;
}

.pdfb-ruler-vertical .pdfb-ruler-tick {
  height: 1px;
  width: 6px;
  margin: 0 auto;
}

.pdfb-mini-canvas-preview {
  position: relative;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: canvas-float 4s ease-in-out infinite;
  z-index: 5;
}

@keyframes canvas-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(0.5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-3px) rotate(-0.5deg);
  }
}

.pdfb-format-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

.pdfb-demo-elements {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 4px;
  padding: 12px 8px;
  align-items: flex-start;
}

.pdfb-demo-element {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  animation: element-bounce 2s ease-in-out infinite;
}

.pdfb-demo-element.text-sample {
  animation-delay: 0s;
}

.pdfb-demo-element.image-sample {
  animation-delay: 0.3s;
}

.pdfb-demo-element.shape-sample {
  animation-delay: 0.6s;
}

@keyframes element-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.pdfb-corner-indicator {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid #3b82f6;
  opacity: 0.6;
}

.pdfb-corner-indicator.top-left {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
  border-radius: 2px 0 0;
}

.pdfb-corner-indicator.top-right {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 2px 0 0;
}

.pdfb-corner-indicator.bottom-left {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 2px;
}

.pdfb-corner-indicator.bottom-right {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 2px;
}

.pdfb-dimension-indicator {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.95);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.pdfb-width-indicator {
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
}

.pdfb-height-indicator {
  right: -38px;
  top: 50%;
  transform: translateY(-50%);
}

.pdfb-preview-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.pdfb-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pdfb-detail-item:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}

.pdfb-detail-label {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pdfb-detail-value {
  font-size: 13px;
  color: #1e293b;
  font-weight: 700;
}

.pdfb-color-palette {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.pdfb-color-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pdfb-color-swatch:hover {
  transform: scale(1.05);
}

.pdfb-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.pdfb-color-swatch:hover .pdfb-swatch {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pdfb-color-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* Legacy preview styles (kept for backward compatibility) */
.pdfb-preview-format {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.pdfb-preview-format > div {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
}

.pdfb-preview-size {
  font-size: 12px;
  color: #64748b;
}

.pdfb-canvas-card-actions {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  margin-top: auto;
}

.pdfb-canvas-configure-btn {
  width: 100%;
  padding: 12px 20px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pdfb-canvas-configure-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.pdfb-canvas-configure-btn:active {
  transform: translateY(0);
}

.pdfb-canvas-configure-btn span {
  font-size: 16px;
}

/* Canvas Card Preview - Grid & Navigation */
.pdfb-grid-preview-container {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  min-height: 180px;
}

.pdfb-grid-canvas {
  position: relative;
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
  overflow: hidden;
}

.pdfb-grid-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.pdfb-grid-line {
  border: 0.5px dashed #cbd5e1;
  opacity: 0.6;
}

.pdfb-grid-line.horizontal {
  border-bottom: 1px dashed #cbd5e1;
}

.pdfb-grid-line.vertical {
  border-right: 1px dashed #cbd5e1;
}

.pdfb-grid-dots {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.pdfb-grid-dot {
  width: 4px;
  height: 4px;
  background: #3b82f6;
  border-radius: 50%;
  margin: auto;
  opacity: 0.4;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.3);
  }
}

.pdfb-guide-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pdfb-guide-line {
  position: absolute;
  background: #ef4444;
  opacity: 0.7;
  z-index: 10;
}

.pdfb-guide-line.horizontal {
  width: 100%;
  height: 2px;
  top: 30%;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.pdfb-guide-line.vertical {
  width: 2px;
  height: 100%;
  left: 40%;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.pdfb-guide-line.active {
  animation: guide-pulse 1.5s ease-in-out infinite;
}

@keyframes guide-pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.pdfb-preview-element {
  position: absolute;
  top: 25%;
  left: 35%;
  z-index: 5;
}

.pdfb-element-box {
  width: 60px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: 2px solid #1e40af;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  animation: float-element 3s ease-in-out infinite;
}

@keyframes float-element {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(5px, -5px);
  }
}

.pdfb-grid-legend {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  flex-wrap: wrap;
}

.pdfb-legend-item {
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pdfb-snap-indicator {
  color: #10b981;
  font-weight: 600;
  margin-left: auto;
}

/* Canvas Card Preview - Interactions & Behavior */
.pdfb-interactions-preview-container {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.pdfb-mini-canvas {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
  overflow: hidden;
}

.pdfb-mini-canvas-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(203, 213, 225, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(203, 213, 225, 0.3) 1px, transparent 1px);
  background-size: 20px 20px;
}

.pdfb-mini-element {
  position: absolute;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748b;
  transition: all 0.25s ease;
  cursor: move;
}

.pdfb-mini-element:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}

.pdfb-mini-element.text-element {
  background: #dbeafe;
  border-color: #3b82f6;
}

.pdfb-mini-element.shape-element {
  background: #fef3c7;
  border-color: #f59e0b;
}

.pdfb-mini-element.image-element {
  background: #fce7f3;
  border-color: #ec4899;
}

.pdfb-mini-element.selected {
  border: 2px solid #3b82f6;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.2),
    0 4px 12px rgba(59, 130, 246, 0.3);
  animation: selected-pulse 2s ease-in-out infinite;
}

@keyframes selected-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(59, 130, 246, 0.2),
      0 4px 12px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(59, 130, 246, 0.3),
      0 6px 16px rgba(59, 130, 246, 0.4);
  }
}

.pdfb-mini-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  z-index: 10;
}

.pdfb-mini-handle.nw {
  top: -4px;
  left: -4px;
  cursor: nw-resize;
}
.pdfb-mini-handle.ne {
  top: -4px;
  right: -4px;
  cursor: ne-resize;
}
.pdfb-mini-handle.sw {
  bottom: -4px;
  left: -4px;
  cursor: sw-resize;
}
.pdfb-mini-handle.se {
  bottom: -4px;
  right: -4px;
  cursor: se-resize;
}
.pdfb-mini-handle.rotation {
  background: #10b981;
  border-color: #059669;
  cursor: grab;
}

.pdfb-selection-rectangle {
  position: absolute;
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  pointer-events: none;
  animation: selection-animate 1.5s linear infinite;
}

@keyframes selection-animate {
  0% {
    border-color: #3b82f6;
  }
  50% {
    border-color: #60a5fa;
  }
  100% {
    border-color: #3b82f6;
  }
}

.pdfb-mouse-cursor {
  position: absolute;
  z-index: 20;
  animation: cursor-move 3s ease-in-out infinite;
}

@keyframes cursor-move {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-10px, -10px);
  }
  50% {
    transform: translate(10px, -5px);
  }
  75% {
    transform: translate(-5px, 10px);
  }
}

.pdfb-cursor-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pdfb-zoom-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  z-index: 15;
}

.pdfb-performance-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
}

.pdfb-performance-bar {
  width: 40px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.pdfb-performance-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  transition: width 0.5s ease;
}

.pdfb-performance-text {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
}

.pdfb-interactions-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.pdfb-selection-mode-indicator {
  display: flex;
  gap: 8px;
}

.pdfb-mode-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.pdfb-mode-icon:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.pdfb-mode-icon.active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pdfb-interaction-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdfb-status-indicator {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.pdfb-status-indicator.selecting {
  background: #dbeafe;
  color: #1e40af;
}

.pdfb-keyboard-status {
  display: flex;
  align-items: center;
}

.pdfb-keyboard-icon {
  font-size: 14px;
}

.pdfb-interaction-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
}

.pdfb-progress-label {
  color: #64748b;
  font-weight: 600;
  min-width: 50px;
}

.pdfb-progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.pdfb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  transition: width 0.5s ease;
  animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.pdfb-progress-value {
  color: #3b82f6;
  font-weight: 700;
  min-width: 35px;
  text-align: right;
}

/* Canvas Card Preview - Performance & System */
.pdfb-performance-preview-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.pdfb-performance-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #e2e8f0;
}

.pdfb-metric-item {
  background: #ffffff;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.pdfb-metric-item:hover {
  background: #f8fafc;
  transform: scale(1.05);
}

.pdfb-metric-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdfb-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.pdfb-metric-value.fps-value {
  color: #10b981;
}

.pdfb-metric-value.ram-value {
  color: #3b82f6;
}

.pdfb-metric-value.php-value {
  color: #f59e0b;
}

.pdfb-metric-unit {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.pdfb-performance-status {
  padding: 12px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pdfb-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.pdfb-status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

.pdfb-status-text {
  color: #10b981;
}

/* Enhanced Cards with Badges */
.pdfb-canvas-card-header {
  position: relative;
}

.pdfb-canvas-card-badge {
  position: absolute;
  top: 12px;
  right: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pdfb-canvas-card-badge.new {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pdfb-canvas-card-badge.pro {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.pdfb-canvas-card-content {
  position: relative;
}

.pdfb-canvas-card-features {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pdfb-feature-tag {
  font-size: 10px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-weight: 600;
}

.pdfb-feature-tag.active {
  background: #dbeafe;
  color: #1e40af;
}

/* ============================================================================
   TEMPLATE STATUS CARDS - For Settings Page Templates Tab
   ============================================================================ */

.pdfb-templates-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.pdfb-template-status-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pdfb-template-status-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.pdfb-template-status-card.premium-card {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.pdfb-template-status-card.custom-status-card {
  border-color: #a78bfa;
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

.pdfb-template-status-card header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.pdfb-template-status-card.premium-card header {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.pdfb-template-status-card.premium-card header h4 {
  color: #856404;
}

.pdfb-template-status-card.custom-status-card header {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
}

.pdfb-template-status-card header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdfb-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fbbf24;
  color: #78350f;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pdfb-custom-status-indicator {
  cursor: help;
  font-size: 14px;
}

.pdfb-template-selector {
  padding: 16px 20px;
}

.pdfb-template-selector label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.pdfb-template-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #1e293b;
  transition: all 0.2s ease;
}

.pdfb-template-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pdfb-template-select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.pdfb-template-preview {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.pdfb-template-preview .pdfb-current-template {
  margin: 0;
  padding: 8px 12px;
  background: #e8f5e8;
  border: 1px solid #c3e6c3;
  border-radius: 4px;
  color: #2d5a2d;
  font-weight: 500;
}

.pdfb-template-preview .pdfb-no-template {
  margin: 0;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #6c757d;
  font-style: italic;
}

.pdfb-templates-status-actions {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.pdfb-templates-status-actions .button {
  margin-right: 10px;
  margin-bottom: 10px;
}

.pdfb-templates-status-actions .button-success {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: white !important;
}

.pdfb-templates-status-actions .button-error {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}
