/* ═══════════════════════════════════════════════════════════
   PROMPTS — Prompt Kütüphanesi Modülü Özel Stilleri
   Prefix: pr-
   ═══════════════════════════════════════════════════════════ */

.pr-card-text {
    max-width: 420px;
    font-size: 13px;
    color: var(--rbn-gray-700);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    font-family: var(--rbn-font);
}

.pr-code-preview {
    background: var(--rbn-gray-50);
    border: 1px solid var(--rbn-gray-200);
    border-radius: var(--rbn-radius-sm);
    padding: 12px 14px;
    font-size: 12px;
    color: var(--rbn-black);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.pr-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--rbn-gray-500);
}

.pr-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pr-tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--rbn-gray-100);
    border-radius: var(--rbn-radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--rbn-gray-800);
}

.pr-form-errors {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--color-danger-border);
    border-radius: var(--rbn-radius-sm);
    color: var(--color-danger);
    background: var(--color-danger-soft);
    font-size: 12px;
}

.pr-auto-publish-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid var(--rbn-gray-200);
    border-radius: var(--rbn-radius-sm);
    background: var(--rbn-gray-50);
    font-size: 12px;
}

.pr-auto-publish-note i {
    color: var(--rbn-success);
    font-size: 16px;
}

.pr-auto-publish-note strong,
.pr-auto-publish-note span {
    display: block;
}

.pr-auto-publish-note span {
    margin-top: 2px;
    color: var(--rbn-gray-500);
}

.pr-form-errors ul {
    margin: 8px 0 0 20px;
}

.pr-template-builder {
    padding: 18px;
    border: 1px solid var(--rbn-gray-200);
    border-radius: var(--rbn-radius-sm);
    background: var(--rbn-gray-50);
}

.pr-template-builder__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.pr-template-builder__heading p {
    margin-top: 4px;
}

.pr-template-builder code {
    color: var(--rbn-black);
}

.pr-template-fields {
    display: grid;
    gap: 9px;
}

.pr-template-field {
    display: grid;
    grid-template-columns: minmax(140px, .8fr) minmax(180px, 1.2fr) minmax(140px, .8fr) 82px;
    gap: 8px;
    align-items: center;
}

.pr-template-field__actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

/* Delete / Action Modal */
.pr-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-backdrop-strong);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: rbn-fadeIn 0.2s ease;
}

.pr-modal-overlay.active {
    display: flex;
}

.pr-modal {
    background: var(--rbn-white);
    border-radius: var(--rbn-radius-lg);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--rbn-shadow-lg);
    animation: rbn-slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pr-modal__body {
    padding: 24px;
    text-align: center;
}

.pr-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--color-danger-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--rbn-danger);
}

.pr-modal__footer {
    padding: 16px 24px;
    border-top: 1px solid var(--rbn-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--rbn-gray-50);
    border-radius: 0 0 var(--rbn-radius-lg) var(--rbn-radius-lg);
}

/* Responsive */
@media (max-width: 1024px) {
    #prompts-table {
        min-width: 850px;
    }
}

@media (max-width: 768px) {
    .pr-card-text {
        max-width: 260px;
    }

    .pr-template-builder__heading,
    .pr-template-field {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pr-template-field__actions {
        justify-content: flex-start;
    }
}

/* ═══════════════════════════════════════════════════════════
   FRONTEND: PROMPT HUB & STUDIO STYLES
   ═══════════════════════════════════════════════════════════ */
/* ── PROMPT HUB & STUDIO STYLES ──────────────────── */
.prompt-hub-toolbar {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-category-pills-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.prompt-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-out);
}

.prompt-pill:hover {
    color: var(--color-text);
    border-color: var(--color-border-hover);
    background: var(--color-surface-subtle);
}

.prompt-pill.is-active {
    color: var(--color-on-brand);
    background: var(--color-brand);
    border-color: var(--color-brand);
    box-shadow: var(--shadow-sm);
}

.prompt-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.prompt-search-form {
    position: relative;
    flex: 1 1 240px;
    max-width: 360px;
}

.prompt-search-input {
    width: 100%;
    height: 38px;
    padding: 6px 36px 6px 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.84rem;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.prompt-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.prompt-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

@keyframes promptSearchSpin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.prompt-search-form.is-loading .prompt-search-icon {
    animation: promptSearchSpin 0.75s linear infinite;
    color: var(--color-brand);
}

.prompt-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.prompt-search-clear:hover {
    color: var(--color-text);
}

.prompt-hub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
    gap: 28px;
    align-items: start;
}

.prompt-hub-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Prompt Studio Card */
.prompt-studio-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.prompt-studio-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.prompt-studio-card.is-active {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 2px var(--color-brand-border-soft), var(--shadow-md);
    background: var(--color-surface);
}

