/* ═══════════════════════════════════════════════════════════════
   stp-creative.css — لایه ۴: چالش خلاق + بانک ایده + ذهن‌آزمای
   ═══════════════════════════════════════════════════════════════ */

/* ── مشترک ────────────────────────────────────────────────────── */
.stp-challenges-wrap,
.stp-oq-wrap,
.stp-ideabank-wrap,
.stp-winner-widget {
    direction: rtl;
    font-family: inherit;
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 0;
}

/* ── هدر بخش ─────────────────────────────────────────────────── */
.stp-cr-header,
.stp-oq-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.stp-cr-icon,
.stp-oq-icon {
    font-size: 28px;
    line-height: 1;
}

.stp-cr-title,
.stp-oq-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.stp-cr-intro,
.stp-oq-intro {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

/* ── کارت چالش ───────────────────────────────────────────────── */
.stp-challenge-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: border-color .2s;
}

.stp-challenge-card.stp-challenge--done {
    background: #f9fef9;
    border-color: #a5d6a7;
}

.stp-ch-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.stp-ch-type-badge {
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 10px;
    border-radius: 20px;
}

.stp-rw-badge {
    font-size: 12px;
    background: #fff8e1;
    color: #f57f17;
    padding: 2px 10px;
    border-radius: 20px;
}

.stp-ch-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
}

.stp-ch-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.65;
}

/* ── فرم چالش ────────────────────────────────────────────────── */
.stp-ch-text,
.stp-oq-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    direction: rtl;
    box-sizing: border-box;
    transition: border-color .15s;
}

.stp-ch-text:focus,
.stp-oq-text:focus {
    outline: none;
    border-color: #2e7d32;
}

/* ── ردیف رسانه ──────────────────────────────────────────────── */
.stp-ch-media-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.stp-record-btn,
.stp-upload-label {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
    user-select: none;
}

.stp-record-btn:hover,
.stp-upload-label:hover { background: #e8e8e8; }

.stp-record-btn.stp-recording {
    background: #ffebee;
    border-color: #e53935;
    color: #c62828;
    animation: stp-pulse 1s infinite;
}

@keyframes stp-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: .6; }
}

/* ── جعبه AI ─────────────────────────────────────────────────── */
.stp-ai-box {
    background: #f0f4ff;
    border: 1px solid #c5cae9;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0;
}

.stp-ai-hint {
    margin: 0 0 8px;
    font-size: 13px;
    color: #3949ab;
}

.stp-ai-prompt {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c5cae9;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    direction: rtl;
    box-sizing: border-box;
    margin-bottom: 8px;
    background: #fff;
}

