/* Vazirmatn Regular - 400 */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vazirmatn-regular.woff2') format('woff2'), /* Modern Browsers */
       url('../fonts/vazirmatn-regular.woff') format('woff'); /* Legacy Browsers */
}

/* Vazirmatn Medium - 500 */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/vazirmatn-500.woff2') format('woff2'),
       url('../fonts/vazirmatn-500.woff') format('woff');
}

/* Vazirmatn Bold - 700 */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/vazirmatn-700.woff2') format('woff2'),
       url('../fonts/vazirmatn-700.woff') format('woff');
}

/* =========================================
   1. استایل‌های اصلی چت‌بات (Main Chat UI)
   ========================================= */
#danak-chat-container {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    width: 380px;
    max-width: 90vw;
    height: 70vh;
    max-height: 650px;
    border: 1px solid #333;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    margin: 20px auto; 
}

/* نمایش در حالت شورتکد (غیر شناور) */
body > #danak-chat-container {
    position: fixed;
    bottom: 100px;
    left: 20px;
    margin: 0;
    z-index: 99998;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s;
}

body > #danak-chat-container.danak-chat-hidden {
    opacity: 0; visibility: hidden; transform: translateY(20px) scale(0.95);
}
body > #danak-chat-container.danak-chat-visible {
    opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}

/* --- هدر چت --- */
#danak-chat-header {
    background: var(--danak-chatbot-primary-color);
    color: var(--danak-chatbot-title-color);
    padding: 12px 40px;
    text-align: center;
    font-size: 1.1em;
    font-weight: 500;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* دکمه‌های هدر */
#danak-header-close-btn, #danak-clear-history-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    cursor: pointer; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.2s;
}
#danak-header-close-btn { left: 10px; }
#danak-clear-history-btn { right: 15px; transition: opacity 0.2s, transform 0.3s; }

#danak-header-close-btn svg, #danak-clear-history-btn svg {
    width: 20px; height: 20px; fill: var(--danak-chatbot-title-color);
}
#danak-header-close-btn:hover, #danak-clear-history-btn:hover { opacity: 0.7; }
#danak-clear-history-btn:hover { transform: translateY(-50%) rotate(-90deg); }

/* نشانگر آنلاین */
.danak-status-indicator {
    width: 10px; height: 10px;
    background-color: #2ecc71;
    border-radius: 50%;
    margin-left: 8px;
    animation: danakGlowPulse 2s infinite ease-in-out;
}
@keyframes danakGlowPulse {
    0% { transform: scale(1); box-shadow: 0 0 6px 0 rgba(46, 204, 113, 0.7); }
    50% { transform: scale(1.2); box-shadow: 0 0 10px 2px rgba(46, 204, 113, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 6px 0 rgba(46, 204, 113, 0.7); }
}

/* --- پنجره پیام‌ها --- */
#danak-chat-window {
    flex-grow: 1; padding: 20px; overflow-y: auto;
    background-color: #f5f2eb;
    display: flex; flex-direction: column;
}

.user-message, .bot-message {
    max-width: 80%; margin-bottom: 15px; padding: 10px 15px;
    border-radius: 20px; line-height: 1.6; word-wrap: break-word;
}
.user-message {
    background-color: var(--danak-chatbot-primary-color);
    color: #1a1a1a; border-bottom-right-radius: 5px; align-self: flex-end;
}
.bot-message {
    background-color: #ffffff;
    color: #333; border: 1px solid #e0e0e0; border-bottom-left-radius: 5px; align-self: flex-start;
}
.bot-message p, .user-message p { margin: 0; overflow-wrap: break-word; white-space: pre-wrap; }

/* لینک‌ها */
#danak-chat-window .bot-message p a {
    color: var(--danak-chatbot-primary-color);
    font-weight: 500; text-decoration: underline; transition: opacity 0.2s ease;
    word-break: break-all;
}
#danak-chat-window .bot-message p a:hover { opacity: 0.8; }

/* فوتر برندینگ */
.danak-chat-footer {
    text-align: center; padding: 2px 0;
    background-color: #f0f0f0; border-top: 1px solid #e0e0e0;
}
.danak-chat-footer a { font-size: 12px; color: #888; text-decoration: none; transition: color 0.2s; }
.danak-chat-footer a:hover { color: #555; text-decoration: underline; }

/* نشانگر تایپ */
.typing-indicator { align-self: flex-start; padding: 10px 15px; }
.typing-indicator span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background-color: #999; animation: typing 1.4s infinite; margin: 0 2px; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }


/* =========================================
   2. ناحیه ورودی و دکمه‌ها (Input Area)
   ========================================= */
#danak-chat-input-area {
    border-top: 1px solid #333; padding: 10px; background-color: #f5f5f5;
}
#danak-chat-form {
    display: flex; align-items: center; gap: 5px;
}
#danak-user-input {
    flex-grow: 1; border: 1px solid #ccc; border-radius: 20px;
    padding: 10px 15px; font-size: 1em; font-family: 'Vazirmatn', sans-serif;
    outline: none; background: #fff; color: #333;
}
#danak-user-input:focus { border-color: var(--danak-chatbot-primary-color); }

