/* ==========================================================================
   AI Tool Dude — Prompt Library Styles
   ========================================================================== */

body:not(.dark-mode).page-template-page-prompts,
body:not(.dark-mode).page-template-page-prompts-php {
    background-color: #0f77d8;
    background-image:
        linear-gradient(135deg, rgba(4, 84, 162, 0.18), rgba(255, 138, 0, 0.08)),
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: auto, 52px 52px, 52px 52px;
}

body:not(.dark-mode) .prompt-library-page {
    --color-card-bg: #ffffff;
    --color-card-border: rgba(126, 191, 255, 0.95);
    --color-text: #081b3a;
    --color-text-secondary: #2d4567;
    --color-primary: #ff8a00;
    --color-primary-hover: #f97316;
    --border-card: 2px;
    --radius-card: 12px;
    color: var(--color-text);
}

body:not(.dark-mode) .prompt-library-page .prompt-hero__title {
    color: #ffffff;
    text-shadow: 0 2px 14px rgba(3, 37, 76, 0.25);
}

body:not(.dark-mode) .prompt-library-page .prompt-hero__title span {
    background: linear-gradient(135deg, #fff7ed, #fed7aa 35%, #ff8a00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body:not(.dark-mode) .prompt-library-page .prompt-hero__subtitle,
body:not(.dark-mode) .prompt-library-page .prompt-hero__updated,
body:not(.dark-mode) .prompt-library-page .prompt-count {
    color: #eaf5ff;
    opacity: 1;
}

body:not(.dark-mode) .prompt-library-page .prompt-filter__btn {
    background: #ffffff;
    border-color: rgba(126, 191, 255, 0.95);
    color: #123a68;
    box-shadow: 0 8px 20px rgba(3, 37, 76, 0.1);
}

body:not(.dark-mode) .prompt-library-page .prompt-filter__btn.active,
body:not(.dark-mode) .prompt-library-page .prompt-filter__btn:hover {
    background: #ff8a00;
    border-color: #ff8a00;
    color: #ffffff;
}

/* ---------- Hero ---------- */
.prompt-hero {
    text-align: center;
    padding: 48px 20px 32px;
    max-width: 800px;
    margin: 0 auto;
}

.prompt-hero__title {
    font-size: 38px;
    font-weight: 900;
    color: var(--color-text);
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: 0;
}

.prompt-hero__title span {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prompt-hero__subtitle {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin: 0 0 8px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.prompt-hero__updated {
    font-size: 12px;
    color: var(--color-text-secondary);
    opacity: 0.7;
    font-style: italic;
}

/* ---------- Filters ---------- */
.prompt-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 1300px;
    margin: 0 auto 32px;
    padding: 0 16px;
}

.prompt-filter__btn {
    padding: 8px 18px;
    border: 1.5px solid var(--color-card-border);
    border-radius: 100px;
    background: var(--color-card-bg);
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.prompt-filter__btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-card-bg);
}

.prompt-filter__btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ---------- Grid ---------- */
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 16px;
    align-items: start;
}

/* ---------- Card ---------- */
.prompt-card {
    background: var(--color-card-bg);
    border: var(--border-card) solid var(--color-card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}

body:not(.dark-mode) .prompt-library-page .prompt-card {
    box-shadow: 0 16px 34px rgba(3, 37, 76, 0.16);
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.dark-mode .prompt-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Card Image */
.prompt-card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-card-border);
}

.prompt-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.prompt-card:hover .prompt-card__image img {
    transform: scale(1.05);
}

/* Card Body */
.prompt-card__body {
    padding: 16px 18px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.prompt-card__category {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: inline-block;
}

.prompt-card__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 8px;
    line-height: 1.3;
}

.prompt-card__desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prompt Preview Box */
.prompt-card__preview {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.dark-mode .prompt-card__preview {
    background: rgba(255, 255, 255, 0.05);
}

.prompt-card__preview code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-word;
    white-space: normal;
    overflow: hidden;
}

/* Negative Prompt */
.prompt-card__negative {
    background: rgba(239, 68, 68, 0.06);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.dark-mode .prompt-card__negative {
    background: rgba(239, 68, 68, 0.1);
}

.prompt-card__negative-label {
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.prompt-card__negative code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
    overflow: hidden;
}

/* ---------- Card Actions ---------- */
.prompt-card__actions {
    padding: 8px 18px 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: auto;
}

.prompt-card__actions--count-2,
.prompt-card__actions--count-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prompt-card__actions--count-3 .prompt-card__btn--edit {
    grid-column: 1 / -1;
}

.prompt-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    border: none;
    border-radius: var(--radius-card-btn, 8px);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    transition: all 0.25s ease;
}

.prompt-card__btn svg {
    flex-shrink: 0;
}

/* Copy Button */
.prompt-card__btn--copy {
    background: var(--color-primary);
    color: #fff;
}

.prompt-card__btn--copy:hover {
    background: var(--color-primary-hover);
    transform: scale(1.02);
}

.prompt-card__btn--copy.is-copied {
    background: #10b981;
}

/* Edit Button */
.prompt-card__btn--edit {
    background: transparent;
    border: 1.5px solid var(--color-card-border);
    color: var(--color-text-secondary);
}

.prompt-card__btn--edit:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Copy Negative */
.prompt-card__btn--copy-neg {
    background: transparent;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 12px;
}

.prompt-card__btn--copy-neg:hover {
    background: rgba(239, 68, 68, 0.08);
}

.prompt-card__btn--copy-neg.is-copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* ---------- Variable Editor ---------- */
.prompt-card__editor {
    padding: 0 18px 18px;
    border-top: 1px solid var(--color-card-border);
    margin: 0;
    animation: promptEditorSlideIn 0.3s ease;
}

@keyframes promptEditorSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.prompt-card__editor-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 14px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prompt-card__var-field {
    margin-bottom: 10px;
}

.prompt-card__var-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    text-transform: capitalize;
}