/* ── دکمه ارسال ──────────────────────────────────────────────── */
.stp-ch-submit-btn,
.stp-oq-submit-btn {
    margin-top: 10px;
    padding: 8px 22px;
    background: #1b5e20;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.stp-ch-submit-btn:hover,
.stp-oq-submit-btn:hover  { background: #2e7d32; }

.stp-ch-submit-btn:disabled,
.stp-oq-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.stp-ch-status,
.stp-oq-status { font-size: 12px; margin-top: 6px; min-height: 18px; }

.stp-status--ok    { color: #2e7d32; }
.stp-status--error { color: #c62828; }
.stp-uploading     { color: #1565c0; font-size: 12px; }
.stp-cr-error      { color: #c62828; font-size: 12px; }

/* ── پاسخ قبلی ───────────────────────────────────────────────── */
.stp-ch-submitted {
    padding: 10px 0;
}

.stp-ch-prev-text {
    font-size: 14px;
    color: #222;
    line-height: 1.7;
    margin: 0 0 10px;
}

.stp-ch-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.stp-coach-note {
    width: 100%;
    margin-top: 8px;
    font-size: 13px;
    color: #1b5e20;
    background: #e8f5e9;
    border-right: 3px solid #66bb6a;
    border-radius: 4px;
    padding: 8px 12px;
}

.stp-edit-sub-btn {
    font-size: 12px;
    background: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 3px 10px;
    cursor: pointer;
    color: #666;
}

/* ── Badge ────────────────────────────────────────────────────── */
.stp-badge {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.stp-badge--green  { background: #dcfce7; color: #15803d; }
.stp-badge--amber  { background: #fef9c3; color: #92400e; }
.stp-badge--gold   { background: #fef9c3; color: #d97706; border: 1px solid #fde68a; }
.stp-badge--purple { background: #f3e8ff; color: #7c3aed; }

/* ── رسانه ────────────────────────────────────────────────────── */
.stp-media-player {
    width: 100%;
    max-width: 360px;
    border-radius: 6px;
    display: block;
    margin: 8px 0;
}

.stp-media-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    object-fit: cover;
    margin: 8px 0;
    display: block;
}

/* ── ذهن‌آزمای ────────────────────────────────────────────────── */
.stp-oq-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.stp-oq-question {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.6;
}

.stp-oq-hint {
    font-size: 13px;
    color: #555;
    background: #fff8e1;
    border-right: 3px solid #ffb300;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 0 0 10px;
}

.stp-oq-privacy {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* ── پاسخ‌های اشتراکی ────────────────────────────────────────── */
.stp-oq-shared {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.stp-oq-shared h4 {
    font-size: 14px;
    margin: 0 0 10px;
}

.stp-shared-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.stp-shared-q {
    font-size: 12px;
    color: #888;
    margin: 0 0 4px;
    font-style: italic;
}

.stp-shared-r {
    font-size: 13px;
    color: #222;
    line-height: 1.65;
    margin: 0;
}

/* ── بانک ایده ───────────────────────────────────────────────── */
.stp-ib-header {
    margin-bottom: 12px;
}

.stp-ib-header h3 {
    font-size: 18px;
    margin: 0 0 4px;
    color: #1a1a1a;
}

.stp-ib-header p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* ── تب ماه‌ها ────────────────────────────────────────────────── */
.stp-ib-months {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.stp-month-tab {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    color: #555;
    text-decoration: none;
    transition: background .15s;
}

.stp-month-tab:hover { background: #e8e8e8; }
.stp-month-tab.active {
    background: #1b5e20;
    color: #fff;
    border-color: #1b5e20;
}

/* ── گرید ایده‌ها ─────────────────────────────────────────────── */
.stp-ib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stp-idea-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}

.stp-idea-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.stp-idea-card.stp-idea--featured {
    border-color: #f9a825;
    box-shadow: 0 0 0 2px #fde68a;
}

.stp-featured-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px;
    background: #f9a825;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.stp-idea-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.stp-idea-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stp-idea-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.4;
}

.stp-idea-preview {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.stp-idea-audio {
    width: 100%;
    max-width: 200px;
}

.stp-idea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}

.stp-idea-author {
    font-size: 12px;
    color: #888;
}

.stp-idea-room {
    color: #bbb;
}

.stp-vote-btn {
    background: #fff0f3;
    border: 1px solid #f9a8d4;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #be185d;
    transition: background .15s;
    white-space: nowrap;
}

.stp-vote-btn:hover:not([disabled]) {
    background: #fce7f3;
}

.stp-vote-btn.stp-voted,
.stp-vote-btn[disabled] {
    background: #fce7f3;
    border-color: #f472b6;
    color: #be185d;
    cursor: default;
    opacity: .7;
}

.stp-ib-empty {
    text-align: center;
    color: #bbb;
    padding: 32px;
    font-size: 14px;
}

/* ── صفحه‌بندی ────────────────────────────────────────────────── */
.stp-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.stp-page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background .15s;
}

.stp-page-btn:hover  { background: #f5f5f5; }
.stp-page-btn.active { background: #1b5e20; color: #fff; border-color: #1b5e20; }

/* ── برترین ایده ماه ─────────────────────────────────────────── */
.stp-winner-widget {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    text-align: center;
}

.stp-winner-crown { font-size: 40px; margin-bottom: 6px; }

.stp-winner-label {
    font-size: 12px;
    opacity: .75;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stp-winner-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.stp-winner-preview {
    font-size: 13px;
    opacity: .85;
    line-height: 1.65;
    margin: 0 0 10px;
}

.stp-winner-meta {
    font-size: 13px;
    opacity: .8;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stp-winner-votes { color: #ffcdd2; }

/* ── Toast ────────────────────────────────────────────────────── */
.stp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1b5e20;
    color: #fff;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13px;
    direction: rtl;
    z-index: 99999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
}

.stp-toast--visible { opacity: 1; transform: translateY(0); }

/* ── Notice ───────────────────────────────────────────────────── */
.stp-cr-notice {
    background: #fff3e0;
    border-right: 4px solid #ff9800;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #e65100;
    direction: rtl;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .stp-ib-grid { grid-template-columns: 1fr; }
    .stp-toast   { right: 12px; left: 12px; max-width: none; }
}