/* دکمه میکروفون */
#danak-mic-btn {
    background: transparent; border: none; cursor: pointer; padding: 5px;
    color: #888; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; transition: all 0.2s ease;
    flex-shrink: 0;
}
#danak-mic-btn:hover {
    background-color: rgba(0,0,0,0.05); color: var(--danak-chatbot-primary-color);
}
#danak-mic-btn.is-listening {
    color: #e74c3c !important; background-color: rgba(231, 76, 60, 0.1);
    animation: micPulse 1.5s infinite;
}
@keyframes micPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* دکمه ارسال */
#danak-send-btn {
    flex-shrink: 0; background-color: var(--danak-chatbot-primary-color);
    border: none; border-radius: 50%; width: 40px; height: 40px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: filter 0.2s; padding: 0;
}
#danak-send-btn:hover { filter: brightness(0.9); }
#danak-send-btn svg { fill: #1a1a1a; transform: rotate(180deg); width: 24px; height: 24px; }


/* =========================================
   3. لایه‌بندی و مودال (Z-Index Fixed)
   ========================================= */

/* دکمه شناور */
#danak-fab {
    position: fixed !important;
    bottom: 25px; left: 25px;
    width: 60px; height: 60px;
    background: var(--danak-chatbot-button-color, #a88f59);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    transition: transform 0.2s ease-in-out;
    animation: danakPulse 2.5s infinite ease-in-out;
    
    /* لایه: روی Overlay، زیر Modal */
    z-index: 999999995 !important;
}
#danak-fab:hover { animation-play-state: paused; transform: scale(1.1); }
@keyframes danakPulse {
    0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); }
}

/* آیکون‌های دکمه شناور */
.danak-fab-icon {
    position: absolute; top: 50%; left: 50%;
    animation: danakIconInversePulse 2.5s infinite ease-in-out;
    transition: opacity 0.3s ease-out; color: #ffffff;
}
@keyframes danakIconInversePulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.952); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
#danak-fab:hover .danak-fab-icon { animation: none; transform: translate(-50%, -50%) scale(1) !important; }
.danak-fab-icon svg { display: block; }
.danak-fab-svg-chat { width: 35px; height: 35px; }
.danak-fab-svg-robot { width: 62px; height: 62px; }
.danak-fab-icon-close svg { width: 28px; height: 28px; }

#danak-fab .danak-fab-icon-open { opacity: 1; }
#danak-fab .danak-fab-icon-close { opacity: 0; pointer-events: none; }
#danak-fab.is-open .danak-fab-icon-open { opacity: 0; pointer-events: none; }
#danak-fab.is-open .danak-fab-icon-close { opacity: 1; }

/* لایه سیاه (Overlay) */
#danak-popup-overlay {
    position: fixed !important; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; opacity: 0; transition: opacity 0.3s ease;
    
    /* لایه: پایین‌ترین */
    z-index: 999999990 !important;
}
#danak-popup-overlay.active { display: block; opacity: 1; }

/* پنجره اصلی (Modal) */
#danak-popup-modal {
    position: fixed !important;
    transform: translateY(20px) scale(0.98);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    
    /* لایه: بالاترین */
    z-index: 999999999 !important;
}
#danak-popup-modal.active { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* محتوای داخلی پنجره */
#danak-popup-content {
    background-color: transparent;
    border-radius: 15px; overflow: hidden;
    width: 380px; max-width: 90vw;
    display: flex; flex-direction: column;
    position: relative;
    z-index: 1000000000 !important;
}
#danak-popup-content #danak-chat-container {
    width: 100%; height: 70vh; max-height: 650px;
    margin: 0; border: none; box-shadow: none;
}


#danak-popup-close { display: none; }


/* =========================================
   4. سوالات متداول (FAQ)
   ========================================= */
