/* База промтов — страница «Идеи» */

.prompts-section {
    padding: 40px 0 60px;
    min-height: 60vh;
}

.prompts-page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color, #1a1a1a);
    margin-bottom: 12px;
}

.prompts-page-description {
    font-size: 16px;
    color: var(--text-secondary, #666);
    margin-bottom: 28px;
    max-width: 640px;
}

/* Категории */
.prompts-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.prompts-categories .prompts-cat-btn {
    padding: 10px 18px;
    border-radius: 24px;
    border: 1px solid var(--border-color, #e5e5e5);
    background: var(--bg-color, #fff);
    color: var(--text-color, #1a1a1a);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.prompts-categories .prompts-cat-btn:hover {
    border-color: var(--primary-color, #3390ec);
    color: var(--primary-color, #3390ec);
}

.prompts-categories .prompts-cat-btn.active {
    background: #FFE135;
    border-color: #FFE135;
    color: #000;
}

/* Сетка карточек */
.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.prompts-grid .prompt-card {
    background: var(--bg-color, #fff);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color, #e5e5e5);
}

.prompts-grid .prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover, 0 4px 16px rgba(0, 0, 0, 0.12));
}

.prompts-grid .prompt-thumbnail-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-light, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.prompts-grid .prompt-thumbnail-placeholder {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    background: var(--bg-light, #f8f9fa);
}
.prompts-grid .prompt-thumbnail-placeholder.show {
    display: flex !important;
}

.prompts-grid .prompt-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prompts-grid .prompt-card-body {
    padding: 16px;
}

.prompts-grid .prompt-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color, #1a1a1a);
    margin-bottom: 6px;
}

.prompts-grid .prompt-card-category {
    font-size: 12px;
    color: var(--primary-color, #3390ec);
    margin-bottom: 8px;
}

.prompts-grid .prompt-card-desc {
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.45;
}

.prompts-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary, #666);
    font-size: 16px;
}

/* Модальное окно */
.prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.prompt-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.prompt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.prompt-modal-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-color, #fff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.prompt-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 0;
}

.prompt-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color, #1a1a1a);
    margin: 0;
    flex: 1;
}

.prompt-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-light, #f8f9fa);
    color: var(--text-secondary, #666);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.prompt-modal-close:hover {
    background: var(--border-color, #e5e5e5);
}

.prompt-modal-body {
    padding: 16px 20px;
}

.prompt-modal-image-wrap {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light, #f8f9fa);
}

.prompt-modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.prompt-modal-meta {
    margin-bottom: 12px;
}

.prompt-modal-category {
    font-size: 13px;
    color: var(--primary-color, #3390ec);
    font-weight: 500;
}

.prompt-modal-description-wrap {
    margin-bottom: 16px;
}

.prompt-modal-description {
    font-size: 14px;
    color: var(--text-secondary, #666);
    line-height: 1.5;
    margin: 0;
}

.prompt-modal-prompt-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    margin-bottom: 8px;
}

.prompt-modal-prompt-text {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color, #1a1a1a);
    margin: 0;
    padding: 14px;
    background: var(--bg-light, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e5e5e5);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow: auto;
}

.prompt-modal-actions {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-color, #e5e5e5);
}

.prompt-modal-actions .copy-prompt-btn {
    width: 100%;
    padding: 14px 24px;
}

@media (max-width: 768px) {
    .prompts-page-title {
        font-size: 26px;
    }
    .prompts-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .prompts-grid .prompt-card-body {
        padding: 12px;
    }
    .prompts-grid .prompt-card-title {
        font-size: 14px;
    }
}
