/* Base Reset and Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base CSS variables controlling the colour scheme and spacing.  */
:root {
    /* Light theme (default) */
    --primary: #2563eb;          /* Primary accent colour */
    --primary-hover: #1d4ed8;    /* Darker accent for hover states */

    --bg-body: #f8fafc;          /* Page background */
    --bg-surface: #ffffff;       /* Card surfaces */
    --bg-subtle: #f1f5f9;        /* Subtle backgrounds (buttons) */

    --text-main: #0f172a;        /* Main text colour */
    --text-muted: #64748b;       /* Secondary text */
    --text-light: #94a3b8;       /* Light text on subtle backgrounds */
    --text-invert: #ffffff;      /* Text on primary buttons */

    --border-color: #e2e8f0;     /* Borders and grid lines */
    --shadow-color: rgba(0, 0, 0, 0.05); /* Soft shadows */
}

/* Base HTML and Body Styles */
html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
}

/* Dark theme overrides.  The [data-theme="dark"] attribute is toggled via JS. */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;

    --bg-body: #020617;
    --bg-surface: #1e293b;
    --bg-subtle: #334155;

    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --text-invert: #0f172a;

    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Apply the variables to utility class shorthand names used in our markup.  Tailwind
 * classes refer to CSS variables defined here via the `tw-[name]` plugin, but we
 * also provide fallback classes for older browsers. */
.bg-body { background-color: var(--bg-body); }
.bg-surface { background-color: var(--bg-surface); }
.bg-subtle { background-color: var(--bg-subtle); }
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.border-border { border-color: var(--border-color); }
.text-primary { color: var(--primary); }
.text-primary-dark { color: var(--primary-hover); }

/* Basic Grid System */
.grid {
    display: grid;
}
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Common Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.overflow-hidden { overflow: hidden; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.text-center { text-align: center; }
.max-w-7xl { max-width: 80rem; margin-left: auto; margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pb-12 { padding-bottom: 3rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }

/* Responsive Grid Columns */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.col-span-full { grid-column: 1 / -1; }


/* Hero section styling, adapted from the original PromptPlum design.  The
 * pseudoâ€‘element draws a subtle grid that fades towards the edges. */
.hero-section {
    position: relative;
    background: linear-gradient(to bottom, var(--bg-body) 0%, var(--bg-surface) 100%);
    padding-top: 4rem;
    padding-bottom: 3rem;
    text-align: center;
    overflow: hidden;
}
.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    /* Fade the grid with a radial mask */
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: 3rem;
    line-height: 1.1;
    margin: 0 0 0.5rem;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--text-main);
}
.hero-highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.2));
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 32rem;
    line-height: 1.6;
    margin-left: auto;
    margin-right: auto;
}
.hero-search {
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    display: flex;
    background: var(--bg-surface);
    border-radius: 9999px;
    box-shadow: 0 0 0 4px var(--shadow-color);
    transition: box-shadow 0.3s ease;
}
.hero-search:focus-within {
    box-shadow: 0 0 0 4px var(--primary);
}
.search-input {
    flex: 1 1 auto;
    padding: 0.75rem 4rem 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}
.search-input:focus {
    border-color: var(--primary);
}
.search-btn {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    height: 2.25rem;
    width: 2.25rem;
    background: var(--primary);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-invert);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.search-btn:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}