#danak-faq-container { padding: 0; border-top: 1px solid #e0e0e0; background-color: #f5f2eb; }
.danak-faq-header {
    font-size: 14px; font-weight: 500; color: #555;
    padding: 8px 15px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: background-color 0.2s, color 0.2s; position: relative;
}
.danak-faq-header::after {
    content: ''; position: absolute; bottom: 0; right: 15px; left: 15px; height: 1px;
    background-color: #e0e0e0; transform: scaleX(0); transition: transform 0.3s ease;
}
.danak-faq-header:hover::after { transform: scaleX(1); }
.danak-faq-header svg { width: 22px; height: 22px; fill: #888; transition: transform 0.3s ease-in-out, fill 0.2s; }
.danak-faq-header:hover svg { fill: var(--danak-chatbot-primary-color); }
.danak-faq-header.active svg { transform: rotate(90deg); }
.danak-faq-header.active { color: var(--danak-chatbot-primary-color); }

.danak-faq-items-wrapper {
    display: none; background-color: #ffffff;
    border-top: 1px solid #e0e0e0; padding: 5px 0;
    max-height: 150px; overflow-y: auto;
}
.danak-faq-items-wrapper::-webkit-scrollbar { width: 6px; }
.danak-faq-items-wrapper::-webkit-scrollbar-track { background: #f1f1f1; }
.danak-faq-items-wrapper::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.danak-faq-items { display: flex; flex-direction: column; }
.danak-faq-question {
    font-family: 'Vazirmatn', sans-serif;
    display: flex; align-items: center; width: 100%; text-align: right;
    padding: 10px 20px; background: none; border: none; cursor: pointer;
    font-size: 14px; color: #444; position: relative;
    transition: background-color 0.2s, color 0.2s, padding-right 0.2s ease;
}
.danak-faq-question::after {
    content: ''; position: absolute; bottom: 0; right: 20px; left: 20px; height: 1px; background-color: #f0f0f0;
}
.danak-faq-items .danak-faq-question:last-child::after { display: none; }
.danak-faq-question:hover {
    background-color: rgba(212, 175, 55, 0.05);
    color: var(--danak-chatbot-primary-color);
    padding-right: 25px;
    box-shadow: inset 3px 0 0 0 var(--danak-chatbot-primary-color);
}
.danak-faq-question .danak-faq-q-icon {
    width: 16px; height: 16px; fill: #bbb;
    margin-left: 10px; transition: fill 0.2s;
}
.danak-faq-question:hover .danak-faq-q-icon { fill: var(--danak-chatbot-primary-color); }
.danak-faq-question span { flex-grow: 1; }


/* =========================================
   5. کارت محصول (Product Card)
   ========================================= */
.danak-product-card {
    display: flex; background: #fff;
    border: 1px solid #e0e0e0; border-radius: 12px;
    padding: 10px; margin-top: 10px; gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s; align-items: center; max-width: 100%;
}
.danak-product-card:hover {
    transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.1);
}

.danak-pc-img {
    position: relative; width: 70px; height: 70px; flex-shrink: 0;
}
.danak-pc-img img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
}
.danak-out-stock {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(255,0,0,0.7); color: #fff; font-size: 10px;
    text-align: center; padding: 2px;
    border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
}

.danak-pc-info {
    flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between;
}
.danak-pc-title {
    margin: 0 0 5px 0; font-size: 13px; line-height: 1.3; font-weight: bold;
}
.danak-pc-title a { text-decoration: none; color: #333; }

.danak-pc-price {
    font-size: 13px; color: #2ecc71; font-weight: bold; margin-bottom: 8px;
}
.danak-pc-price del { color: #999; font-size: 11px; margin-left: 5px; }

.danak-pc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--danak-chatbot-primary-color);
    color: #1a1a1a !important; text-decoration: none !important;
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
    transition: opacity 0.2s; width: fit-content;
}
.danak-pc-btn:hover { opacity: 0.9; }
.danak-pc-btn svg { margin-right: 5px; fill: currentColor; }

/* --- استایل فرم داخل چت --- */
.danak-chat-form-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.dcf-header {
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--danak-chatbot-primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.dcf-row { margin-bottom: 10px; }
.dcf-row input, .dcf-row textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
}
.dcf-row textarea { height: 60px; resize: vertical; }
.dcf-submit-btn {
    width: 100%;
    background: var(--danak-chatbot-primary-color);
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
.dcf-submit-btn:hover { opacity: 0.9; }
.dcf-message { margin-top: 10px; font-size: 12px; color: green; text-align: center; }

/* دکمه تولز (لیست فرم) */
#danak-tools-btn {
    background: transparent; border: none; cursor: pointer; padding: 5px;
    color: #888; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; transition: 0.2s; flex-shrink: 0;
}
#danak-tools-btn:hover, #danak-tools-btn.active {
    background-color: rgba(0,0,0,0.05); color: var(--danak-chatbot-primary-color);
}

/* منوی بازشو */
.danak-tools-menu {
    position: absolute;
    bottom: 70px; /* بالای اینپوت */
    left: 10px; /* یا right بسته به طراحی */
    width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: none; /* مخفی */
    flex-direction: column;
    padding: 5px;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}
