/*
Theme Name: Azinfile Child
Description: Azinfile Child Theme
Author: Meysam Hosseinkhani
Author URI: https://i-design.ir
Template: azinfile
Version: 1.0.0
Text Domain: azin-file
*/
/* همه دکمه‌های سایت — WooCommerce + وردپرس */

/* ================================
   🧠 لیست پرامپت‌های خریداری‌شده (اصلی)
================================ */
.purchased-prompts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
  list-style: none;
  padding: 0;
  margin: 30px 0;
}

.prompt-item {
  text-align: center;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}
.prompt-item:hover { transform: translateY(-4px); }

.prompt-item a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.prompt-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.prompt-title {
  background: #fff;
  text-align: center;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  line-height: 1.5;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* واکنش‌گرا */
@media (max-width: 992px) {
  .purchased-prompts-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .purchased-prompts-list { grid-template-columns: 1fr; }
}

/* ================================
   📋 جزئیات پرامپت (اصلی)
================================ */
.prompt-details-inner {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}
.prompt-details-inner h3 {
  margin: 25px 0 10px;
}

/* دکمه‌ها */
.copy-btn,
.azin-back-to-list {
  background: #1eb358;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: 0.3s ease;
}
.copy-btn:hover,
.azin-back-to-list:hover { background: #0a97d4; }

.azin-back-to-list {
  font-size: 12px;
  padding: 6px 14px;
}

/* محتوای پرامپت */
.prompt-details-inner pre {
  background: #f7f7f7;
  padding: 20px;
  border-radius: 20px;
  overflow-x: hidden !important;
  font-size: 13px;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  font-family: monospace;
  white-space: pre-wrap !important;  /* ✨ مهم */
  word-wrap: break-word !important;  /* ✨ برای شکستن کلمات طولانی */
}

/* عنوان و دکمه کپی */
.prompt-block .prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.prompt-block .prompt-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
}
.prompt-block .copy-btn {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
}
.prompt-block .copy-btn:hover { background: #005f8a; }

/* ================================
   🖼️ گالری تصاویر (اصلی)
================================ */
.prompt-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.prompt-gallery img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}
.prompt-gallery img:hover { transform: scale(1.05); }

/* ================================
   💡 لایت‌باکس تصاویر (اصلی)
================================ */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.image-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 0 25px rgba(255,255,255,0.2);
}

.image-lightbox .download-btn {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.image-lightbox .download-btn:hover {
  background: #0073aa !important;
  color: #fff;
}

/* ================================
   💡 مثال‌ها (اصلی)
================================ */
.example-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  direction: rtl;
}

.example-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #fff;
  border-radius: 14px;
  padding: 15px 20px;
}

/* عکس */
.example-img {
  order: 1;
  flex-shrink: 0;
}
.example-thumb {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  object-fit: cover;
  transition: 0.3s ease;
}

/* پرامپت */
.example-text {
  order: 2;
  flex: 1;
}
.example-text pre {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  width: 95%;
}