.hero-tags {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.hero-tags a {
    color: var(--text-light);
    border-bottom: 1px dotted var(--border-color);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}
.hero-tags a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.hero-tags .separator {
    margin: 0 0.5rem;
    opacity: 0.3;
}

/* Feed tabs row: Latest, Trending, Popular */
.feed-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.feed-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.feed-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.feed-tab.active {
    background: var(--primary);
    color: var(--text-invert);
    border-color: var(--primary);
}

/* Category grid and cards */
.categories-section h2 {
    color: var(--text-main);
}
.categories-section p {
    color: var(--text-muted);
}
.cat-sort-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.cat-sort-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.cat-sort-tab.active {
    background: var(--primary);
    color: var(--text-invert);
    border-color: var(--primary);
}

/* Small category cards - compact grid style */
.category-card-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 70px;
}
.category-card-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
    border-color: var(--primary);
}
.category-name-small {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}
.category-count-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* Original category cards - larger style */
.categories-grid .category-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--bg-surface);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}
.categories-grid .category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-color);
}
.category-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--bg-subtle);
    color: var(--primary);
    flex-shrink: 0;
}
.category-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.category-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}
.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Skeleton loader styles */
.skeleton-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--bg-surface);
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 1rem;
}
/* skeleton elements use a gradient animation for shimmer */
.skeleton-image,
.skeleton-text-line,
.skeleton-button {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-subtle);
    border-radius: 0.5rem;
}
.skeleton-image {
    height: 12rem;
    margin-bottom: 0.75rem;
}
.skeleton-text-line {
    height: 0.75rem;
    margin-bottom: 0.5rem;
}
.skeleton-text-line.short {
    width: 60%;
}
.skeleton-button {
    width: 4rem;
    height: 1rem;
    border-radius: 9999px;
}
/* Shimmer animation using pseudo-element */
.skeleton-image::before,
.skeleton-text-line::before,
.skeleton-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}
@keyframes skeleton-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===================================================================== */
/* Additional UI components */
/*
 * Load more button styling
 */
.load-more-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.load-more-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-invert);
}

/*
 * Live search popup styling
 */
.search-popup,
#search-popup {
    position: fixed;
    left: 0;
    right: 0;
    top: 70px; /* Below header */
    width: 100vw;
    max-width: 100vw;
    margin-top: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    z-index: 50;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.5rem 0;
}
/* Mobile responsive search popup */
@media (max-width: 640px) {
    #search-popup {
        position: fixed;
        left: 0;
        right: 0;
        top: 60px;
        width: 100vw;
        max-width: 100vw;
    }
}
.search-popup ul,
#live-search-results ul,
.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.search-popup li,
#live-search-results li,
.search-results-list li {
    padding: 0.5rem 1rem;
}
.search-popup li a,
#live-search-results li a,
.search-results-list li a {
    display: block;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}
.search-popup li a:hover,
#live-search-results li a:hover,
.search-results-list li a:hover {
    background: var(--bg-subtle);
    color: var(--primary);
    padding-left: 0.5rem;
}
.search-popup .no-results,
#live-search-results .no-results {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Prompt card styling.  Tailwind utility classes handle much of the layout. */
.prompt-card {
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px var(--shadow-color);
}
.prompt-card .card-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 9999px;
    text-transform: uppercase;
    pointer-events: none;
}
.prompt-card .card-likes {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 9999px;
}
.prompt-card .card-likes svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

/* Adjust BoxIcon sizes inside the likes badge when using <i> icons. */
.prompt-card .card-likes i {
    font-size: 1rem;
    margin-right: 0.25rem;
}

/* Style for the like button in single posts */
.like-btn i {
    font-size: 1.25rem;
}
.prompt-card .card-content {
    padding: 1rem;
}
.prompt-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.prompt-card .card-excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prompt-card .card-action {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}
.prompt-card .card-action a {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.prompt-card .card-action a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-invert);
}

/* Copy button on cards */
.copy-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary);
    color: var(--text-invert);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.copy-card-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}
.copy-card-btn:active {
    transform: translateY(0);
}
.copy-card-btn i {
    font-size: 1rem;
}
/* Remove the old prompt-single .prompt-content rules since we now have a custom prompt-box */

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-highlight { font-size: 2rem; display: block; }
    .hero-subtitle { font-size: 1rem; }
}

/* ----------------------------------------------------------------------- */
/* Single post custom styles */

/* Breadcrumb styling */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-muted);
}
.breadcrumb-link {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}
.breadcrumb-link:hover {
    color: var(--primary);
}
.breadcrumb-sep {
    margin: 0 0.25rem;
    color: var(--text-muted);
}
.breadcrumb-current {
    color: var(--text-main);
}

