/* ============================================================
   PromptPlum v3 — Main Stylesheet
   Dark theme (prompt library) + Blog styles
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: #030712; color: #f9fafb; font-family: 'DM Sans', sans-serif; -webkit-font-smoothing: antialiased; }

.font-sora { font-family: 'Sora', sans-serif; }
.font-dm   { font-family: 'DM Sans', sans-serif; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-thin::-webkit-scrollbar { width: 4px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── Custom utility classes ─────────────────────────────────── */
.bg-white\/3  { background-color: rgba(255,255,255,0.03); }
.bg-white\/6  { background-color: rgba(255,255,255,0.06); }
.bg-white\/8  { background-color: rgba(255,255,255,0.08); }

/* ============================================================
   HEADER
   ============================================================ */
.pp-header {
    transition: box-shadow 0.3s ease, background 0.3s ease;
}
.pp-header.scrolled {
    background: rgba(3, 7, 18, 0.98) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.5);
}

/* ============================================================
   HERO
   ============================================================ */
.pp-hero {
    background: radial-gradient(ellipse at 50% 0%, rgba(168,85,247,0.10) 0%, transparent 65%);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.pp-filters {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pp-sort-btn { transition: all 0.15s ease; }
.pp-cat-btn  { transition: all 0.15s ease; }
.pp-cat-btn:hover { border-color: rgba(255,255,255,0.2) !important; color: #fff !important; }

/* ============================================================
   MASONRY GRID
   ============================================================ */
.pp-masonry-grid {
    columns: 2;
    column-gap: 14px;
}
@media (min-width: 640px)  { .pp-masonry-grid { columns: 2; column-gap: 16px; } }
@media (min-width: 768px)  { .pp-masonry-grid { columns: 3; column-gap: 16px; } }
@media (min-width: 1024px) { .pp-masonry-grid { columns: 4; column-gap: 18px; } }
@media (min-width: 1280px) { .pp-masonry-grid { columns: 5; column-gap: 18px; } }
@media (max-width: 480px)  { .pp-masonry-grid { columns: 2; column-gap: 10px; } }

.pp-card {
    break-inside: avoid;
    margin-bottom: 14px;
    display: block;
    animation: ppCardIn 0.35s ease both;
}
@keyframes ppCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pp-card:nth-child(1)  { animation-delay: 0.00s; }
.pp-card:nth-child(2)  { animation-delay: 0.04s; }
.pp-card:nth-child(3)  { animation-delay: 0.08s; }
.pp-card:nth-child(4)  { animation-delay: 0.12s; }
.pp-card:nth-child(5)  { animation-delay: 0.16s; }
.pp-card:nth-child(6)  { animation-delay: 0.20s; }
.pp-card:nth-child(7)  { animation-delay: 0.24s; }
.pp-card:nth-child(8)  { animation-delay: 0.28s; }
.pp-card:nth-child(n+9){ animation-delay: 0.32s; }

/* ============================================================
   PROMPT CARD
   ============================================================ */
.pp-card-inner {
    background: #111827;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.pp-card-inner:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(168,85,247,0.15);
    transform: translateY(-2px);
}
.pp-card-image-wrap {
    position: relative;
    overflow: hidden;
    background: #0f172a;
    display: block;
}
.pp-card-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}
.pp-card-inner:hover .pp-card-image { transform: scale(1.05); }

/* Card placeholder */
.pp-card-placeholder {
    background: linear-gradient(135deg, #1e293b 0%, #1a1040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
}

/* Card hover overlay */
.pp-card-inner .absolute.inset-0 {
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 50%, transparent 100%);
}

/* Copy button (overlay) */
.pp-copy-btn {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    border: none;
}
.pp-copy-btn:active { transform: scale(0.97); }

/* Inline copy button */
.pp-copy-btn-inline {
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}
.pp-copy-btn-inline:hover {
    background: rgba(168,85,247,0.15) !important;
    border-color: rgba(168,85,247,0.3) !important;
    color: #c084fc !important;
}

/* Like button */
.pp-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.pp-like-btn:hover { color: #f87171 !important; }
.pp-liked svg { fill: #f87171 !important; color: #f87171 !important; animation: ppHeartPop 0.3s ease; }
@keyframes ppHeartPop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.4)} }

/* Copy animation */
.pp-copy-success { animation: ppCopyPulse 0.3s ease; }
@keyframes ppCopyPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(0.96)} }

/* ============================================================
   BUTTONS (shared)
   ============================================================ */
.pp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #9333ea;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.pp-btn-primary:hover  { background: #7e22ce; color: #fff; }
.pp-btn-primary:active { transform: scale(0.97); }

