/* کلیات */
#fd-dashboard {
    font-family: tahoma, yekan, sans-serif;
    background: #f7f9fc;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.fd-popup {
  z-index: 99999 !important;
}

.fd-popup * {
  z-index: inherit;
}
#fd-save-product, #fd-close-popup {
  position: relative;
  z-index: 100000 !important;
}




/* هدر */
.fd-header {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    text-align: center;
}
.fd-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: #333;
}

/* فرم ورود */
.fd-login-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
#fd-login-form {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}
#fd-login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}
.fd-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}
.fd-btn:hover {
    background: #005f8d;
}

/* لیست محصولات */
.fd-product-list {
    margin-top: 20px;
}
.fd-loading {
    text-align: center;
    color: #666;
}

/* گرید محصولات */
.fd-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.fd-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}
.fd-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.fd-product-card img {
    max-width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}
.fd-title {
    font-size: 1rem;
    margin: 10px 0;
    color: #222;
}
.fd-price {
    color: #0073aa;
    font-weight: bold;
    font-size: 14px;
}


.fd-btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    margin: 2px;
}




/* ================= ابزارک و دکمه ها ================= */
#fd-toolbar {
    margin-bottom: 15px;
}
#fd-toolbar .fd-btn {
    background: #0d6efd;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    margin-left: 5px;
    cursor: pointer;
}

/* ================= پاپ‌آپ محصول ================= */
#fd-product-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    padding: 20px;
    z-index: 999999; /* بالاتر از سایر لایه‌ها */
    max-width: 600px;
    width: 95%;
    overflow-y: auto;
    max-height: 90vh; /* دسکتاپ */
}

/* ================= موبایل ================= */
@media (max-width: 768px) {
    #fd-product-popup {
        top: 50% !important; /* وسط دقیق */
        left: 50%;
        transform: translate(-50%, -50%) !important; /* وسط دقیق */
        max-height: 95vh; /* ارتفاع بیشتر و نزدیک به کل صفحه */
        width: 95%;
        padding: 15px;
    }
}


#fd-product-popup form input,
#fd-product-popup form textarea {
    width:100%;
    margin:8px 0;
    padding:8px;
    border:1px solid #ccc;
    border-radius:5px;
}
#fd-close-popup {
    background:#dc3545;
    color:#fff;
    border:none;
    padding:8px 15px;
    border-radius:6px;
    margin-top:10px;
    cursor:pointer;
}


/* =================== دسته‌بندی‌ها (چندتایی) =================== */
/* کانتینر select */
#fd-cats {
    width: 100%;                  /* پر کردن عرض والد */
    padding: 8px 10px;            /* فاصله داخلی */
    border: 1px solid #ccc;       /* حاشیه خاکستری */
    border-radius: 6px;           /* گوشه‌های گرد */
    font-size: 14px;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
    cursor: pointer;
}

/* حالت انتخاب چندتایی */
#fd-cats[multiple] {
    height: 120px;                /* ارتفاع مناسب برای مشاهده چند گزینه */
    overflow-y: auto;             /* اسکرول عمودی اگر گزینه‌ها زیاد باشد */
}

/* گزینه‌های داخل select */
#fd-cats option {
    padding: 4px 6px;             /* فاصله داخلی گزینه‌ها */
    font-size: 14px;
}

/* هایلایت گزینه انتخاب شده */
#fd-cats option:checked {
    background-color: #0d6efd;    /* رنگ پس زمینه آبی */
    color: #fff;                  /* متن سفید */
}

/* واکنشگرا برای موبایل */
@media (max-width: 768px) {
    #fd-cats[multiple] {
        height: 100px;            /* کاهش ارتفاع در موبایل */
    }
}

@media (max-width: 480px) {
    #fd-cats[multiple] {
        height: 80px;             /* ارتفاع کمتر در گوشی */
    }
}

/* حاشیه و فواصل فرم برای زیبایی */
#fd-product-form label[for="fd-cats"],
#fd-product-form select#fd-cats {
    margin-top: 10px;
    margin-bottom: 8px;
    display: block;
}

/* افزودن افکت hover برای گزینه‌ها */
#fd-cats option:hover {
    background-color: #e9f2ff;
    color: #0d6efd;
}




/* ========== استایل لیست دسته‌بندی چندتایی ========== */
.fd-cat-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.fd-cat-item label { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #e6e6e6;
    padding:6px 8px; border-radius:8px; cursor:pointer; user-select:none; font-size:14px;
}
.fd-cat-item input[type="checkbox"] { width:18px; height:18px; }
.fd-cat-item .fd-cat-name { white-space:nowrap; }