.danak-tools-menu::-webkit-scrollbar {
    width: 4px;
}
.danak-tools-menu::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}
.danak-form-option {
    padding: 10px;
    text-align: right;
    font-size: 13px;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    background: transparent; border: none; width: 100%;
    display: flex;
    align-items: center;
}
.danak-form-option:hover { background: #f5f5f5; color: var(--danak-chatbot-primary-color); }

/* --- استایل ستاره قرمز در فرم‌ها --- */
.dcf-row input::placeholder,
.dcf-row textarea::placeholder {
    color: #999;
}

/* رنگ قرمز برای ستاره */
.dcf-row input[required]::placeholder:after,
.dcf-row textarea[required]::placeholder:after {
    /* این روش معمولاً مستقیم کار نمی‌کند، اما placeholder را آماده می‌کنیم */
}

/* روش بهتر: استفاده از یک ترفند CSS برای نمایش ستاره */
.dcf-row input[required],
.dcf-row textarea[required] {
    /* این اطمینان می‌دهد که مرورگر استایل‌های required را اعمال کند */
}
/* --- اصلاح فونت دکمه‌های ابزار --- */
#danak-chat-form #danak-tools-btn,
#danak-chat-form #danak-mic-btn,
#danak-chat-form #danak-send-btn {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* اصلاح فونت دکمه‌های داخل منوی فرم */
.danak-form-option {
    font-family: 'Vazirmatn', sans-serif !important;
}
.dcf-checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #333; cursor: pointer;
}
.dcf-checkbox-label input[type="checkbox"] {
    width: auto; margin: 0;
}

/* --- اصلاح جهت‌گیری فیلدهای فرم --- */
.dcf-row input[type="text"],
.dcf-row input[type="email"],
.dcf-row input[type="tel"],
.dcf-row textarea {
    direction: rtl !important;
    text-align: right !important;
}
/* --- اصلاح ظاهر و چیدمان چک‌باکس (RTL) --- */

.dcf-checkbox-label {
    display: flex;
    /* این خط جادو را انجام می‌دهد */
    flex-direction: row-reverse; /* آیتم‌ها را برعکس می‌چیند */
    
    justify-content: flex-end; /* همه را به سمت راست می‌چسباند */
    align-items: center;
    gap: 8px; 
    font-size: 13px;
    color: #333;
    cursor: pointer;
    margin-top: 5px;
    padding: 5px;
}

.dcf-checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
}

/* =========================================
   6. دکمه کپی کردن متن (Copy Button)
   ========================================= */

/* برای اینکه دکمه کپی داخل کادر پیام قرار بگیرد */
.bot-message {
    position: relative;
    padding-left: 45px; /* کمی فضا برای دکمه در سمت چپ */
}

.danak-copy-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background-color: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; /* در حالت عادی مخفی */
    transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
    transform: scale(0.9);
}

/* نمایش دکمه هنگام هاور روی پیام */
.bot-message:hover .danak-copy-btn {
    opacity: 1;
    transform: scale(1);
}

.danak-copy-btn:hover {
    background-color: #e5e5e5;
}

.danak-copy-btn .dashicons {
    font-size: 16px; /* کنترل اندازه با فونت */
    color: #555;     /* کنترل رنگ با color */
    transition: transform 0.2s;
    /* برای اینکه آیکون دقیقاً وسط دکمه باشد */
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 1; 
}

/* استایل حالت "کپی شد" */
.danak-copy-btn.copied {
    background-color: #2ecc71; /* رنگ سبز */
    border-color: #27ae60;
}

.danak-copy-btn.copied .dashicons {
    color: #fff; /* کنترل رنگ با color */
    transform: scale(1.1);
}

/* --- Fix: Remove extra padding from product card wrapper --- */
.bot-message .danak-product-card {
    margin-left: -35px; /* Neutralize the extra padding for the card */
}

/* =========================================
   7. SweetAlert Customization (Frontend)
   ========================================= */

/* Apply Vazirmatn font to ALL parts of SweetAlert popups */
.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-confirm,
.swal2-cancel {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* Ensure z-index is high enough to appear above the chatbot */
.swal2-container {
    z-index: 1000000001 !important; /* Higher than the popup modal */
}

/* =========================================
   8. Consent Banner (Improved Style)
   ========================================= */
#danak-consent-banner {
    background-color: #f8f9fa; /* یک رنگ خنثی و بسیار روشن */
    color: #3c434a;             
    padding: 10px 15px;
    display: flex;
    align-items: center;
    font-size: 13px;
    border: 1px solid #ddd; /* بردر اولیه خنثی */
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeInDown 0.5s ease-out;
    gap: 10px; /* فاصله بین آیکون، متن و دکمه */
}

.danak-consent-icon {
    width: 20px;
    height: 20px;
    color: #888;
    flex-shrink: 0;
}

#danak-consent-banner p {
    margin: 0;
    line-height: 1.4;
    flex-grow: 1;
}

#danak-consent-banner button {
    /* رنگ پس‌زمینه به صورت داینامیک با JS اعمال می‌شود */
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Vazirmatn', sans-serif;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

#danak-consent-banner button:hover {
    opacity: 0.9;
}