/* Prompt box styling - dark box with scrollable content */
.prompt-box {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid #fbbf24;
    border-radius: 1rem;
    padding: 24px;  
    overflow: auto;
    max-height: 420px;
    height: 420px;
}
.prompt-text {
    max-height: none;
    overflow-y: auto;
    white-space: pre-wrap;    
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgb(254,215,170);
    margin: 0;
    padding-right: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
}
/* Custom scrollbar for prompt text */
.prompt-text::-webkit-scrollbar {
    width: 6px;
}
.prompt-text::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 3px;
}
.prompt-text::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}
.prompt-text::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.prompt-box .copy-btn {
    background: var(--primary);
    color: var(--text-invert);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}
.prompt-box .copy-btn:hover {
    background: var(--primary-hover);
}

/* New prompt copy button with gradient */
.copy-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.copy-prompt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
.copy-prompt-btn i {
    font-size: 1.125rem;
}

/* Try on AI buttons */
.try-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}
.try-ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}
.try-ai-btn i {
    font-size: 1.125rem;
}
.try-gemini {
    background: #4285F4;
    color: white;
    border-color: #4285F4;
}
.try-gemini:hover {
    background: #3367d6;
    border-color: #3367d6;
}
.try-chatgpt {
    background: #10a37f;
    color: white;
    border-color: #10a37f;
}
.try-chatgpt:hover {
    background: #0d8c6d;
    border-color: #0d8c6d;
}
.try-perplexity {
    background: #20808D;
    color: white;
    border-color: #20808D;
}
.try-perplexity:hover {
    background: #1a6b76;
    border-color: #1a6b76;
}

/* Bigger like button for single posts */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-main);
}
.like-btn:hover {
    color: #ff3b30;
}
.like-btn.liked {
    color: #ff3b30;
}
.like-btn i {
    font-size: 1.25rem;
}

/* Tag labels for categories and tags on single post */
.tag-label {
    display: inline-block;
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.tag-label:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-invert);
}

/* Page container content styling */
.page-container .entry-content p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
}
.page-container .entry-content h1,
.page-container .entry-content h2,
.page-container .entry-content h3,
.page-container .entry-content h4,
.page-container .entry-content h5,
.page-container .entry-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Prose styling for post content */
.prose {
    color: var(--text-main);
    max-width: 65ch;
}
.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.prose a {
    color: var(--primary);
    text-decoration: underline;
}
.prose a:hover {
    color: var(--primary-hover);
}
.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.prose li {
    margin-bottom: 0.5rem;
}
.prose code {
    background: var(--bg-subtle);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.prose pre {
    background: var(--bg-subtle);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}
.prose-invert {
    color: var(--text-light);
}
.max-w-none {
    max-width: none;
}

/* Post content section */
.post-content {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
/* Widget styling for footer and sidebar */
.widget {
    margin-bottom: 2rem;
}
.widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    margin-bottom: 0.5rem;
}
.widget ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
}
.widget ul li a:hover {
    color: var(--primary);
}
.footer-widget-area .widget-title {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Post stats styling */
.flex.items-center.gap-4 > div {
    white-space: nowrap;
}

/* Responsive improvements */
@media (max-width: 640px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .feed-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .feed-tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-highlight {
        font-size: 2rem;
        display: block;
        margin-bottom: 0.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-search {
        max-width: 100%;
    }
    .search-input {
        font-size: 0.875rem;
        padding: 0.625rem 3.5rem 0.625rem 1rem;
    }
    .search-btn {
        right: 0.5rem;
        top: 0.375rem;
        height: 2rem;
        width: 2rem;
    }
}

/* Archive and category page styling */
.archive-header {
    background: linear-gradient(to bottom, var(--bg-body) 0%, var(--bg-surface) 100%);
    padding: 3rem 1rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.archive-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.archive-description {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 42rem;
    margin: 0 auto;
}

/* Search results styling */
.search-header {
    background: var(--bg-surface);
    padding: 2rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.search-query {
    color: var(--primary);
    font-weight: 600;
}

/* Comments section styling */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: 0.5rem;
}
.comment-author {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}
.comment-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.comment-content {
    color: var(--text-main);
    line-height: 1.6;
}

/* Accessibility improvements */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}
.screen-reader-text:focus {
    background-color: var(--bg-surface);
    border-radius: 0.25rem;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--text-main);
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Print styles */
@media print {
    .hero-section, header, footer, .feed-tabs, .load-more-btn, .like-btn {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
}

/* New Card Overlay Design (2:4 aspect ratio with background image) */
.prompt-card-overlay {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 2 / 4;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 400px;
}
.prompt-card-overlay:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow-color);
}
.prompt-card-overlay .card-bg-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
    display: block;
}
.prompt-card-overlay .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 2;
}
.prompt-card-overlay .card-top-section {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}
.prompt-card-overlay .card-title-overlay {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding-right: 0.5rem;
}
.prompt-card-overlay .card-title-overlay a {
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.prompt-card-overlay .card-title-overlay a:hover {
    text-decoration: underline;
}
.prompt-card-overlay .card-like-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.prompt-card-overlay .card-like-btn:hover {
    background: rgba(255, 59, 48, 0.8);
    transform: scale(1.1);
}
.prompt-card-overlay .card-like-btn i {
    font-size: 1.25rem;
}
.prompt-card-overlay .card-category-pin {
    position: absolute;
    top: 5rem;
    left: 1rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    color: #ffffff;
    border-radius: 9999px;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.prompt-card-overlay .card-bottom-section {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
}
.prompt-card-overlay .card-author-name {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    width: fit-content;
}
.prompt-card-overlay .copy-card-btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}
.prompt-card-overlay .copy-card-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}
.prompt-card-overlay .copy-card-btn-new i {
    font-size: 1rem;
}