/* واکنشگرا: در موبایل هر آیتم عرض کامل بگیرد (اختیاری) */
@media (max-width:480px){
    .fd-cat-item { flex: 1 1 100%; }
}


#fd-featured-preview img { max-width: 100%; display:block; margin-bottom:6px; }
#fd-gallery-preview img { cursor: pointer; border: 2px solid transparent; }
#fd-gallery-preview img.selected { border-color: #0d6efd; }





.fd-img-wrap {
    position: relative;
    display: inline-block;
}
.fd-img-wrap img {
    display: block;
}
.fd-remove-img {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
}



/* ================= Snackbar و نوار پیشرفت ================= */
#fd-snackbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 99999;
  display: inline-block;
  min-width: 220px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity .25s, bottom .25s;
}
#fd-snackbar.show { opacity: 1; bottom: 36px; }
#fd-snackbar.success { background: #198754; }
#fd-snackbar.error { background: #d63384; }
#fd-snackbar.info { background: #0d6efd; }

#fd-snackbar #fd-snackbar-msg { font-size: 14px; margin-bottom: 8px; }

/* progress wrap */
#fd-progress-wrap { width: 220px; height: 6px; background: rgba(255,255,255,0.12); border-radius: 6px; overflow:hidden; margin: 0 auto; display:block; }
#fd-progress-bar { width: 0%; height:6px; background: rgba(255,255,255,0.95); transition: width .25s linear; opacity: 0; }

/* در موبایل اندازه را کمی کوچک‌تر کن */
@media (max-width:480px){
  #fd-snackbar { min-width: 180px; width: 90%; left: 50%; transform: translateX(-50%); }
  #fd-progress-wrap { width: calc(100% - 40px); }
}




/* ---------- SEO analyzer (پاپ‌آپ) ---------- */
.fd-seo-analyzer { font-family: Tahoma, sans-serif; margin-top:10px; }
.fd-seo-analyzer h4 { margin:0 0 8px 0; font-size:14px; }
.fd-seo-score { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
#fd-seo-score-circle {
  width:18px; height:18px; border-radius:50%;
  background:#cfcfcf; display:inline-block; transition:background-color .25s ease, box-shadow .25s ease;
  box-shadow: none;
}
#fd-seo-score-circle.fd-seo-good { background:#27ae60 !important; box-shadow:0 0 6px rgba(39,174,96,0.25); }
#fd-seo-score-circle.fd-seo-medium { background:#f39c12 !important; box-shadow:0 0 6px rgba(243,156,18,0.25); }
#fd-seo-score-circle.fd-seo-bad { background:#e74c3c !important; box-shadow:0 0 6px rgba(231,76,60,0.25); }
#fd-seo-score-text { font-size:13px; color:#333; }

/* checklist */
#fd-seo-checklist { margin:6px 0 0 0; padding-left:18px; color:#666; font-size:13px; }
#fd-seo-checklist li { position:relative; margin:6px 0; padding-left:18px; }
#fd-seo-checklist li::before {
  content: "•";
  position:absolute; left:0; top:0; color:#999; font-weight:bold;
  line-height:1;
}
/* passed */
#fd-seo-checklist li.passed { color:#2f8f3f; font-weight:600; }
#fd-seo-checklist li.passed::before { content: "✓"; color:#fff; background:#2f8f3f; border-radius:50%; width:16px; height:16px; display:inline-flex; align-items:center; justify-content:center; font-size:11px; position:absolute; left:0; top:0; }

/* neutral / checking */
#fd-seo-checklist li.checking { color:#777; font-style:italic; }





/* 🎨 استایل عمومی تمام دکمه‌های داشبورد */
.fd-btn,
.fd-btn-small,
.fd-product-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px !important;       /* عرض ثابت */
  height: 36px !important;           /* ارتفاع ثابت */
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

/* 🔴 حذف */
.fd-delete-btn {
  background-color: #e63946 !important;
}
.fd-delete-btn:hover {
  background-color: #c62828;
}

/* 🟡 ویرایش */
.fd-edit-btn {
  background-color: #ffcc00 !important;
  color: #222;
}
.fd-edit-btn:hover {
  background-color: #f1b700;
}

/* 🟢 نمایش در فروشگاه */
.fd-view-btn {
  background-color: #2ecc71;
}
.fd-view-btn:hover {
  background-color: #27ae60;
}

/* 🎯 چینش یکنواخت دکمه‌ها کنار هم */
.fd-product-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