.pp-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 36px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}
.pp-load-more-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(168,85,247,0.4);
    color: #c084fc;
    transform: translateY(-1px);
}

/* Empty state */
.pp-empty-state { text-align: center; padding: 80px 20px; }
.pp-empty-state p:first-child { font-size: 20px; font-weight: 600; color: #4b5563; margin-bottom: 8px; }
.pp-empty-state p:last-child, .pp-empty-state span { font-size: 14px; color: #6b7280; }

/* ============================================================
   TOAST
   ============================================================ */
#pp-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #1f2937;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
#pp-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#pp-toast .toast-check { width: 15px; height: 15px; color: #4ade80; }

/* ============================================================
   SEARCH RESULTS DROPDOWN
   ============================================================ */
#pp-search-results {
    max-height: 400px;
    overflow-y: auto;
}
.pp-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-decoration: none;
    transition: background 0.12s;
}
.pp-search-result-item:last-child { border-bottom: none; }
.pp-search-result-item:hover { background: rgba(255,255,255,0.05); }
.pp-search-result-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #1f2937;
    flex-shrink: 0;
}
.pp-search-result-title { font-size: 13px; color: #e5e7eb; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pp-search-result-cat   { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* ============================================================
   SINGLE PROMPT PAGE
   ============================================================ */
.pp-single-main-image img {
    max-height: 620px;
    width: 100%;
    object-fit: contain;
    background: #0f172a;
}

/* Thumb buttons on single prompt */
.pp-thumb-btn-active { ring-color: #a855f7 !important; }

/* ============================================================
   BLOG STYLES
   ============================================================ */

/* Blog card hover */
.blog-card { transition: border-color 0.2s ease, background 0.2s ease; }

/* Blog post content */
.pp-blog-content {
    color: #d1d5db;
    font-size: 17px;
    line-height: 1.8;
}
.pp-blog-content h1,
.pp-blog-content h2,
.pp-blog-content h3,
.pp-blog-content h4,
.pp-blog-content h5,
.pp-blog-content h6 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: #f9fafb;
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}
.pp-blog-content h2 { font-size: 1.6rem; }
.pp-blog-content h3 { font-size: 1.3rem; }
.pp-blog-content h4 { font-size: 1.1rem; }
.pp-blog-content p  { margin-bottom: 1.4em; }
.pp-blog-content a  { color: #c084fc; text-decoration: underline; text-decoration-color: rgba(192,132,252,0.3); transition: color 0.15s; }
.pp-blog-content a:hover { color: #a855f7; }
.pp-blog-content ul,
.pp-blog-content ol { margin: 1.2em 0 1.2em 1.5em; }
.pp-blog-content li { margin-bottom: 0.5em; }
.pp-blog-content blockquote {
    border-left: 3px solid #7e22ce;
    padding: 12px 20px;
    margin: 1.5em 0;
    background: rgba(126,34,206,0.08);
    border-radius: 0 8px 8px 0;
    color: #9ca3af;
    font-style: italic;
}
.pp-blog-content img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    margin: 1.5em 0;
}
.pp-blog-content pre {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 14px;
    color: #e5e7eb;
    margin: 1.5em 0;
}
.pp-blog-content code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    color: #c084fc;
}
.pp-blog-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.pp-blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 15px;
}
.pp-blog-content th,
.pp-blog-content td {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: left;
}
.pp-blog-content th {
    background: rgba(255,255,255,0.05);
    font-weight: 600;
    color: #f9fafb;
}
.pp-blog-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 2em 0;
}

/* Blog pagination */
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.15s;
    margin: 0 3px;
}
.page-numbers:hover { color: #fff; border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.08); }
.page-numbers.current { background: #7e22ce; color: #fff; border-color: #7e22ce; }
.page-numbers.prev, .page-numbers.next { width: auto; padding: 0 14px; }

/* Category page header */
.pp-tax-header { border-bottom: 1px solid rgba(255,255,255,0.05); }

/* ============================================================
   FOOTER
   ============================================================ */
.pp-footer {
    background: #030712;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .pp-masonry-grid { columns: 2; column-gap: 10px; }
    .pp-card { margin-bottom: 10px; }
    .pp-hero h1 { font-size: 2rem !important; }
    .pp-blog-content { font-size: 16px; }
}

/* Mobile nav toggle */
#pp-mobile-toggle {
    background: rgba(255,255,255,0.05);
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}
#pp-mobile-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ======================================================
   LOGO ICON
   ====================================================== */
.pp-logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: block;
}
.pp-logo-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

/* ======================================================
   PROMPT TEXT — indentation bug fix
   ====================================================== */
.pp-prompt-text,
#pp-prompt-text-full {
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    white-space: normal !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.75 !important;
    color: #d1d5db !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    word-break: break-word;
}