/* Single Post: New Styles */
.prompt-details-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: var(--text-main);
    color: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}
[data-theme="dark"] .prompt-details-pill {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* New Prompt Box with Yellow-Orange Theme */
.prompt-box-new {
    padding: 1.5rem;
    background: rgba(253, 230, 138, 0.15);
    border: 2px solid #fcd34d;
    border-left: 4px solid #fb923c;
    border-radius: 0.75rem;
    box-shadow: 0 4px 8px rgba(252, 211, 77, 0.1);
}
[data-theme="dark"] .prompt-box-new {
    background: rgba(253, 230, 138, 0.1);
    border-color: #fbbf24;
    border-left-color: #f97316;
}
.prompt-text-new {
    background: transparent;
    color: var(--text-main);
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    margin: 0;
    line-height: 1.6;
}

/* Yellow-Orange Gradient Buttons */
.copy-prompt-btn-new,
.try-ai-btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    color: #ffffff;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.3);
}
.copy-prompt-btn-new:hover,
.try-ai-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(251, 191, 36, 0.5);
}
.copy-prompt-btn-new i,
.try-ai-btn-new i {
    font-size: 1rem;
}

/* Single Post Stats */
.single-stat {
    font-weight: 500;
    color: var(--text-main);
}

/* Meta Pills (Model/Tool, Prompt Type) */
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 0.875rem;
}
[data-theme="dark"] .meta-pill {
    background: #334155;
    border-color: #475569;
}
.meta-pill-label {
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}


[data-theme="dark"] .meta-pill-label {
    color: #94a3b8;
}
.meta-pill-value {
    font-weight: 500;
    color: #0f172a;
}
[data-theme="dark"] .meta-pill-value {
    color: #f8fafc;
}

/* Custom Action Button */
.custom-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(236, 72, 153, 0.3);
    width: 100%;
}
.custom-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(236, 72, 153, 0.4);
}
.custom-action-btn i {
    font-size: 1rem;
}

/* Search Popup Full Width Below Header */
#search-popup {
    width: 100vw;
    max-width: 100vw;
}
@media (max-width: 768px) {
    #search-popup {
        top: 60px !important;
    }
}

/* 2. Likes Card specific */
.likes-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
	cursor: pointer;}

