.hidden {
  display: none;
  z-index: 2000;
}

label {
  margin-bottom: 10px;
  display: block;
  z-index: 2000;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 32px;
  z-index: 9999;
  overflow-y: auto;
  border-radius: 16px 0 0 16px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  font-family: 'Inter', sans-serif;

  /* Start off-screen */
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.side-panel.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  animation: slideInGlow 0.6s ease;
}

@keyframes slideInGlow {
  0% {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  }
  50% {
    box-shadow: 0 16px 48px 0 rgba(31, 38, 135, 0.6);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  }
}



.side-panel h2 {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
}

.background-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bg-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.bg-option img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-option:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.3);
}

.bg-option:hover img {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.bg-option span {
  margin-top: 12px;
  font-size: 0.95em;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(5px);
}

.side-panel button {
  margin-top: 24px;
  padding: 14px 20px;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.side-panel button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.side-panel button:hover::before {
  left: 100%;
}

.side-panel button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.6);
}

.top-buttons-container {
  position: fixed;
  top: 75px;           /* 8px (info box top) + 28px (info box height) + 20px gap */
  right: 20px;
  z-index: 20000;
}

.top-buttons {
  display: flex;
  gap: 12px;
}

.top-buttons.hidden {
  display: none;
}

.top-buttons button {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(31, 38, 135, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.top-buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.top-buttons button:hover::before {
  left: 100%;
}

.top-buttons button:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(31, 38, 135, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Page Info Box (matches .top-buttons and .side-panel styles) */
.page-info-box {
  position: fixed;
  top: 4px;           /* Smaller margin from the top */
  right: 20px;
  margin: 0;
  max-width: 340px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px 9px 10px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  font-size: 1.08rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99999;
  font-family: sans-serif;
}

/* Optional: If you want a similar box inside a panel or modal */
.info-action-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 10px;
  margin: 16px 16px 0 16px;
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.info-action-box .info-row {
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.info-action-box .action-buttons-row {
  display: flex;
  gap: 10px;
}

.info-action-box .action-buttons-row button {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.info-action-box .action-buttons-row button:hover {
  background: #f0f0f0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.ql-editor * {
  color: #000 !important;
}
.ql-editor {
  color: #000 !important;
}

.editing-label {
  color: #64748b;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-right: 4px;
}

.editing-page-name {
  color: #2563eb;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #e0e7ff;
  border-radius: 6px;
  padding: 2px 10px;
  margin-left: 2px;
  transition: background 0.2s;
}

#settingsPanel {
  position: absolute;
  top: 50px;
  right: 20px;
  width: 300px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-family: sans-serif;
}

.settings-panel h3 {
  margin-top: 0;
  font-size: 1.2em;
  margin-bottom: 12px;
}

.settings-panel pre {
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-section {
  margin-bottom: 16px;
}

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: #333;
}

.settings-section p {
  margin: 0;
  font-size: 0.95rem;
  color: #555;
  word-wrap: break-word;
}



.settings-box {
  position: relative;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.settings-box h3 {
  margin: 0 0 6px;
  font-size: 1.1em;
  color: #333;
}

.settings-box p {
  margin: 0;
  color: #555;
  word-break: break-word;
}

.settings-thumb {
  width: 100%;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: none;
}

.edit-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #007bff;
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  display: none;
  z-index: 1;
}

.settings-box:hover .edit-button {
  display: block;
  
}

.settings-box:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#backgroundSelector {
  position: fixed;
  top: 70px;           /* Move modal down below the top buttons (adjust as needed) */
  right: 0;
  width: 320px;
  height: calc(100vh - 70px); /* Adjust height to fit below top buttons */
  max-height: calc(90vh - 70px);
  background: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px 0 0 10px;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.modal-scroll-content {
  overflow-y: auto;
  flex: 1 1 auto;
  padding-bottom: 16px; /* space for the button */
}

.bg-option-message {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.bg-option-message p {
  margin: 0;
}

.modal-close-btn {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  padding: 16px 0;
  z-index: 2;
  border-radius: 0 0 12px 12px;
}