#danak-consent-banner button:active {
    transform: scale(0.97);
}

/* انیمیشن برای ورود بنر */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ردیف پیام */
.danak-message-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

/* ردیف بات: آواتار اول (سمت راست در RTL) */
.danak-bot-row {
    flex-direction: row;
}

/* ردیف کاربر: آواتار سمت مقابل */
.danak-user-row {
    flex-direction: row-reverse;
}

/* آواتار */
.danak-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 4px;
}

/* اصلاح عرض پیام داخل ردیف */
.danak-message-row .bot-message,
.danak-message-row .user-message {
    max-width: calc(100% - 45px);
}

/* استایل لایه غیرفعال روی چت */
.danak-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* رنگ مشکی نیمه شفاف */
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit; /* برای حفظ گوشه‌های گرد پنجره */
}

.danak-disabled-message-box {
    background: #fff;
    color: #333;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    direction: rtl;
}

.danak-disabled-message-box p {
    margin: 0;
    font-weight: 600;
}


.danak-disabled-icon {
    font-size: 50px;
    color: #6c757d; /* رنگ خاکستری - می‌توانید به رنگ دلخواه تغییر دهید */
    margin-bottom: 15px;
    display: inline-flex;
}


/* =========================================
   9. Dimmed FAB (حالت خاموش)
   ========================================= */
#danak-fab.danak-fab-dimmed {
    filter: grayscale(100%) brightness(0.85);
    opacity: 0.75;
    cursor: not-allowed;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

#danak-fab.danak-fab-dimmed:hover {
    filter: grayscale(100%) brightness(0.95);
    opacity: 0.9;
    transform: none !important; /* جلوگیری از بزرگ‌شدن هاور */
}


/* =========================================
   10. Disabled Helper (دکمه راهنما در حالت خاموش)
   ========================================= */
.danak-disabled-helper {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.danak-disabled-helper-text {
    margin: 0 !important;
    font-size: 13px !important;
    color: #666 !important;
    font-weight: normal !important;
    line-height: 1.6 !important;
}

.danak-disabled-helper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--danak-chatbot-primary-color);
    color: #1a1a1a !important;
    text-decoration: none !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: filter 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.danak-disabled-helper-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    color: #1a1a1a !important;
}

.danak-disabled-helper-btn:active {
    transform: translateY(0);
}





/* ============================================
   🎨 Fullpage Modal (Unified Mode)
   مدال تمام‌صفحه که fullpage رو در iframe لود می‌کنه
   ============================================ */

/* ============================================
   1. Modal Container (پایه)
   ============================================ */
.danak-fp-modal {
    /* مخفی به صورت پیش‌فرض */
    display: none;
    
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    
    z-index: 999999; /* بالاترین لایه - بالای FAB و popup */
    
    /* جلوگیری از انتخاب متن هنگام درگ */
    user-select: none;
    -webkit-user-select: none;
    
    /* فونت یکدست */
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
}

/* وقتی باز شده */
.danak-fp-modal.is-open {
    display: block;
    animation: dfp-modal-fade-in 0.25s ease-out;
}

/* وقتی در حال بسته شدنه */
.danak-fp-modal.is-closing {
    animation: dfp-modal-fade-out 0.2s ease-in forwards;
}

/* ============================================
   2. Backdrop (پشت‌زمینه تیره)
   ============================================ */
.danak-fp-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    cursor: pointer;
}

/* ============================================
   3. Modal Container (باکس اصلی)
   ============================================ */
.danak-fp-modal-container {
    position: absolute;
    
    /* فاصله از لبه‌های صفحه - مثل ChatGPT */
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.15);
    
    overflow: hidden;
    
    /* انیمیشن slide-up */
    animation: dfp-modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.danak-fp-modal.is-closing .danak-fp-modal-container {
    animation: dfp-modal-slide-down 0.2s ease-in forwards;
}

/* ============================================
   4. Close Button (دکمه بستن)
   ============================================ */
.danak-fp-modal-close {
    position: absolute;
    top: 12px;
    left: 12px; /* در RTL، چپ */
    z-index: 10;
    
    width: 36px;
    height: 36px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    color: #1f2937;
    cursor: pointer;
    
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.danak-fp-modal-close:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.danak-fp-modal-close:active {
    transform: scale(0.95);
}

.danak-fp-modal-close svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* ============================================
   5. Open in New Tab Button (دکمه صفحه جدید)
   ============================================ */
.danak-fp-modal-newtab {
    position: absolute;
    top: 12px;
    left: 96px; /* کنار دکمه close */
    z-index: 10;
    
    width: 36px;
    height: 36px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}



.danak-fp-modal-newtab:hover {
    background: #eff6ff;
    color: #2563eb;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.danak-fp-modal-newtab:active {
    transform: scale(0.95);
}

.danak-fp-modal-newtab svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

/* ============================================
   6. Loader (در حال بارگذاری)
   ============================================ */
.danak-fp-modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    
    color: #6b7280;
    font-size: 14px;
    
    transition: opacity 0.3s ease;
}

