/* دو حالت ابزار هوش مصنوعی (عکس / ویدیو) و صفحه ساخت ویدیو (/ai/video).
   رنگ‌ها و اجزای پایه (مرحله‌ها، کارت مدل، دکمه‌ها) از pm-generator.css می‌آیند */

/* ---------- تب‌های عکس / ویدیو ---------- */
.aim-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px;
    margin: 0 auto 18px;
    max-width: 520px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    direction: rtl;
}

.aim-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #64748b;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

    .aim-tab:hover {
        color: #0f172b;
        background: rgba(255, 255, 255, .6);
    }

    .aim-tab:focus-visible {
        outline: 2px solid #4f46e5;
        outline-offset: 2px;
    }

    .aim-tab.is-active {
        background: #fff;
        color: #0f172b;
        box-shadow: 0 1px 4px rgba(15, 23, 43, .12), 0 0 0 1.5px #4f46e5;
    }

.aim-tab-ico {
    font-size: 22px;
    line-height: 1;
}

.aim-tab-text {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    text-align: right;
}

    .aim-tab-text b {
        font-size: 15px;
    }

    .aim-tab-text small {
        font-size: 11px;
        color: #64748b;
    }

.aim-tab-new {
    position: absolute;
    top: -7px;
    left: 10px;
    font-style: normal;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 8px;
    border-radius: 999px;
    background: #00ac94;
    color: #fff;
}

@media (max-width: 420px) {
    .aim-tab {
        gap: 6px;
        padding: 9px 6px;
    }

    .aim-tab-text small {
        display: none;
    }
}

/* ---------- صفحه ساخت ویدیو ---------- */
.avg-source-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--pmg-line);
    border-radius: 14px;
    background: var(--pmg-soft);
}

    .avg-source-card img {
        width: 84px;
        height: 104px;
        object-fit: cover;
        border-radius: 10px;
        background: #e2e8f0;
        flex-shrink: 0;
    }

    .avg-source-card div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

.avg-input {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 12px 14px;
    border: 1px solid var(--pmg-line);
    border-radius: 14px;
    font: inherit;
    font-size: 14px;
    line-height: 1.9;
    color: var(--pmg-ink);
    background: #fff;
}

    .avg-input:focus {
        outline: none;
        border-color: var(--pmg-accent);
        box-shadow: 0 0 0 3px var(--pmg-accent-soft);
    }

.avg-ideas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.avg-idea {
    padding: 5px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: var(--pmg-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

    .avg-idea::before {
        content: "+ ";
    }

    .avg-idea:hover {
        color: var(--pmg-accent);
        border-color: var(--pmg-accent);
    }

/* هر مرحله کارت جدا؛ ظرف بیرونی فقط فاصله می‌دهد */
.pmg.avg {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

    .avg > .pmg-step,
    .avg > #avgLibrary > .pmg-step,
    .avg > .pmg-cta {
        background: #fff;
        border: 1px solid var(--pmg-line);
        border-radius: 20px;
        box-shadow: 0 8px 28px rgba(148, 163, 184, .12);
    }

    .avg > .pmg-cta {
        background: #fff;
        padding: 18px;
    }

    .avg .avg-preset {
        margin: 0;
    }

#avgOptions {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

    #avgOptions .pmg-out-group + .pmg-out-group {
        margin-top: 14px;
    }

    #avgOptions .pmg-seg {
        flex-wrap: wrap;
    }

    #avgOptions .pmg-seg-btn {
        flex: 1 1 80px;
    }

        #avgOptions .pmg-seg-btn:disabled {
            opacity: .45;
            cursor: not-allowed;
        }

    /* «۱۰ ثانیه» فارسی است؛ قانون ltr دکمه‌ها برای 720p است */
    #avgOptions .avg-durations .pmg-seg-btn b {
        direction: rtl;
    }

    /* قیمت هر مدت زیر خودش؛ برچسب شناور هزینه اضافه اینجا لازم نیست */
    #avgOptions .avg-durations .pmg-seg-btn em {
        position: static;
        margin-top: 3px;
        background: transparent;
        border: 0;
        padding: 0;
        color: var(--pmg-muted);
        font-weight: normal;
        font-size: 11px;
    }

    #avgOptions .avg-durations .pmg-seg-btn.is-selected em {
        color: var(--pmg-accent);
        font-weight: bold;
    }

@media (max-width: 480px) {
    .pmg.avg {
        gap: 10px;
    }

    .avg > .pmg-cta {
        padding: 14px;
    }
}

.avg-summary {
    font-size: 13px;
    color: var(--pmg-muted);
    text-align: center;
    direction: rtl;
    min-height: 1.5em;
}

#avgGenerate:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.avg-soon {
    padding: 36px 20px;
    text-align: center;
}

    .avg-soon span {
        font-size: 40px;
    }

    .avg-soon h2 {
        margin: 8px 0;
        font-size: 20px;
    }

    .avg-soon p {
        margin: 0;
        color: #64748b;
        line-height: 1.9;
    }

.avg-confirm-img {
    max-width: 140px;
    max-height: 180px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 8px;
}

.avg-confirm-note {
    font-size: 12px;
    color: #64748b;
}

/* با پرامپت ویدیویی آماده آمده (/ai/video?vp=...) */
.avg-preset {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 18px 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--pmg-accent-soft);
    border: 1px solid #c7d2fe;
}

    .avg-preset img {
        width: 56px;
        height: 70px;
        object-fit: cover;
        object-position: top;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .avg-preset b {
        display: block;
        font-size: 14px;
        margin-bottom: 4px;
    }

    .avg-preset p {
        margin: 0;
        font-size: 12.5px;
        line-height: 1.9;
        color: var(--pmg-muted);
    }

.avg-preset--need {
    background: #fff8eb;
    border-color: #fde7b0;
}

.avg-preset .avg-preset-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    margin-top: 8px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--pmg-ink);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
}

    .avg-preset .avg-preset-btn:hover {
        color: #fff;
        opacity: .92;
    }

.avg-samples {
    margin-top: 28px;
}
