/* ---------------- ویجت فرم (مشترک بین شورت‌کد و پاپ‌آپ) ---------------- */

.aoa-widget {
    max-width: 380px;
    margin: 0 auto;
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    direction: rtl;
    text-align: right;
}

.aoa-step p {
    margin: 0 0 14px;
}

.aoa-step label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.aoa-step input[type="text"],
.aoa-step input[type="tel"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 12px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    box-sizing: border-box !important;
    font-size: 15px;
    direction: rtl;
    text-align: right;
}

.aoa-step input[type="text"]:focus,
.aoa-step input[type="tel"]:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.aoa-widget .aoa-btn {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 13px !important;
    margin: 0 !important;
    float: none !important;
    border: none !important;
    border-radius: 10px !important;
    background: #000 !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: normal !important;
    text-align: center !important;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.aoa-widget .aoa-btn:hover {
    opacity: 0.85;
    color: #fff !important;
}

.aoa-widget .aoa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.aoa-widget .aoa-step,
.aoa-widget .aoa-step p {
    float: none !important;
    width: auto !important;
}

.aoa-switch {
    text-align: center;
    font-size: 13px;
    margin-top: 16px !important;
    color: #555;
}

.aoa-switch a,
.aoa-back-link {
    color: #000;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.aoa-hint {
    font-size: 13px;
    color: #555;
    margin-bottom: 18px !important;
    text-align: center;
}

.aoa-notice {
    background: #f3f4f6;
    border: 1px solid #e2e4e8;
    color: #333;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: center;
}

.aoa-error {
    color: #c0392b;
    font-size: 13px;
    background: #fdecea;
    border: 1px solid #f5c6c0;
    border-radius: 10px;
    padding: 8px 12px;
}

/* ---------------- پاپ‌آپ ---------------- */

.aoa-popup-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.aoa-popup-overlay.aoa-popup-visible {
    display: flex !important;
}

.aoa-popup-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: visible;
}

.aoa-popup-box .aoa-widget {
    margin: 0 auto;
}

.aoa-dismiss-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.3) !important;
}

/* قفل اسکرول پس‌زمینه عمداً غیرفعال است */

/* دکمه بستن داخل فرم سفید */
.aoa-popup-box .aoa-dismiss-btn {
    all: unset;
    box-sizing: border-box;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    z-index: 20;
}

.aoa-popup-box .aoa-dismiss-btn svg {
    display: block;
    pointer-events: none;
}

.aoa-popup-box .aoa-dismiss-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 14px rgba(0,0,0,.25) !important;
}

/* وقتی کاربر لاگین‌نشده در صفحه‌ی Checkout است، پاپ‌آپ قفل است و دکمه‌ی
   بستن اصلاً نمایش داده نمی‌شود؛ تنها راه، تکمیل ورود/ثبت‌نام است. */
.aoa-popup-overlay.aoa-popup-locked .aoa-dismiss-btn {
    display: none;
}

/* ==========================================================
 * منوی کشویی «حساب کاربری» هدر (شورت‌کد [academy_account_menu])
 * ========================================================== */

.aoa-acc-menu {
    position: relative;
    display: inline-block;
    direction: rtl;
    font-family: inherit;
    line-height: 1;
    vertical-align: middle;
}

.aoa-acc-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 6px 2px !important;
    margin: 0 !important;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    max-width: 100%;
}

.aoa-acc-toggle .aoa-acc-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
	color: #FFFFFF;
}

.aoa-acc-toggle .aoa-acc-chevron {
    flex-shrink: 0;
    color: #FFFFFF;
    transition: transform 0.15s ease;
}

.aoa-acc-menu.aoa-acc-open .aoa-acc-chevron {
    transform: rotate(180deg);
}

.aoa-acc-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 10px;
    min-width: 190px;
    background: #454545;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    z-index: 999998;
    direction: rtl;
    text-align: right;
}

.aoa-acc-menu.aoa-acc-open .aoa-acc-dropdown {
    display: block;
}

.aoa-acc-item {
    display: block;
    padding: 11px 16px;
    font-size: 13px;
    font-weight: 400;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease;
}

.aoa-acc-item:last-child {
    border-bottom: none;
}