.danak-fp-modal-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.danak-fp-modal-loader p {
    margin: 0;
    font-weight: 500;
}

/* Spinner */
.danak-fp-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: dfp-modal-spin 0.8s linear infinite;
}

/* ============================================
   7. iframe
   ============================================ */
.danak-fp-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    
    /* جلوگیری از scroll bar اضافه */
    display: block;
    
    /* انیمیشن fade-in بعد از لود */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.danak-fp-modal-iframe.is-loaded {
    opacity: 1;
}

/* ============================================
   8. Body lock وقتی modal بازه
   ============================================ */
body.danak-fp-modal-open {
    overflow: hidden !important;
}

/* ============================================
   9. Animations
   ============================================ */
@keyframes dfp-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dfp-modal-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes dfp-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dfp-modal-slide-down {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
}

@keyframes dfp-modal-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   10. Responsive - تبلت
   ============================================ */
@media (max-width: 1024px) {
    .danak-fp-modal-container {
        top: 16px;
        left: 16px;
        right: 16px;
        bottom: 16px;
        border-radius: 14px;
    }
}

/* ============================================
   11. Responsive - موبایل (تبلت کوچک تا گوشی)
   ============================================ */
@media (max-width: 768px) {
    .danak-fp-modal-container {
        /* فاصله ظریف از لبه‌ها برای القای حس پاپ‌آپ */
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
        
        /* گوشه‌های گرد */
        border-radius: 16px;
        
        /* سایه مناسب موبایل (سبک‌تر از دسکتاپ) */
        box-shadow: 
            0 12px 32px rgba(0, 0, 0, 0.3),
            0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .danak-fp-modal-close {
        top: 8px;
        left: 8px;
        width: 40px;
        height: 40px;
    }
    
    .danak-fp-modal-newtab {
        top: 8px;
        left: 56px;
        width: 40px;
        height: 40px;
    }
    
    /* در موبایل، backdrop blur رو ساده می‌کنیم برای performance */
    .danak-fp-modal-backdrop {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.7);
    }
}

/* ============================================
   11.1. موبایل کوچک‌تر (زیر 480px - گوشی‌های کوچک)
   فاصله کمتر برای حداکثر استفاده از فضا
   ============================================ */
@media (max-width: 480px) {
    .danak-fp-modal-container {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-radius: 14px;
    }
}

/* ============================================
   12. Dark Mode (وقتی iframe در dark theme است)
   اگه parent page هم dark theme داشت
   ============================================ */
