@import '@fontsource/dm-sans/400.css';
@import '@fontsource/dm-sans/500.css';
@import '@fontsource/dm-sans/600.css';
@import '@fontsource/dm-sans/700.css';
@import '@fontsource/dancing-script/400.css';
@import '@fontsource/great-vibes/400.css';
@import '@fontsource/kalam/300.css';
@import '@fontsource/kalam/400.css';
@import '@fontsource/kalam/700.css';
@import '@fontsource/lato/400.css';
@import '@fontsource/lato/700.css';
@import '@fontsource/lato/400-italic.css';
@import '@fontsource/merriweather/400.css';
@import '@fontsource/merriweather/700.css';
@import '@fontsource/merriweather/400-italic.css';
@import '@fontsource/cedarville-cursive/400.css';
@import 'cropperjs/dist/cropper.css';
@import 'tailwindcss';

@theme {
  --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-dancing: 'Dancing Script', cursive;
  --font-vibes: 'Great Vibes', cursive;
  --font-kalam: 'Kalam', cursive;
  --font-lato: 'Lato', sans-serif;
  --font-merriweather: 'Merriweather', serif;
  --font-cedarville: 'Cedarville Cursive', cursive;
}

@layer base {
  body {
    @apply antialiased;
    font-family: var(--font-sans);
  }
}

@theme {
  --font-sans: 'DM Sans', ui-sans-serif, system-ui;
  --font-dancing: 'Dancing Script', cursive;
  --font-vibes: 'Great Vibes', cursive;
  --font-kalam: 'Kalam', cursive;
  --font-lato: 'Lato', sans-serif;
  --font-merriweather: 'Merriweather', serif;
  --font-cedarville: 'Cedarville Cursive', cursive;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: #111827;
  color: #d1d5db;
}

.tool-card {
  transition:
    transform 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
  border: 1px solid #374151;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.2),
    0 4px 6px -2px rgba(0, 0, 0, 0.1);
  border-color: #4f46e5;
}

.btn {
  transition:
    background-color 0.2s ease-in-out,
    transform 0.1s ease-in-out;
}

.btn:active {
  transform: scale(0.98);
}

/* Custom file input */
input[type='file']::file-selector-button {
  @apply bg-indigo-600 text-white font-semibold py-2 px-4 rounded-lg cursor-pointer hover:bg-indigo-700 transition-colors duration-200 mr-4;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #4f46e5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4338ca;
  /* indigo-700 */
}

/* Style for drag-and-drop placeholder */
.sortable-ghost {
  opacity: 0.4;
  border: 2px dashed #4f46e5;
}

#embed-pdf-container>div {
  width: 100%;
  height: 100%;
}

#tool-interface {
  color: #39a0ed;
}

.page-thumbnail,
#file-list>li {
  cursor: grab;
}

.sortable-chosen {
  cursor: grabbing;
}

.compare-viewer-wrapper.overlay-mode {
  position: relative;
  width: 100%;
  height: 75vh;
  overflow: auto;
  border: 2px solid #374151;
  border-radius: 0.5rem;
  background-color: #1f2937;
}

/* This rule now ONLY applies to canvases in overlay mode */
.compare-viewer-wrapper.overlay-mode canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
}

.compare-viewer-wrapper.side-by-side-mode {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.pdf-panel {
  flex: 1;
  min-width: 0;
  overflow: auto;
  height: 75vh;
  border: 2px solid #374151;
  border-radius: 0.5rem;
  background-color: #1f2937;
}

/* This rule ensures canvases in side-by-side panels display at their natural rendered size. */
.pdf-panel canvas {
  display: block;
  margin: 0 auto;
}

footer a {
  transition: color 0.2s ease-in-out;
}

.marker {
  position: relative;
  display: inline-block;
}

.marker::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  /* height: 30px; */
  background-color: orange;
  /* Yellow marker color */
  z-index: -1;
  transform: skew(-20deg);
}

.pill {
  background-color: #374151;
  /* bg-gray-700 */
  color: #d1d5db;
  /* text-gray-300 */
  padding: 8px 16px;
  border-radius: 9999px;
  /* rounded-full */
  font-size: 14px;
  font-weight: 500;
}

.cta-button {
  background-color: #4f46e5;
  /* indigo-600 */
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  /* rounded-lg */
  transition: background-color 0.2s ease-in-out;
}

.cta-button:hover {
  background-color: #4338ca;
  /* indigo-700 */
}

.marker-text {
  background-color: rgba(255, 255, 0, 0.5);
  /* Yellow marker color */
  padding: 0 5px;
}

.feature-card {
  background-color: #1f2937;
  /* bg-gray-800 */
  padding: 24px;
  border-radius: 8px;
  /* rounded-lg */
  text-align: center;
}

.nav-link {
  @apply text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium transition-colors;
}

.mobile-nav-link {
  @apply text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium transition-colors;
}

.marker-slanted {
  position: relative;
  display: inline-block;
}

.marker-slanted::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(120deg, #6366f1, #8b5cf6);
  z-index: -1;
}

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #4f46e5, transparent);
  /* Fades from transparent to indigo and back */
  margin: 2rem auto;
  /* my-16 */
  max-width: 42rem;
  /* max-w-xl */
  opacity: 0.5;
}