.pp-prompt-content {width:00%;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main);
    margin-bottom: 16px;
    overflow-x: auto;
    padding-right: 6px;
    white-space: normal;
    flex: 1;
    overflow-wrap: anywhere;
    max-height: 320px;
    word-break: break-word;
}
img{max-width:100%;}

/* -------------------------------------------------------------------
 * Custom PromptPlum Classes
 *
 * The original theme relied heavily on Tailwind utility classes for layout
 * and component styling. To better mirror the visual appearance of the
 * PromptPlum website without including a full Tailwind build, we define
 * bespoke class names here. These classes encapsulate the design of
 * containers, masonry grids, visual cards, badges, like counters and
 * buttons. They allow our PHP templates to shed Tailwind specific
 * attributes and instead reference a clear, consistent set of CSS
 * selectors. The values for colours, spacing and typography are based on
 * the CSS variables defined at the top of this file so the light/dark
 * theme toggle still works.
 */

/* Container: constrain width, centre horizontally and add horizontal
 * padding. On archive and front pages we also add bottom padding to
 * separate content from the footer. */
.pp-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
}

/* Tabs navigation for sorting feeds. Tabs flow horizontally with a small gap
 * and wrap on mobile. The active tab is coloured using the primary
 * palette while inactive tabs sit on subtle backgrounds. */
.pp-feed-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.pp-feed-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--bg-subtle);
    color: var(--text-main);
    transition: background 0.2s ease, color 0.2s ease;
}
.pp-feed-tab:hover {
    background: var(--bg-surface);
}
.pp-feed-tab.active {
    background: var(--primary);
    color: var(--text-invert);
}

/* Masonry grid for cards. Adjusts the number of columns at breakpoints. */
.pp-masonry-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 600px) {
    .pp-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .pp-masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Visual card wrapper replicating the PromptPlum card design. */
.pp-card.pp-card-visual {
    padding: 0 !important;
    background: var(--bg-surface);
    border: none;
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    box-shadow: 0 10px 40px -10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
    cursor: pointer;
    isolation: isolate;
}
.pp-card.pp-card-visual:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Background image container. If no image is available, a fallback will be
 * shown instead. The image scales up slightly on hover. */
.pp-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.pp-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.pp-card.pp-card-visual:hover .pp-card-bg img {
    transform: scale(1.08);
}
.pp-card-bg-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-body) 100%);
}

/* Floating header inside the card. Holds the label badge on the left and
 * like count on the right. Pointer events are disabled globally but
 * re-enabled on children for interactive elements. */
.pp-card-header-floating {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}
.pp-card-header-floating > * {
    pointer-events: auto;
}

/* Pill shaped badges. Includes a dark variant for use on dark overlays. */
.pp-badge-pill {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}
.pp-badge-pill:hover {
    transform: scale(1.05);
}
.pp-badge-dark {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Like badge container. Houses the like button and count. */
.pp-like-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.pp-like-clickable {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pp-like-count {
    font-weight: 700;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Overlay on the bottom half of the card containing prompt, title, copy
 * button and author. Uses a gradient that fades to transparent. */
.pp-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0) 100%);
    padding: 120px 24px 28px 24px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
.pp-card-prompt-text {
    margin: 0 0 24px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pp-card-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}
.pp-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.pp-card-title a:hover {
    color: var(--primary);
}
.pp-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}
.pp-card-author {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Glassy button used on cards and other components. */
.pp-btn-glassy {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    position: relative;
    z-index: 10;
}
.pp-btn-glassy:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* ---------------------------------------------------------------------------
 * Toast Notification for Copy Action
 *
 * When a user copies a prompt, a small toast should appear at the bottom of
 * the screen to confirm the action. The toast is animated to fade in and out.
 * It uses a green background to indicate success. You can adjust the colours
 * or timing here to suit your branding.
 * -------------------------------------------------------------------------*/
.copy-toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    background-color: #10b981;
    color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    animation: toastFade 2.5s ease-in-out forwards;
}

@keyframes toastFade {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}
.pp-prompt-content{width:100%;}