@media (prefers-color-scheme: dark) {
    .danak-fp-modal-container {
        background: #1a1a1a;
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.5),
            0 8px 24px rgba(0, 0, 0, 0.3);
    }
    
    .danak-fp-modal-close {
        background: rgba(40, 40, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }
    
    .danak-fp-modal-close:hover {
        background: rgba(220, 38, 38, 0.2);
        color: #fca5a5;
    }
    
    .danak-fp-modal-newtab {
        background: rgba(40, 40, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }
    
    .danak-fp-modal-newtab:hover {
        background: rgba(37, 99, 235, 0.2);
        color: #93c5fd;
    }
    
    .danak-fp-modal-loader {
        color: #9ca3af;
    }
    
    .danak-fp-modal-spinner {
        border-color: #374151;
        border-top-color: #6366f1;
    }
}

/* ============================================
   13. کاهش حرکت (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .danak-fp-modal,
    .danak-fp-modal-container,
    .danak-fp-modal-close,
    .danak-fp-modal-newtab {
        animation: none !important;
        transition: none !important;
    }
}



/* ============================================
   🔧 مخفی کردن FAB و Popup قدیمی وقتی Modal بازه
   ============================================ */

/* وقتی modal بازه، FAB و popup قدیمی رو کاملاً مخفی کن */
body.danak-fp-modal-open #danak-fab,
body.danak-fp-modal-open .danak-fab,
body.danak-fp-modal-open #danak-popup-overlay,
body.danak-fp-modal-open #danak-popup-modal,
body.danak-fp-modal-open #danak-chat-form-wrapper {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* اطمینان از اینکه modal بالاتر از هر چیزی باشه */
.danak-fp-modal {
    z-index: 2147483647 !important; /* بالاترین مقدار ممکن */
}

.danak-fp-modal.is-open {
    z-index: 2147483647 !important;
}



/* ============================================
   📱 وقتی سایدبار موبایل iframe بازه، دکمه‌های modal مخفی
   ============================================ */

.danak-fp-modal.sidebar-overlapping .danak-fp-modal-close,
.danak-fp-modal.sidebar-overlapping .danak-fp-modal-newtab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* وقتی سایدبار بسته شد، دکمه‌ها برمی‌گردن با انیمیشن */
.danak-fp-modal .danak-fp-modal-close,
.danak-fp-modal .danak-fp-modal-newtab {
    transition: opacity 0.25s ease, transform 0.25s ease;
}



/* ============================================
   🛒 Product Card Buttons (v2.9)
   ============================================ */

/* container دکمه‌ها */
.danak-pc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

/* استایل پایه برای همه دکمه‌ها */
.danak-pc-buttons .danak-pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

/* دکمه «مشاهده» (همون استایل قبلی) */
.danak-pc-btn-view {
    background: var(--danak-chatbot-primary-color, #d4af37);
    color: #1a1a1a !important;
}

.danak-pc-btn-view:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* دکمه «افزودن به سبد» - رنگ از تنظیمات (پیش‌فرض سبز) */
.danak-pc-btn-cart {
    background: var(--danak-chatbot-btn-cart-color, #10b981);
    color: #ffffff !important;
}
.danak-pc-btn-cart:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
/* دکمه «خرید سریع» - رنگ از تنظیمات (پیش‌فرض نارنجی) */
.danak-pc-btn-buy-now {
    background: var(--danak-chatbot-btn-buynow-color, #f59e0b);
    color: #ffffff !important;
}
.danak-pc-btn-buy-now:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* حالت loading */
.danak-pc-btn.is-loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* حالت موفق */
.danak-pc-btn.is-success {
    background: #10b981 !important;
    color: #ffffff !important;
    animation: dpc-success-pulse 0.5s ease-out;
}

@keyframes dpc-success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Spinner */
.danak-pc-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dpc-spin 0.8s linear infinite;
}

@keyframes dpc-spin {
    to { transform: rotate(360deg); }
}

/* در موبایل */
@media (max-width: 480px) {
    .danak-pc-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .danak-pc-buttons .danak-pc-btn {
        width: 100%;
        font-size: 11px;
        padding: 8px 12px;
    }
}

/* Toast custom class (در صورت نیاز) */
.danak-cart-toast {
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}


/* ============================================
   🔄 Smart Fallback Prompt (v2.9)
   ============================================ */

/* پیام پیشنهاد fallback */
.danak-fallback-prompt-msg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05)) !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    border-radius: 12px !important;
}

.danak-fallback-prompt-msg p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #1a1a1a;
}

/* container دکمه‌ها */
.danak-fallback-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* استایل پایه دکمه‌ها */
.danak-fallback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.4;
    
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.danak-fallback-btn svg {
    flex-shrink: 0;
}

/* دکمه "بله" - رنگ اصلی */
.danak-fallback-btn-yes {
    background: var(--danak-chatbot-primary-color, #6366f1);
    color: #ffffff;
    border-color: var(--danak-chatbot-primary-color, #6366f1);
}

.danak-fallback-btn-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    filter: brightness(1.05);
}

.danak-fallback-btn-yes:active {
    transform: translateY(0);
}

/* دکمه "نه" - خنثی */
.danak-fallback-btn-no {
    background: transparent;
    color: #666;
    border-color: #d0d0d0;
}

.danak-fallback-btn-no:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #999;
    color: #333;
}

/* حالت غیرفعال */
.danak-fallback-btn:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* انیمیشن ظاهر شدن */
.danak-fallback-prompt-row {
    animation: danak-fallback-fadein 0.4s ease-out;
}

@keyframes danak-fallback-fadein {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* موبایل */
@media (max-width: 480px) {
    .danak-fallback-actions {
        flex-direction: column;
    }
    
    .danak-fallback-btn {
        width: 100%;
        padding: 10px 14px;
    }
}

/* ============================================
   🔤 Vazirmatn font for chat forms
   ============================================ */

.danak-dynamic-form,
.danak-dynamic-form input,
.danak-dynamic-form select,
.danak-dynamic-form textarea,
.danak-dynamic-form button,
.danak-dynamic-form label,
.dcf-submit-btn,
.dcf-message {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}



/* ============================================
   ⭐ Modal Fallback UI (وقتی iframe لود نمیشه)
   ============================================ */

.danak-fp-modal-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    padding: 32px 24px;
    max-width: 420px;
    width: 90%;
    
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    text-align: center;
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    
    animation: dfp-fallback-fadein 0.3s ease-out;
}

@keyframes dfp-fallback-fadein {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* آیکن هشدار */
.danak-fp-fallback-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: dfp-fallback-pulse 2s ease-in-out infinite;
}

@keyframes dfp-fallback-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* عنوان */
.danak-fp-fallback-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

/* پیام */
.danak-fp-fallback-message {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

/* شمارنده برجسته */
.danak-fp-fallback-message #danak-fp-fallback-counter {
    display: inline-block;
    min-width: 24px;
    font-weight: 700;
    color: #dc2626;
    font-size: 16px;
}