.prompt-studio-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.prompt-studio-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.prompt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
}

.prompt-badge--tool {
    background: var(--color-surface-subtle);
    color: var(--color-brand-strong);
    border: 1px solid var(--color-border);
}

.prompt-badge--cat {
    background: var(--color-brand-soft);
    color: var(--color-brand-strong);
}

.prompt-badge--lang {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

.prompt-badge--template {
    background: var(--color-brand-soft);
    color: var(--color-brand-strong);
    border: 1px solid var(--color-brand-border-soft);
}

.prompt-badge--featured {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.prompt-studio-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
    color: var(--color-text);
}

.prompt-studio-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast);
}

.prompt-studio-card__title a:hover {
    color: var(--color-brand);
}

.prompt-studio-card__purpose {
    font-size: 0.84rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.prompt-studio-card__preview {
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--color-text);
    margin-bottom: 14px;
    max-height: 90px;
    overflow: hidden;
    position: relative;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompt-studio-card__preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(transparent, var(--color-surface-subtle));
    pointer-events: none;
}

.prompt-variable-tag {
    background: var(--color-brand-soft-strong);
    color: var(--color-brand-strong);
    border: 1px solid var(--color-brand-border);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.prompt-studio-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.prompt-studio-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-studio-card__actions .reddit-action-btn,
.prompt-studio-card__actions .btn-select-prompt,
.prompt-studio-card__actions .btn-copy {
    background: transparent;
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    min-height: auto;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: color var(--duration-fast), transform var(--duration-fast);
}

.prompt-studio-card__actions .reddit-action-btn:hover,
.prompt-studio-card__actions .reddit-action-btn:focus-visible,
.prompt-studio-card__actions .btn-select-prompt:hover,
.prompt-studio-card__actions .btn-select-prompt:focus-visible,
.prompt-studio-card__actions .btn-copy:hover,
.prompt-studio-card__actions .btn-copy:focus-visible {
    background: transparent;
    box-shadow: none;
    color: var(--color-text);
}

.prompt-studio-card__actions .btn-select-prompt.is-active,
.prompt-studio-card__actions .btn-select-prompt:hover {
    color: var(--color-brand);
    font-weight: 700;
}

.prompt-studio-card__actions .btn-copy.copied,
.prompt-studio-card__actions .btn-copy.copied:hover,
.prompt-studio-card__actions .btn-copy.copied:focus-visible {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--color-success) !important;
}

.prompt-studio-card__stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.prompt-studio-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ── STICKY WORKBENCH (RIGHT COLUMN) ──────────────────── */
.prompt-workbench-col {
    position: sticky;
    top: 84px;
    align-self: start;
}

.prompt-workbench {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.prompt-workbench__header {
    flex-shrink: 0;
    margin-bottom: 10px;
}

.prompt-workbench__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-brand);
    margin-bottom: 6px;
}

.prompt-workbench__title {
    font-size: 1.2rem;
    font-weight: 750;
    line-height: 1.3;
    color: var(--color-text);
    margin: 0 0 6px;
}

.prompt-workbench__desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
}

.prompt-workbench__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.prompt-workbench__section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prompt-workbench__vars-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.prompt-workbench__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.prompt-workbench__field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prompt-workbench__input {
    width: 100%;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: 0.78rem;
    line-height: 1.35;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
}

.prompt-workbench__input:focus {
    outline: none;
    border-color: var(--color-brand);
    background: var(--color-surface);
    box-shadow: 0 0 0 2px var(--color-focus-ring);
}

.prompt-workbench__preview-box {
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--color-text);
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
    user-select: text;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.prompt-workbench__footer {
    flex-shrink: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.prompt-workbench__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-workbench__actions .btn-yz {
    padding: 7px 12px;
    font-size: 0.82rem;
    justify-content: center;
}

.prompt-workbench__tip {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* Minimal Custom Scrollbars */
.prompt-workbench__body::-webkit-scrollbar,
.prompt-workbench__preview-box::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.prompt-workbench__body::-webkit-scrollbar-track,
.prompt-workbench__preview-box::-webkit-scrollbar-track {
    background: transparent;
}

.prompt-workbench__body::-webkit-scrollbar-thumb,
.prompt-workbench__preview-box::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.prompt-workbench__body::-webkit-scrollbar-thumb:hover,
.prompt-workbench__preview-box::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

@media (max-width: 991px) {
    .prompt-hub-layout {
        grid-template-columns: 1fr;
    }

    .prompt-workbench-col {
        position: static;
    }

    .prompt-workbench {
        max-height: none;
    }

    .prompt-workbench__body {
        max-height: 480px;
    }
}
