/* خود ظرف اصلی کارت‌ها (الان شامل چند سکشن میشه) */
.ai-content-text-box-cards {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* هر سکشن (عنوان + گرید کارت‌های خودش) */
.ai-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-section-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* گرید کارت‌ها داخل هر سکشن */
.ai-section-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* ✅ سه ستون مساوی و فول‌عرض */
    gap: 24px;
}


.ai-content-text-box-card {
    position: relative;
    width: 276px;
    height: 134px;
    background: var(--color-light);
    display: flex;
    gap: 12px;
    border: 2px solid var(--color-border);
    padding: var(--p-10);
    border-radius: var(--br-20);
    z-index: 1;
    overflow: visible;
    transition: 0.3s ease-in-out;
}
.ai-content-text-box-card {
    width: 100%;           /* ✅ کارت کل ستون خودش رو پر کنه */
    box-sizing: border-box;
}

.ai-content-text-box-card:hover,
.ai-content-text-box-card.selected {
    background: var(--color-scondary);
    border: 2px solid var(--color-scondary);
}


.ai-content-text-box-card-image img {
    border-radius: var(--br-16);
    border: 2px solid var(--color-light);
    box-sizing: border-box;
}

.ai-content-text-box-card:hover .ai-content-text-box-card-image img,
.ai-content-text-box-card.selected .ai-content-text-box-card-image img {
    border: 2px solid var(--color-primary);
}


.ai-content-text-box-card-items {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 0;
    width: 100%;
    justify-content: space-between;
}

.ai-content-text-box-card-title h3 {
    font-size: var(--t-18);
}

.ai-content-text-box-card:hover .ai-content-text-box-card-title h3,
.ai-content-text-box-card.selected .ai-content-text-box-card-title h3 {
    /*color: var(--color-primary);*/
}


.ai-content-text-box-card-title span {
    font-size: var(--t-14);
    color: var(--color-small);
    line-height: 20px;
}
.ai-content-text-box-card:hover .ai-content-text-box-card-title span,
.ai-content-text-box-card.selected .ai-content-text-box-card-title span {
    /*color: var(--color-tertiary);*/
}


.ai-content-text-box-card-button {
    display: flex;
    justify-content: end;
    align-items: center;
}

.ai-content-text-box-card-button button {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 4px 26px;
    border-radius: var(--br-12);
    background: var(--color-scondary);
    font-family: 'yekanbakh';
    font-size: var(--t-15);
    transition: 0.3s ease-in-out;
}

.ai-content-text-box-card:hover .ai-content-text-box-card-button button,
.ai-content-text-box-card.selected .ai-content-text-box-card-button button {
    background: var(--color-primary);
    color: var(--color-scondary);
}

.ai-text-content-input {
    width: 100%;
    max-width: 100%;
    color: #fff;
}

.ai-text-content-input * {
    box-sizing: border-box;
    user-select: none;
}

.ai-text-content-input .field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #ffffff;
}

.ai-text-content-input .text-input {
    width: 100%;
    background-color: #170F2B;
    border: 1px solid #332262;
    border-radius: var(--br-16);
    padding: 15px;
    color: #ccc;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    outline: none;
    height: 60px;
    transition: border-color 0.3s;
}

.ai-text-content-input .text-input:focus {
    border-color: #6c5ce7;
}

.dropdowns-row {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.dropdown-group {
    flex: 1;
    position: relative;
}

.custom-select-wrapper {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    background-color: #170F2B;
    border: 1px solid #332262;
    border-radius: var(--br-16);
    padding: 12px 15px;
    color: #ccc;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    height: 60px;
}

.custom-select-wrapper:hover .custom-select-trigger {
    border-color: #4a3b75;
}

.arrow {
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    transition: transform 0.3s;
    margin-right: 10px;
}

.custom-options {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: #1f1635;
    border: 1px solid #2e2550;
    border-radius: var(--br-16);
    margin-top: 5px;
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.custom-option {
    padding: 15px 15px;
    color: #8e7eb2;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-bottom: 1px solid #2e2550;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: var(--color-light);
    color: #fff;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: #6c5ce7;
    color: #fff;
}

.custom-select-wrapper.open .arrow {
    transform: rotate(135deg)
}

@media (max-width: 768px) {
    .dropdowns-row {
        flex-direction: column;
    }
}

.ai-content-box-generate-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.ai-content-box-generate-items .credit-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.ai-content-box-generate-items .credit-info img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.ai-content-box-generate-items .generate-btn {
    background-color: #ffcd1f;
    color: #231b46;
    border: none;
    border-radius: 16px;
    padding: 10px 40px;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s;
}

.ai-content-box-generate-items .generate-btn:hover {
    background-color: #e6b81c;
}

.credit-info-text {
    font-size: 16px;
    font-weight: 400;
}

.credit-info-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-scondary);
}

.ai-generate-alert {
    background-color: #EBE6FC;
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    direction: rtl;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #352859;
}

.alert-text {
    font-size: 16px;
    font-weight: 400;
}

.alert-icon {
    stroke: #352859;
    width: 20px;
    height: 20px;
}

.alert-actions {
    display: flex;
    gap: 10px;
}

.ai-generate-alert button {
    font-family: 'yekanbakh', sans-serif;
    font-size: 16px;
    padding: 8px 28px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    font-weight: 500;
    width: 130px;
    transition: 0.3s ease-in-out;
}

.btn-download {
    background-color: var(--color-primary);
    color: #ffffff;
    border: 2px solid var(--color-primary) !important;
}

.btn-view {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary) !important;
}


.btn-download:hover {
    background-color: var(--color-scondary);
    color: var(--color-primary);
    border: 2px solid var(--color-scondary) !important;
}

.btn-view:hover {
    background-color: var(--color-scondary);
    color: var(--color-primary);
    border: 2px solid var(--color-scondary) !important;
}


@media only screen and (max-width: 767px) {
    .ai-section-cards {
        grid-template-columns: repeat(2, auto);
        justify-content: space-around;
    }
}

@media only screen and (max-width: 480px) {
    .ai-section-cards {
        grid-template-columns: auto;
        justify-content: stretch;
    }

    .ai-content-text-box-card {
        width: 100%;
    }
}

/* در دسکتاپ: هر سکشن فقط ۴ کارت اول رو نشون بده */
@media only screen and (min-width: 993px) {
    /* تا وقتی expanded نباشه: فقط سه کارت اول دیده می‌شن */
    .ai-section-cards:not(.expanded) .ai-content-text-box-card:nth-child(n+4) {
        /*display: none;*/
    }

    /* وقتی روی "مشاهده بیشتر" کلیک شد */
    .ai-section-cards.expanded .ai-content-text-box-card {
        /*display: flex;*/
    }
}

.show-more-btn {
    margin: 8px;
    align-self: flex-start;
    border: none;
    background-color: #170F2B;
    color: #ffffff;
    border-radius: 12px;
    padding: 6px 24px;
    font-family: 'yekanbakh', sans-serif;  /* ✅ مثل بقیه دکمه‌ها */
    font-size: var(--t-15);                /* یا 14px اگر خواستی */
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #332262;
    transition: 0.3s ease-in-out;
}

.show-more-btn:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-scondary);
}
.ai-text-content-input textarea.text-input {
    height: 140px;    /* ارتفاع بیشتر برای چند خط */
    resize: vertical; /* کاربر بتونه از پایین بلندترش کنه */
    line-height: 1.7;
}