.prompt-card__var-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--color-card-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--color-card-bg);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.prompt-card__var-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.prompt-card__live-preview {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0 8px;
}

.prompt-card__live-preview-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

.prompt-card__live-preview code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--color-text);
    line-height: 1.6;
    display: block;
    word-break: break-word;
    white-space: pre-wrap;
}

.prompt-card__btn--copy-custom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    border-radius: var(--radius-card-btn, 8px);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 4px;
}

.prompt-card__btn--copy-custom:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.prompt-card__btn--copy-custom.is-copied {
    background: #10b981;
}

/* ---------- Load More ---------- */
.prompt-load-more {
    text-align: center;
    padding: 40px 16px;
}

.prompt-load-more__btn {
    padding: 14px 40px;
    border: 2px solid var(--color-primary);
    border-radius: 100px;
    background: transparent;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

.prompt-load-more__btn:hover {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.03);
}

.prompt-load-more__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.prompt-load-more__btn.is-loading {
    pointer-events: none;
}

/* ---------- Editorial / Content (2-Column Layout) ---------- */
.prompt-editorial {
    max-width: 1300px;
    margin: 56px auto 0;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

.prompt-editorial__main {
    background: var(--color-card-bg);
    border: var(--border-card) solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 48px 44px;
}

.prompt-editorial__main h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 20px;
    line-height: 1.3;
    letter-spacing: 0;
}

.prompt-editorial__main h3 {
    font-size: 21px;
    font-weight: 700;
    color: var(--color-text);
    margin: 36px 0 14px;
    line-height: 1.3;
}

.prompt-editorial__main h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin: 24px 0 10px;
    line-height: 1.4;
}

.prompt-editorial__main p {
    font-size: 15.5px;
    color: var(--color-text-secondary);
    line-height: 1.85;
    margin: 0 0 20px;
}

.prompt-editorial__main a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.prompt-editorial__main a:hover {
    color: var(--color-primary-hover);
}

.prompt-editorial__main ul,
.prompt-editorial__main ol {
    padding-left: 22px;
    margin: 0 0 22px;
}

.prompt-editorial__main li {
    font-size: 15.5px;
    color: var(--color-text-secondary);
    line-height: 1.85;
    margin-bottom: 8px;
}

.prompt-editorial__main code {
    background: rgba(59, 130, 246, 0.08);
    color: var(--color-primary);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.prompt-editorial__main strong {
    color: var(--color-text);
    font-weight: 700;
}

.prompt-editorial__main em {
    font-style: italic;
    color: var(--color-text-secondary);
}

/* Sidebar */
.prompt-editorial__sidebar {
    position: sticky;
    top: 100px;
}

.prompt-editorial__sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Widget Base ---------- */
.prompt-widget {
    background: var(--color-card-bg);
    border: var(--border-card) solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 24px;
    transition: box-shadow 0.3s ease;
}

.prompt-widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.dark-mode .prompt-widget:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.prompt-widget__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 16px;
    line-height: 1.3;
}

