/**
 * PromptVerse - Custom Editorial Styles & Utility Enhancements
 * Loaded alongside local compiled tailwind.css
 */

:root {
  --pv-accent: #4f46e5;
  --pv-accent-hover: #4338ca;
}

/* Smooth custom scrollbars for prompt boxes and dropdowns */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Rich prose formatting for static pages & SEO content blocks */
.pv-prose h2 {
  font-size: 1.375rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.pv-prose h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.pv-prose p {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.pv-prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  color: #475569;
  margin-bottom: 1rem;
}
.pv-prose li {
  margin-bottom: 0.375rem;
}
.pv-prose a {
  color: #4f46e5;
  text-decoration: underline;
}

/* Line clamp fallbacks */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}


/* Admin responsive layout: desktop sidebar + mobile off-canvas navigation */
.admin-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
}
.admin-menu-toggle svg { width: 21px; height: 21px; }
.admin-sidebar-backdrop { display: none; }
.admin-content { overflow-wrap: anywhere; }
.admin-content table { min-width: 680px; }
.admin-content .overflow-x-auto { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-content input, .admin-content select, .admin-content textarea { max-width: 100%; }

@media (max-width: 767px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .admin-shell { min-height: 100dvh; }
  .admin-menu-toggle { display: inline-flex; }
  .admin-sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min( min(84vw, 320px), 320px );
    max-width: calc(100vw - 48px);
    height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: 18px 0 45px rgba(15, 23, 42, .18);
  }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, .52);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }
  body.admin-nav-open .admin-sidebar-backdrop { opacity: 1; visibility: visible; }
  .admin-main { width: 100%; max-width: 100%; min-width: 0; }
  .admin-main > header { min-height: 64px; height: auto; gap: 8px; padding: 10px 12px; }
  .admin-main > header > div:last-child { gap: 6px; flex: 0 0 auto; }
  .admin-main > header a { white-space: nowrap; }
  .admin-main > header a[href*="logout"] { padding-left: 10px; padding-right: 10px; }
  .admin-content { width: 100%; max-width: 100%; padding: 16px 12px; }
  .admin-content > .mb-6 form { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .admin-content > .mb-6 form input[type="search"] { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .admin-content > .mb-6 form select { width: 100%; min-width: 0; }
  .admin-content > .mb-6 form button { min-width: 84px; }
  .admin-content > .mb-6 > a { width: 100%; }
  .admin-content .rounded-2xl.border.bg-white { max-width: 100%; }
  .admin-content table { min-width: 680px; }
  .admin-main footer { flex-wrap: wrap; gap: 6px; padding: 14px 12px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-sidebar, .admin-sidebar-backdrop { transition: none !important; }
}
