/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.lg-sub-html,
.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html {
  display: hidden !important;
  opacity: 0 !important;
}

/* Standard Markdown styling (dark-friendly, GitHub-inspired) */
.markdown-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  color: #e5e7eb; /* gray-200 */
  font-size: 16px;
}
.markdown-content h1 {
  font-size: 2em;
  margin: 0 0 1em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3em;
}
.markdown-content h2 {
  font-size: 1.5em;
  margin: 1em 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3em;
}
.markdown-content h3 {
  font-size: 1.25em;
  margin: 1em 0;
}
.markdown-content p {
  margin: 1em 0;
}
.markdown-content ul,
.markdown-content ol {
  margin: 1em 0;
  padding-left: 2em;
}
.markdown-content li {
  margin: 0.5em 0;
}
.markdown-content code {
  background-color: #111827; /* gray-900 */
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  font-size: 85%;
  color: #f3f4f6; /* gray-100 */
}
.markdown-content pre {
  background-color: #111827;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}
.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}
.markdown-content blockquote {
  margin: 1em 0;
  padding-left: 1em;
  color: #9ca3af; /* gray-400 */
  border-left: 0.25em solid #374151; /* gray-700 */
}
.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}
.markdown-content th,
.markdown-content td {
  border: 1px solid #374151; /* gray-700 */
  padding: 0.6em 1em;
}
.markdown-content th {
  background-color: #111827;
  font-weight: 600;
}
.document-preview {
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.3px;
}
.pointer {
  cursor: pointer;
}

@media (max-width: 768px) {
  .document-preview {
    padding: 1rem !important;
  }
  .markdown-content {
    font-size: 14px;
  }
  .markdown-content h1 {
    font-size: 1.75em;
  }
  .markdown-content h2 {
    font-size: 1.35em;
  }
  .markdown-content h3 {
    font-size: 1.15em;
  }
}

/* Hide scrollbars in fullscreen modal content but keep scroll behavior */
[data-modal-content] {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
[data-modal-content]::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Hide number input spinners (Chrome/Safari/Edge/Firefox) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Master Doc Canvas Editor Styles */
.master-doc-editor {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  caret-color: #818cf8;
}

.master-doc-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.master-doc-editor h1 {
  font-size: 2.25em;
  font-weight: 700;
  margin: 0 0 0.75em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.master-doc-editor h2 {
  font-size: 1.75em;
  font-weight: 600;
  margin: 1.5em 0 0.75em;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.master-doc-editor h3 {
  font-size: 1.35em;
  font-weight: 600;
  margin: 1.25em 0 0.5em;
  color: rgba(255, 255, 255, 0.95);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.master-doc-editor p {
  margin: 1em 0;
}

.master-doc-editor ul,
.master-doc-editor ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

.master-doc-editor li {
  margin: 0.4em 0;
}

.master-doc-editor strong {
  font-weight: 700;
  color: #fff;
}

.master-doc-editor em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.master-doc-editor a {
  color: #818cf8;
  text-decoration: underline;
}

.master-doc-editor blockquote {
  margin: 1.5em 0;
  padding-left: 1.5em;
  border-left: 3px solid rgba(129, 140, 248, 0.5);
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* Selection styling */
.master-doc-editor ::selection {
  background: rgba(129, 140, 248, 0.4);
}

/* Focus state for headings - subtle highlight */
.master-doc-editor h2:focus,
.master-doc-editor h3:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  margin-left: -8px;
  padding-left: 8px;
}

/* Thin scrollbar for nav sidebar */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ===== Image Placeholder Animations ===== */

/* Shimmer animation for loading placeholders */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite;
}

/* Placeholder skeleton styles */
.image-placeholder {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgb(31, 41, 55), rgb(17, 24, 39));
}

.image-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* Transition for image pop-in */
.image-loaded {
  animation: imagePopIn 0.3s ease-out;
}

@keyframes imagePopIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Progressive Card Rendering ===== */

/* Card fade-in animation */
@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: cardFadeIn 0.4s ease-out forwards;
}

/* Card wrapper for progressive loading */
.card-wrapper {
  will-change: opacity, transform;
}

/* Generation loading indicator */
.generation-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== Claim Button Animations ===== */

/* Slide up animation for claim button */
@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
}

/* Claim pill container */
.claim-pill {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Claim button styles */
.claim-button {
  position: relative;
  overflow: hidden;
}

.claim-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

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

/* Sparkle animation for claim button icon */
.claim-button svg {
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.9);
  }
}

/* Slide up animation for claim button container */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

/* Claim slug input focus styles */
#claim-slug-input:focus {
  width: 10rem;
}

#claim-slug-input.border-green-500 {
  border-color: rgb(34 197 94);
}

#claim-slug-input.border-red-500 {
  border-color: rgb(239 68 68);
}