/* ---------- Widget: Checklist ---------- */
.prompt-widget-checklist__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prompt-widget-checklist__item {
    position: relative;
    padding: 7px 0 7px 28px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dark-mode .prompt-widget-checklist__item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.prompt-widget-checklist__item:last-child {
    border-bottom: none;
}

.prompt-widget-checklist__item::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 7px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
}

/* Highlighted items (orange accent like reference) */
.prompt-widget-checklist__item--highlight {
    color: var(--color-text);
    font-weight: 600;
}

.prompt-widget-checklist__item--highlight::before {
    color: #f59e0b;
}

/* ---------- Widget: Tags Cloud ---------- */
.prompt-widget-tags__cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt-widget-tags__pill {
    display: inline-block;
    padding: 6px 14px;
    border: 1.5px solid var(--color-card-border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: transparent;
    cursor: default;
    transition: all 0.25s ease;
}

.prompt-widget-tags__pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.06);
}

/* ---------- Widget: Tip / Callout ---------- */
.prompt-widget-tip {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.02));
}

.dark-mode .prompt-widget-tip {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.03));
}

.prompt-widget-tip__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.prompt-widget-tip__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.prompt-widget-tip .prompt-widget__title {
    color: #b45309;
    margin: 0;
    font-size: 15px;
}

.dark-mode .prompt-widget-tip .prompt-widget__title {
    color: #fbbf24;
}

.prompt-widget-tip__body {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.prompt-widget-tip__body p {
    margin: 0;
}

/* ---------- Empty State ---------- */
.prompt-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}

.prompt-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.prompt-empty__text {
    font-size: 15px;
    font-weight: 600;
}

/* ---------- Count ---------- */
.prompt-count {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    opacity: 0.7;
}

/* ---------- Toast Notification ---------- */
.prompt-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #10b981;
    color: #fff;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.prompt-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .prompt-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .prompt-hero__title { font-size: 30px; }
    .prompt-editorial { grid-template-columns: 1fr 280px; gap: 28px; }
    .prompt-editorial__main { padding: 36px 30px; }
}

@media (max-width: 768px) {
    .prompt-grid { grid-template-columns: 1fr; gap: 16px; }
    .prompt-hero { padding: 32px 16px 24px; }
    .prompt-hero__title { font-size: 26px; }
    .prompt-hero__subtitle { font-size: 14px; }
    .prompt-filter { gap: 6px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
    .prompt-filter__btn { font-size: 12px; padding: 7px 14px; }
    .prompt-card__actions,
    .prompt-card__actions--count-2,
    .prompt-card__actions--count-3 { grid-template-columns: 1fr; }
    .prompt-editorial { grid-template-columns: 1fr; gap: 24px; margin-top: 40px; }
    .prompt-editorial__main { padding: 28px 20px; }
    .prompt-editorial__main h2 { font-size: 23px; }
    .prompt-editorial__main h3 { font-size: 18px; margin-top: 28px; }
    .prompt-editorial__sidebar { position: static; }
}

/* ---------- Skeleton Loading ---------- */
.prompt-card--skeleton {
    pointer-events: none;
}

.prompt-card--skeleton .prompt-card__image,
.prompt-card--skeleton .prompt-card__category,
.prompt-card--skeleton .prompt-card__title,
.prompt-card--skeleton .prompt-card__desc,
.prompt-card--skeleton .prompt-card__preview,
.prompt-card--skeleton .prompt-card__btn {
    background: linear-gradient(90deg, var(--color-card-border) 25%, transparent 50%, var(--color-card-border) 75%);
    background-size: 200% 100%;
    animation: promptSkeleton 1.5s infinite;
    color: transparent !important;
    border-color: transparent !important;
}

.prompt-card--skeleton .prompt-card__image { height: 180px; }
.prompt-card--skeleton .prompt-card__category { width: 80px; height: 14px; border-radius: 4px; }
.prompt-card--skeleton .prompt-card__title { width: 70%; height: 20px; border-radius: 4px; }
.prompt-card--skeleton .prompt-card__desc { width: 90%; height: 32px; border-radius: 4px; }
.prompt-card--skeleton .prompt-card__preview { height: 56px; }

@keyframes promptSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