/* دکمه کپی */
.example-copy {
  position: absolute;
  left: -25px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background-color: #10b981 !important;
 background-image: url('data:image/svg+xml;utf8,<svg fill="white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v16h14c1.1 0 2-.9 2-2V5zm0 16H8V7h11v14z"/></svg>') !important;

  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 16px 16px !important;

  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease;
  z-index: 5;
}
.example-copy:hover { background-color: #059669; }
.example-copy:active { transform: translateY(-50%) scale(0.95); }

/* ======================================
   📱 نسخه موبایل — فیکس کامل دکمه کپی
====================================== */
@media (max-width: 768px) {

  .example-item {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* ردیف جدید: متن + دکمه */
  .example-text {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  /* باکس متن */
  .example-text pre {
    width: auto !important;
    max-width: 80% !important;
    margin: 0 auto !important;
  }

  /* دکمه کپی: لغو absolute و انتقال کنار متن */
  .example-copy {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;

    width: 32px !important;
    height: 32px !important;
    background-size: 16px !important;

    margin: 0 !important;
  }
}

/* -------------------------------------------------------------------
   🔥🔥🔥  📌 از اینجا به بعد: کدهای اضافه شده از نسخه لوکال  🔥🔥🔥
--------------------------------------------------------------------- */

/* ⭐ صفحه‌بندی پیشرفته */
.azin-pagination {
    margin-top: 25px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.azin-pagination .page-num {
    padding: 8px 14px;
    background: #eee;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    transition: 0.2s;
}

.azin-pagination .page-num:hover {
    background: #ddd;
}

.azin-pagination .page-num.active {
    background: #0073aa;
    color: #fff;
    font-weight: bold;
}

/* ⭐ لیست جدید پرامپت برای صفحه‌بندی AJAX */
.azin-prompt-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    padding: 0;
}

.azin-prompt-list .prompt-item {
    list-style: none;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
}

/* موبایل */
@media (max-width: 768px) {
    .azin-prompt-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .azin-prompt-list {
        grid-template-columns: 1fr;
    }
}


}
.prompt-thumb-wrapper {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}
/* نمایش صحیح آیکون کپی در مثال‌ها */


/* در موبایل هم دکمه جا درست داشته باشد */
@media (max-width: 768px) {
    .example-copy {
        left: auto;
        right: 10px;
        top: 10px;
        transform: none;
    }
}
/* حذف بک‌گراند سفید دور thumbnail */
.prompt-item {
    background: transparent !important;
    padding: 0 !important;
}
/* نسخه دسکتاپ (پیش‌فرض) — سه‌تایی */
.purchased-prompts-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

/* نسخه موبایل — تک‌ستونه */
@media (max-width: 768px) {
    .purchased-prompts-list {
        grid-template-columns: 1fr !important;
    }

    .prompt-item {
        width: 100% !important;
    }

    .prompt-thumb {
        width: 100% !important;
        height: auto !important;
    }
}

/* pm-tickets.css - styles for PM Support system */

.pm-support-wrap { max-width: 1000px; margin: 0 auto; padding: 12px; }
.pm-support-title { margin-bottom: 10px; font-size: 22px; margin-bottom:20px; }
.pm-newbox {
    background:#f7fafc;
    padding:22px;
    border-radius:20px;
    margin-bottom:27px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* متن‌ها */
.pm-newbox-texts {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.pm-newbox-texts p {
    margin: 12px 0 0;
}

/* دکمه */
.pm-newbox-btn {
    display:inline-block;
    border-radius:10px !important;
    white-space: nowrap;
    margin: 0 !important;
}


.pm-ticket-table { width:100%; border-collapse:collapse; margin-top:27px; }
.pm-ticket-table thead tr { background:#f1f5f9; }
.pm-ticket-table th, .pm-ticket-table td { padding:10px; border-bottom:1px solid #eee; }

.pm-chat-box { background:#fbfbfb; border:1px solid #eee; border-radius:10px; padding:14px; min-height:180px; max-height:60vh; overflow:auto; margin-top:17px; }
.pm-msg { margin-bottom:12px; display:flex; }
.pm-msg.pm-admin { justify-content:flex-start; }
.pm-msg.pm-user  { justify-content:flex-end; }
.pm-msg-inner { padding:10px 14px; border-radius:12px; max-width:78%; }
.pm-msg.pm-admin .pm-msg-inner { background:#eef2ff; }
.pm-msg.pm-user .pm-msg-inner  { background:#dcfce7; }
.pm-msg-time { font-size:11px; color:#666; margin-top:6px; }
#pm_message{
    width: 100% !important;    /* کل عرض */
    min-width: 100% !important;
    max-width: 100% !important;

    min-height: 170px;          /* ارتفاع بزرگ‌تر */
    resize: vertical;           /* فقط تغییر ارتفاع */

    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #fafafa;
    font-size: 15px;
    line-height: 1.7;
    box-sizing: border-box;
    margin-bottom:17px;
}
.pm-send-area { margin-top:12px; }
.pm-note { color:#b91c1c; margin-top:12px; }
.pm-waiting, .pm-note{
    background: #fff3cd;
    color: #8a6d3b;
    padding: 10px 14px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 14px;
}

/* responsive */
@media (max-width:768px) {
  .pm-msg-inner { max-width:90%; }
  .pm-support-wrap { padding:10px; }
  .pm-newbox {
        flex-direction: column;
        align-items: flex-start;
    }

    .pm-newbox-btn {
        margin-top: 10px !important;
    }
}
/* پنهان کردن آیکون پیشفرض قالب */
.woocommerce-MyAccount-navigation-link--support a::before {
    content: none !important;
}

/* آیکون چت جدید (Font Awesome) */
.woocommerce-MyAccount-navigation-link--support a::before {
    content: "\f4ad" !important; /* fa-comments */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 18px;
}
