/* --- پایه --- */
body {
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    font-family: "Tahoma", sans-serif;
}

/* --- فرم تولید تصویر (باکس ثابت) --- */
.hf8-container {
width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    position: relative;
    top: 0;
    z-index: 1000;
    background-color: rgb(0 0 0 / 63%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #ffffff26;
    border-radius: 13px;
}

/* تمام متن‌های داخل باکس تولید تصویر سفید شوند */
.hf8-container,
.hf8-container label,
.hf8-container input,
.hf8-container textarea,
.hf8-container select {
    color: #fff;
}

/* --- فیلدهای ورودی و انتخاب --- */
.hf8-container input[type="text"],
.hf8-container textarea,
.hf8-container select {
    background: rgba(0, 0, 0, 0.36); /* پس‌زمینه مشکی با 36% اوپاستی */
    color: #fff;
    border: 1px solid #ffffff14;    border-radius: 7px; /* گرد بودن لبه‌ها 7px */
    padding: 12px; /* پدینگ 12px از اطراف */
    box-sizing: border-box;
    font-size: 15px;
	margin: 6px 0 16px 0;
}

/* جلوگیری از تغییر ظاهر روی فوکوس */
.hf8-container input:focus,
.hf8-container textarea:focus,
.hf8-container select:focus {
    outline: none;
    box-shadow: none;
}

/* --- چینش دو فیلد انتخاب مدل و نسبت تصویر کنار هم --- */
.fields-row {
    display: flex;
    gap: 10px; /* فاصله مناسب بین فیلدها */
}
.fields-row > .model-selection-container,
.fields-row > .aspect-ratio-container {
    flex: 1;
}

/* سفارشی‌سازی منوی کشویی (select) */
.hf8-container select {
    -webkit-appearance: none;
    -moz-appearance: none;
appearance: none;
    background: rgba(0, 0, 0, 0.36) url(data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M0 0l6 6 6-6' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E) no-repeat 14px center;
    background-size: 8px 7px;
    padding-left: 40px;
}


/* --- دکمه‌ها --- */
.hf8-form button,
.hf8-form input[type="submit"] {
    padding: 10px 20px;
    font-size: 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.hf8-form button:hover,
.hf8-form input[type="submit"]:hover {
    background: #005a87;
}

/* --- لودینگ --- */
.hf8-loading {
    display: none;
    margin: 20px auto;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0,115,170,0.2);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- نتایج تولید --- */
#hf8-results-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}
.ai-results-row {
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.ai-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ai-image-item {
    position: relative;
    cursor: pointer;
}
.ai-image-item img {
    max-width: 150px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}
.ai-image-item:hover img {
    transform: scale(1.05);
}
.download-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.5);
    padding: 5px;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    display: none;
}
.ai-prompt-panel {
    flex: 1;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ai-prompt-panel p.generated-prompt-text {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    direction: ltr; /* پرامپت انگلیسی چپ‌چین */
    text-align: left;
    color: #333;
}
.ai-prompt-panel button.create-again-btn {
    margin-top: 10px;
    padding: 8px 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.ai-prompt-panel button.create-again-btn:hover {
    background: #1e7e34;
}

#hf8-simple-prompt{
	margin-bottom: 5px !important;
}

/* --- مدال (Lightbox) --- */
.ai-image-modal {
    display: none; /* پیشفرض مخفی */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}
.ai-modal-content {
    position: relative;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.ai-modal-content img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}
#download-image {
    display: none;
}
.ai-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}
.ai-modal-close:hover,
.ai-modal-close:focus {
    color: #000;
}
.fields-row {
    display: flex;
    gap: 10px;
}
.fields-row > div {
    flex: 1;
}
