/* =========================================================
   Jahat Activists - Frontend Styles
========================================================= */

/* مخفی کردن فیلدهای اضافی فرم ویرایش اکانت وוקامرس */
.woocommerce-EditAccountForm .digits_custom_fields_wrapper { display: none !important; }
.woocommerce-EditAccountForm label::before, 
.woocommerce-EditAccountForm label::after { display: none !important; content: "" !important; }

/* تنظیمات کارت‌های پروفایل کنشگری */
.jahat-exclusive-card label::before, .jahat-exclusive-card label::after, .jahat-managed label::before, .jahat-managed label::after, .form-row label::before, .form-row label::after { display: none !important; content: "" !important; }
.jahat-exclusive-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 15px; transition: 0.3s ease; display: block !important; }
.jahat-completed-card { background-color: #f0fdf4 !important; border-color: #bbf7d0 !important; }
.jahat-completed-card .hadilms-compact-header { border-bottom-color: #bbf7d0 !important; }
.jahat-completed-card .jahat-card-footer { background-color: #dcfce7 !important; border-top-color: #bbf7d0 !important; }

/* گرید فرم‌ها و چک‌باکس‌ها */
.jahat-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 15px; padding: 15px; }
.jahat-form-grid .form-row { width: 100%; margin: 0 !important; padding: 0; }
.jahat-form-grid label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: bold; color: #475569; }
.jahat-form-grid input.input-text, .jahat-form-grid select.input-text { width: 100%; font-family: inherit; font-size: 13px; border-radius: 6px; border: 1px solid #cbd5e1; padding: 6px 10px; box-sizing: border-box; }
.jahat-checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 15px; padding: 15px; }
.jahat-checkbox-grid label { font-size: 13px; cursor: pointer; display: flex; align-items: center; margin: 0; color: #334155; }
.jahat-checkbox-grid input[type="checkbox"] { margin-left: 8px !important; margin-right: 0 !important; width: 15px !important; height: 15px !important; }
.jahat-skill-category-title { font-size: 14px; font-weight: 800; color: #3b82f6; padding: 0 15px; margin: 10px 0 0 0; }
.jahat-separator { border-top: 1px dashed #e2e8f0; margin: 5px 15px; }

/* دکمه‌ها و پاپ‌آپ ذخیره */
.jahat-card-footer { padding: 10px 15px; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: flex-start; direction: rtl; border-radius: 0 0 12px 12px; transition: 0.3s; }
.jahat-btn-save { background: #3b82f6; color: #fff; border: none; padding: 6px 20px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: bold; margin-right: auto; transition: 0.2s; }
.jahat-btn-save:hover { background: #2563eb; transform: translateY(-1px); }
.jahat-save-msg { display: none; color: #10b981; font-size: 12px; font-weight: bold; margin-right: 15px; }

/* شبکه‌های اجتماعی */
.jahat-social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 15px; padding: 15px; }
.jahat-social-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 12px; border-radius: 8px; margin: 0; transition: 0.2s; }
.jahat-social-row:hover { border-color: #cbd5e1; background: #f1f5f9; }
.jahat-social-input { display: none; flex: 1; margin: 0 !important; padding: 4px 8px !important; font-size: 12px !important; border: 1px solid #94a3b8 !important; border-radius: 4px !important; text-align: left; direction: ltr; }

/* استایل رویدادهای ویژه */
.jahat-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 20px; }
.jahat-event-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; text-align: center; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.jahat-event-card:hover { border-color: #3b82f6; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1); transform: translateY(-3px); }
.jahat-event-card h3 { font-size: 15px; color: #1e293b; margin-top: 0; margin-bottom: 15px; line-height: 1.5; }
.jahat-event-btn { display: inline-block; background: #3b82f6; color: #fff; padding: 8px 20px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: bold; transition: 0.2s; }
.jahat-event-btn:hover { background: #2563eb; color:#fff; }

/* استایل چاپ (پرینت) */
@media print { 
    body * { visibility: hidden; } 
    #jahat-print-area, #jahat-print-area * { visibility: visible; } 
    #jahat-print-area { position: absolute; left: 0; top: 0; width: 100%; } 
}

/* =========================================================
   Jahat Activists - Mentorship Styles
========================================================= */
.jahat-mentees-title { margin-bottom: 5px; }
.jahat-mentees-desc { color: #64748b; font-size: 13px; }
.jahat-mentees-empty { background: #f8fafc; border: 1px dashed #cbd5e1; padding: 20px; border-radius: 8px; text-align: center; color: #64748b; margin-top: 20px; }
.jahat-mentees-table { border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; margin-top: 20px; width: 100%; }
.jahat-mentees-table thead { background: #f8fafc; }
.jahat-mentees-table th { padding: 15px; text-align: right; }
.jahat-mentees-table td { padding: 15px; vertical-align: middle; }
.jahat-mentees-table .text-center { text-align: center; }
.jahat-phone-text { color: #64748b; direction: ltr; text-align: right; }
.jahat-mentee-progress { background: #dcfce7; color: #166534; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: bold; }
.jahat-update-courses-btn { font-family: inherit; background: #eff6ff; color: #2f7ee8; border: 1px dashed #bfdbfe; padding: 6px 15px; border-radius: 8px; font-size: 11px; font-weight: bold; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; gap: 5px; }
.jahat-update-courses-btn:hover { background: #dbeafe; }
.jahat-btn-switch { background: #3b82f6; color: #fff; border: none; padding: 5px 15px; border-radius: 6px; font-size: 12px; white-space: nowrap; text-decoration: none; }
.jahat-btn-switch:hover { background: #2563eb; color: #fff; }

/* بنر بازگشت به حساب کاربری */
.jahat-switch-back-banner { position: fixed; top: 0; left: 0; width: 100%; background: #ef4444; color: #fff; text-align: center; padding: 12px; z-index: 999999; font-weight: bold; box-shadow: 0 2px 10px rgba(0,0,0,0.2); display: flex; justify-content: center; align-items: center; gap: 20px; }
.jahat-switch-back-banner a { background: #fff; color: #ef4444; padding: 5px 20px; border-radius: 5px; text-decoration: none; transition: 0.2s; }
.jahat-switch-back-banner a:hover { background: #fef2f2; }
/* اعمال فاصله از بالای صفحه در زمانی که بنر فعال است */
body:has(.jahat-switch-back-banner) { margin-top: 50px !important; }

/* =========================================================
   Jahat Activists - Events Styles (Frontend)
========================================================= */
.jahat-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 20px; }
.jahat-event-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; text-align: center; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.jahat-event-card:hover { border-color: #3b82f6; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1); transform: translateY(-3px); }
.jahat-event-card h3 { font-size: 15px; color: #1e293b; margin-top: 0; margin-bottom: 15px; line-height: 1.5; }
.jahat-event-btn { display: inline-block; background: #3b82f6; color: #fff; padding: 8px 20px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: bold; transition: 0.2s; }
.jahat-event-btn:hover { background: #2563eb; color:#fff; }

@media print { 
    body * { visibility: hidden; } 
    #jahat-print-area, #jahat-print-area * { visibility: visible; } 
    #jahat-print-area { position: absolute; left: 0; top: 0; width: 100%; } 
}


/* =========================================================
   Mobile Overrides (Dashboard Width & Top Header)
========================================================= */
.jahat-mobile-topbar { display: none; } /* در دسکتاپ مخفی باشد */

@media (max-width: 768px) {
    /* ۱. عریض کردن ستون وسط داشبورد و حذف فاصله‌های اضافه قالب */
    .woocommerce-account .woocommerce,
    .woocommerce-account .pro-1-2,
    .woocommerce-account .entry-content,
    .woocommerce-account .woocommerce-MyAccount-content {
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* حذف مارجین بالای کلاس ووکامرس در موبایل */
    .woocommerce-account .woocommerce {
        margin-top: 0 !important;
    }

    /* کاهش مارجین بالای کلاس سایز به ۱۰ پیکسل در موبایل */
    .woocommerce-account .size {
        margin-top: 10px !important;
    }

    /* ۲. استایل نوار هدر اختصاصی موبایل */
    .jahat-mobile-topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #ffffff;
        padding: 12px 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        position: sticky;
        top: 0;
        z-index: 9999;
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid #e2e8f0;
    }
    .jahat-topbar-menu {
        color: #3b82f6;
        cursor: pointer;
        display: flex;
        align-items: center;
    }
    .jahat-topbar-logo img {
        max-height: 40px;
        width: auto;
    }
}
/* ==========================================================================
   📱 فیکس قطعی و قدرتمند فاصله ها و مارجین های موبایل (ضد بازنویسی قالب)
========================================================================== */
@media (max-width: 768px) {
    
    /* اجبار به صفر کردن مارجین‌ها با بالاترین ارجحیت */
    html body.woocommerce-account .size, 
    html body.woocommerce-account .woocommerce,
    body.woocommerce-account div.size,
    body.woocommerce-account div.woocommerce {
        margin-top: 10px !important;
        padding-top: 0 !important;
    }

    html body.woocommerce-account .woocommerce-MyAccount-content,
    body.woocommerce-account div.woocommerce-MyAccount-content {
        margin-top: 0px !important;
        padding-top: 0px !important;
    }
    
    /* فیکس ساختار هدر موبایل در بالاترین لایه */
    .jahat-mobile-topbar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background: #ffffff !important;
        padding: 10px 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }
    .jahat-topbar-logo {
        order: 1 !important;
    }
    .jahat-topbar-logo img {
        max-height: 35px !important;
        width: auto !important;
        display: block !important;
    }
    .jahat-topbar-menu {
        order: 2 !important;
        cursor: pointer !important;
        padding: 5px !important;
    }
}

/* ==========================================================================
   📱 فیکس قطعی عرض صفحه و فواصل باکس‌های پیشخوان در موبایل
========================================================================== */
@media only screen and (max-width: 768px) {
    
    /* باز کردن عرض ستون‌های مادر قالب در موبایل */
    body.woocommerce-account .pro-1-1,
    body.woocommerce-account .pro-1-2,
    body.woocommerce-account .size {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* تنظیم دقیق پدینگ ۱۰ پیکسلی از چپ و راست برای باکس اصلی پیشخوان */
    body.woocommerce-account .woocommerce-MyAccount-content,
    body.woocommerce-account .box-asli-user {
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}