/* container دکمه‌ها */
.danak-fp-fallback-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

/* استایل پایه دکمه‌ها */
.danak-fp-fallback-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* دکمه اصلی */
.danak-fp-fallback-btn-primary {
    background: var(--danak-chatbot-primary-color, #6366f1);
    color: #ffffff;
}

.danak-fp-fallback-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.danak-fp-fallback-btn-primary:active {
    transform: translateY(0);
}

/* دکمه فرعی */
.danak-fp-fallback-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.danak-fp-fallback-btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* موبایل */
@media (max-width: 480px) {
    .danak-fp-modal-fallback {
        padding: 24px 20px;
        width: 92%;
    }
    
    .danak-fp-fallback-icon {
        width: 56px;
        height: 56px;
    }
    
    .danak-fp-fallback-title {
        font-size: 16px;
    }
    
    .danak-fp-fallback-message {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .danak-fp-fallback-actions {
        flex-direction: column;
    }
    
    .danak-fp-fallback-btn {
        width: 100%;
    }
}

/* در حالت dark mode (اگه parent سایت dark theme داره) */
@media (prefers-color-scheme: dark) {
    .danak-fp-modal-fallback {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    .danak-fp-fallback-title {
        color: #f3f4f6;
    }
    
    .danak-fp-fallback-message {
        color: #9ca3af;
    }
    
    .danak-fp-fallback-btn-secondary {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .danak-fp-fallback-btn-secondary:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
}


/* ============================================
   FA Pro 7.1.0 Override (v2.9)
   مشکل: قالب/افزونه‌های دیگه FA 6 Free لود می‌کنن
   که اسم font-family یکسانی داره و آیکن‌های Pro ما رو override می‌کنه.
   راه‌حل: مجبور کن آیکن‌های افزونه از FA 7 Pro استفاده کنن.
   ============================================ */

/* همه آیکن‌های FA در سلکتورهای افزونه */
.danak-chatbot-popup .fa-solid,
.danak-chatbot-popup .fas,
.danak-chatbot-popup .fa-regular,
.danak-chatbot-popup .far,
.danak-chatbot-popup .fa-thin,
.danak-chatbot-popup .fa-light,
.danak-chatbot-popup .fa-duotone,
.danak-chatbot-popup i[class*="fa-"],
#danak-fab,
#danak-fab i,
#danak-fab .fa-solid,
#danak-fab .fas,
.danak-fab,
.danak-fab i,
.danak-fab .fa-solid,
.danak-fab .fas,
.danak-fp-modal .fa-solid,
.danak-fp-modal .fa-regular,
.danak-fp-modal .fa-thin,
.danak-fp-modal .fa-light,
.danak-fp-modal .fa-duotone,
.danak-fp-modal i[class*="fa-"] {
    font-family: "Font Awesome 7 Pro" !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* وزن فونت برای هر نوع آیکن */
.danak-chatbot-popup .fa-solid,
.danak-chatbot-popup .fas,
#danak-fab .fa-solid,
#danak-fab .fas,
#danak-fab i,
.danak-fab .fa-solid,
.danak-fab .fas,
.danak-fab i,
.danak-fp-modal .fa-solid {
    font-weight: 900 !important;
}

.danak-chatbot-popup .fa-regular,
.danak-chatbot-popup .far,
.danak-fp-modal .fa-regular {
    font-weight: 400 !important;
}

.danak-chatbot-popup .fa-thin,
.danak-fp-modal .fa-thin {
    font-weight: 100 !important;
}

.danak-chatbot-popup .fa-light,
.danak-fp-modal .fa-light {
    font-weight: 300 !important;
}

/* آیکن‌های Brands از font-family جداگانه استفاده می‌کنن */
.danak-chatbot-popup .fa-brands,
.danak-chatbot-popup .fab,
.danak-fp-modal .fa-brands {
    font-family: "Font Awesome 7 Brands" !important;
    font-weight: 400 !important;
}


/* ============================================
   ⭐ Theme Override Protection برای پاپ‌آپ (v2.9.2)
   ============================================ */

/* Reset برای textarea در پاپ‌آپ */
.danak-chatbot-popup textarea,
.danak-chatbot-popup #danak-user-input,
.danak-chatbot-popup textarea#danak-user-input {
    min-height: unset !important;
    max-height: 150px !important;
    height: auto !important;
    padding: 10px 14px !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-shadow: none !important;
    outline: none !important;
    resize: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

/* Reset button ها در پاپ‌آپ */
.danak-chatbot-popup button {
    font-family: inherit !important;
    line-height: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Reset form در پاپ‌آپ */
.danak-chatbot-popup form,
.danak-chatbot-popup #danak-chat-form {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* اطمینان از box-sizing درست */
.danak-chatbot-popup,
.danak-chatbot-popup * {
    box-sizing: border-box;
}