.btn-gradient {
  display: inline-block;
  padding: 0.75rem 2rem;
  /* py-3 px-8 */
  border-radius: 0.5rem;
  /* rounded-lg */
  background-image: linear-gradient(to bottom, #6366f1, #4f46e5);
  /* from-indigo-500 to-indigo-600 */
  color: #ffffff;
  /* text-white */
  font-weight: 600;
  /* font-semibold */
  transition-property: all;
  transition-duration: 200ms;
  transform: translateY(0);
}

.btn-gradient:hover {
  box-shadow:
    0 10px 15px -3px rgba(79, 70, 229, 0.3),
    0 4px 6px -4px rgba(79, 70, 229, 0.3);
  /* hover:shadow-xl hover:shadow-indigo-500/30 */
  transform: translateY(-0.25rem);
  /* hover:-translate-y-1 */
}

.btn-gradient:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #111827,
    0 0 0 4px #818cf8;
  /* focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-indigo-400 */
}

.btn-gradient:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.solid-spinner {
  width: 64px;
  /* w-16 */
  height: 64px;
  /* h-16 */
  border: 5px solid #374151;
  /* border-gray-700 */
  border-bottom-color: #4f46e5;
  /* border-indigo-600 */
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#signature-ghost {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  /* Allows clicks to pass through to the canvas */
  opacity: 0.6;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Highlight for selected signature in the saved list */
.saved-signature.selected {
  border-color: #4f46e5;
  /* indigo-600 */
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

/* Cursor change when hovering over a placed signature */
#canvas-sign.movable {
  cursor: move;
}

#canvas-sign.resize-ns {
  cursor: ns-resize;
}

#canvas-sign.resize-ew {
  cursor: ew-resize;
}

#canvas-sign.resize-nesw {
  cursor: nesw-resize;
}

#canvas-sign.resize-nwse {
  cursor: nwse-resize;
}

.faq-item.open .faq-question {
  color: #818cf8;
  /* indigo-400 */
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Testimonial Card Styles */
.testimonial-card {
  background-color: #1f2937;
  /* bg-gray-800 */
  padding: 24px;
  border-radius: 0.75rem;
  /* rounded-xl */
  border: 1px solid #374151;
  /* border-gray-700 */
  display: flex;
  flex-direction: column;
}

.pill {
  background-color: #374151;
  /* bg-gray-700 */
  color: #d1d5db;
  /* text-gray-300 */
  padding: 8px 16px;
  border-radius: 9999px;
  /* rounded-full */
  font-size: 14px;
  font-weight: 500;
}

.pill {
  background-color: #374151;
  /* bg-gray-700 */
  color: #d1d5db;
  /* text-gray-300 */
  /* Smaller padding and font size by default for mobile */
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 9999px;
  /* rounded-full */
  font-weight: 500;
}

/* On small screens (640px) and up, revert to the larger size */
@media (min-width: 640px) {
  .pill {
    padding: 8px 16px;
    font-size: 14px;
  }
}

/* Ensure form-field-group contents don't overflow on small screens */
.form-field-group .capitalize {
  word-break: break-all;
}

@media (max-width: 1023px) {
  #form-fields-container {
    overflow-x: auto;
    white-space: nowrap;
  }

  .form-field-group {
    display: inline-block;
    width: 90%;
    /* Adjust as needed */
    margin-right: 1rem;
  }
}

#page-merge-preview {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.legal-content h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: white;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content h3 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: rgb(129 140 248);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.625;
  color: rgb(156 163 175);
}

.legal-content ul {
  list-style-type: disc;
  list-style-position: inside;
  margin-bottom: 1rem;
  padding-left: 1rem;
  color: rgb(156 163 175);
}

.legal-content a {
  color: rgb(129 140 248);
  text-decoration: underline;
}

.legal-content a:hover {
  color: rgb(165 180 252);
}

details>summary {
  list-style: none;
}

details>summary::-webkit-details-marker {
  display: none;
}

details>summary .icon {
  transition: transform 0.2s ease-in-out;
}

details[open]>summary .icon {
  transform: rotate(45deg);
}

button,
.btn,
.btn-gradient {
  cursor: pointer;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
}

/* Keyboard Shortcuts Styles */
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.25rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1;
  color: #e5e7eb;
  background-color: #374151;
  border: 1px solid #4b5563;
  border-radius: 0.25rem;
  box-shadow: 0 1px 0 0 #1f2937;
}

.shortcut-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.05em;
}

.shortcut-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Custom Scrollbar for Modal Content */
#shortcuts-list::-webkit-scrollbar {
  width: 6px;
}

#shortcuts-list::-webkit-scrollbar-track {
  background: #1f2937;
}

#shortcuts-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 3px;
}

#shortcuts-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Hide elements on touch devices */
@media (pointer: coarse) {
  .hidden-on-touch {
    display: none !important;
  }
}

/* Also hide on very small screens just in case */
@media (max-width: 640px) {
  .hidden-on-touch {
    display: none !important;
  }
}

/* Scroll to Top Button Visibility */
#scroll-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}