.aoa-acc-item:hover,
.aoa-acc-item:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.aoa-acc-item-danger {
    color: #ff9b9b !important;
}

.aoa-acc-item-danger:hover {
    color: #ffb3b3 !important;
}

/* نمایش موبایل: جمع‌وجورتر برای قرارگیری در هدر بالا */
@media (max-width: 600px) {
    .aoa-acc-toggle {
        font-size: 12px !important;
        gap: 4px;
    }
    .aoa-acc-toggle .aoa-acc-label {
        max-width: 130px;
    }
    .aoa-acc-dropdown {
        min-width: 160px;
        margin-top: 8px;
    }
    .aoa-acc-item {
        padding: 9px 12px;
        font-size: 12px;
    }
}

/* ==========================================================
 * شورت‌کد [academy_my_courses] — لیست دوره‌های LearnDash کاربر
 * ========================================================== */

.aoa-my-courses {
    direction: rtl;
    text-align: right;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.aoa-my-courses-empty {
    background: #f3f4f6;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #555;
}

.aoa-course-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.aoa-course-thumb {
    width: 100%;
    padding-top: 56%;
    background-size: cover;
    background-position: center;
    background-color: #eee;
}

.aoa-course-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aoa-course-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
}

.aoa-course-progress-bar {
    background: #eee;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.aoa-course-progress-fill {
    background: #000;
    height: 100%;
    border-radius: 6px;
}

.aoa-course-progress-label {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.aoa-course-btn {
    display: block;
    text-align: center;
    margin-top: 4px;
    padding: 10px;
    background: #000;
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.15s ease;
}

.aoa-course-btn:hover {
    opacity: 0.85;
}

/* ---------------- کنترل دسترسی: انتخاب دستگاه برای حذف (داخل پاپ‌آپ/فرم) ---------------- */

.aoa-dev-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.aoa-dev-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin: 0 0 10px;
    border: 1px solid #e2e4e8;
    border-radius: 10px;
    background: #fafafa;
}

.aoa-dev-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aoa-dev-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.aoa-dev-last {
    font-size: 12px;
    color: #667085;
}

.aoa-widget .aoa-dev-remove,
.aoa-my-devices .aoa-md-remove {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 8px;
    background: #fff;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    line-height: normal;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.aoa-widget .aoa-dev-remove:hover:not(:disabled),
.aoa-my-devices .aoa-md-remove:hover:not(:disabled) {
    background: #000;
    color: #fff;
}

.aoa-widget .aoa-dev-remove:disabled,
.aoa-my-devices .aoa-md-remove:disabled,
.aoa-my-devices .aoa-md-logout-all:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.aoa-dev-meta {
    font-size: 12px;
    color: #555;
    text-align: center;
}

/* ---------------- صفحه‌ی «دستگاه‌های من» ([academy_my_devices]) ---------------- */

.aoa-my-devices {
    max-width: 560px;
    margin: 0 auto;
    direction: rtl;
    text-align: right;
}

.aoa-my-devices .aoa-md-summary {
    font-size: 14px;
    margin: 0 0 6px;
}

.aoa-my-devices .aoa-md-hint {
    font-size: 12px;
    color: #667085;
    margin: 0 0 14px;
}

.aoa-md-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    margin: 0 0 10px;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    background: #fff;
}

.aoa-md-item.aoa-md-current {
    border-color: #000;
}

.aoa-md-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.aoa-md-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.aoa-md-last {
    font-size: 12px;
    color: #667085;
}

.aoa-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: #000;
    color: #fff;
    font-size: 11px;
}

.aoa-my-devices .aoa-md-logout-all {
    margin-top: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #000;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.aoa-my-devices .aoa-md-error {
    margin: 10px 0;
}

/* ---------------- پیام شناور (هشدار / دلیل خروج) ---------------- */

.aoa-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 440px;
    margin: 0 auto;
    padding: 14px 40px 14px 16px;
    background: #222;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    direction: rtl;
    text-align: right;
    font-size: 13px;
    line-height: 1.8;
    z-index: 1000000;
}

.aoa-toast p {
    margin: 0;
    color: inherit;
}

.aoa-toast.aoa-toast-warn {
    background: #7a4a00;
}

.aoa-toast .aoa-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
