/* =========================================
   ساختار اصلی پنل
   ========================================= */
:root {
    --upc-green-gradient: linear-gradient(135deg, #27ae60, #1e8449);
    --upc-green-shadow: 0 3px 10px rgba(39, 174, 96, .3);
    --upc-bg-dark: #212121;
    --upc-bg-darker: #1e1e1e;
    --upc-bg-card: #2b2b2b;
    --upc-text-muted: #b4b4b4;
}

.upc-panel-wrapper { 
    display: flex;
    color: #fff;
    min-height: 600px; 
    border-radius: 16px;
    overflow: hidden; 
    gap: 20px;
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
}

.upc-panel-wrapper *, .upc-panel-wrapper *::before, .upc-panel-wrapper *::after {
    box-sizing: border-box;
}

/* =========================================
   سایدبار
   ========================================= */
.upc-sidebar { 
    width: 335px; 
    flex-shrink: 0;
    background: var(--upc-bg-dark);
    padding: 25px 0; 
    text-align: center;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.entry-content ul, .entry-content ol {
    padding-right: 0;
}

/* --- عکس پروفایل --- */
.upc-avatar-section {
    padding: 0 20px 20px;
    border-bottom: 1px solid #333;
}

.upc-avatar-wrapper { 
    position: relative;
    width: 110px;
    height: 110px;
    margin: 0 auto; 
    border: 3px solid #27ae60;
    border-radius: 50%; 
    padding: 4px; 
    box-shadow: var(--upc-green-shadow);
}

.upc-avatar-wrapper img {
    width: 80px !important; 
    height: 80px !important; 
    border-radius: 50% !important; 
    object-fit: cover;
    display: block;
}

/* دکمه آپلود (پلاس) */
.upc-upload-btn { 
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--upc-green-gradient); 
    width: 34px;
    height: 34px;
    border-radius: 50%; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    cursor: pointer;
    border: 3px solid var(--upc-bg-dark); 
    transition: 0.3s;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    font-family: Arial, sans-serif;
    box-shadow: var(--upc-green-shadow);
    z-index: 10;
}

.upc-upload-btn:hover {
    transform: scale(1.1);
}

.upc-avatar-section h3 {
    margin: 15px 0 0;
    font-size: 16px;
    color: #fff;
}

/* --- منوی تب‌ها --- */
.upc-tabs-nav { 
    list-style: none; 
    padding: 15px 10px; 
    margin: 0; 
    text-align: right; 
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.upc-tab-item { 
    padding: 12px 15px; 
    cursor: pointer; 
    border-radius: 10px; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    color: var(--upc-text-muted);
    font-size: 15px;
    border-right: 3px solid transparent;
}

.upc-tab-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.upc-tab-item:hover {
    background: var(--upc-bg-card);
    color: #fff;
}

.upc-tab-item.active { 
    background: var(--upc-bg-card);
    color: #fff; 
    font-weight: bold;
    border-right: 3px solid #27ae60;
    box-shadow: var(--upc-green-shadow);
}

/* =========================================
   ناحیه محتوا
   ========================================= */
.upc-content-area { 
    flex: 1; 
    min-width: 0;
    padding: 1.5em;
    background: var(--upc-bg-dark); 
    border-radius: 16px;
    overflow-x: hidden;
}

/* اصلاح تداخل display */
.upc-tab-content { 
    display: none;
    animation: fadeIn 0.4s ease;
    flex-direction: column;
    gap: 10px;
}

.upc-tab-content.active {
    display: flex; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* فرم‌های داخل محتوا */
.upc-tab-content input[type="text"], 
.upc-tab-content input[type="email"],
.upc-tab-content input[type="password"] { 
    width: 100%; 
    padding: 12px 15px; 
    margin-top: 5px; 
    border-radius: 25px; 
    border: 1px solid #444; 
    background: var(--upc-bg-card); 
    color: #fff;
    outline: none;
    transition: 0.3s;
}

.upc-tab-content input:focus {
    border-color: #27ae60;
    background: #333;
    box-shadow: var(--upc-green-shadow);
}

/* دکمه اصلی */
.upc-btn, .upc-content-area .button , .upc-content-area .upc-btn ,a.tab-btn{ 
    background: var(--upc-green-gradient) !important; 
    color: #fff !important; 
    border: none; 
    padding: 8px 30px !important; 
    border-radius: 50px !important; 
    cursor: pointer; 
    margin-top: 5px; 
    font-size: 15px; 
    transition: 0.3s;
    box-shadow: var(--upc-green-shadow) !important;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    font-weight: 400;
}

.upc-btn:hover, .button:hover { 
    transform: translateY(-2px);
    filter: brightness(0.95);
}

/* =========================================
   استایل‌های اختصاصی شورت‌کد دوره‌ها (Purchased Courses)
   ========================================= */
.accordion-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.accordion-title {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    padding: 15px 0 !important;
    border-radius: 16px;
    align-items: center;
    color: var(--upc-text-muted);
    background: #2b2b2b;
    margin-bottom: 15px;
}

.accordion-title img {
    margin: 0 10px;
    border-radius: 5px;
}

.accordion-content {
    display: none;
}

.downloadLink {
    padding: 10px 20px;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: transparent;
    color: inherit;
}

.downloadLink:hover {
    color: #fff !important;
}

.rotated {
    transform: rotate(-90deg);
}

.sessionItem {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
    direction: ltr;
}

.playBtn {
    width: 58px;
    height: 50px;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #161616;
    color: #fff !important;
    border-radius: 30px 0 0 30px;
    text-decoration: none;
    transition: .3s;
    font-size: 15px;
}

.playBtn span {
    font-size: 14px;
    margin-right: 5px;
}

.downBtn {
    width: 58px;
    height: 50px;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #161616;
    color: #fff !important;
    border-radius: 0 30px 30px 0;
    text-decoration: none;
    transition: .3s;
    font-size: 15px;
    gap: 5px;
}

.downloadBtn,
.downloadBtn:hover {
    flex: 1;
    height: 50px;
    background: #2b2b2b !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    gap: 12px;
    text-decoration: none;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    transition: .3s;
}

.downloadBtn i {
    font-size: 18px;
    color: #fff;
}

.next-step-banner {
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 20px auto;
    font-family: inherit;
    background: var(--upc-green-gradient) !important;
    box-shadow: var(--upc-green-shadow) !important;
}

/* =========================================
   استایل تب سبد خرید (My Cart Tab)
   ========================================= */
.my-cart-tab-wrapper {
    background: var(--upc-bg-dark);
    margin: 0;
    font-family: inherit;
    direction: rtl;
    border-radius: 16px;
    box-sizing: border-box;
}

.my-cart-tab-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.my-cart-tab-icon {
    font-size: 22px;
    color: #27ae60;
}

.my-cart-tab-title {
    color: var(--upc-text-muted);
    font-size: 16px;
    font-weight: 700;
}

.my-cart-tab-badge {
    background: var(--upc-green-gradient);
    color: #fff;
    font-size: 12px;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50px;
    padding: 0 8px;
    box-shadow: var(--upc-green-shadow);
}

.my-cart-tab-body {
    margin-top: 6px;
}

.my-cart-tab-status {
    color: var(--upc-text-muted);
    font-size: 14px;
    margin: 0 0 14px 0;
    opacity: 0.9;
}

.my-cart-tab-wrapper .my-cart-tab-status {
    color: #27ae60 !important;
    text-shadow: 0 3px 10px rgba(39, 174, 96, .3);
}

a.tab-btn:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

/* =========================================
   استایل و رسپانسیو جدول سفارشات (تفکیک شده)
   ========================================= */

.upc-content-area table.upc-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--upc-bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    color: #fff;
    font-family: inherit;
    border: 1px solid #333 !important;
}

.upc-content-area table.upc-orders-table thead th {
    background: #1a1a1a;
    color: var(--upc-text-muted);
    font-weight: 700;
    padding: 18px 15px;
    border-bottom: 2px solid #333;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.upc-content-area table.upc-orders-table tbody td {
    padding: 16px 15px;
    border-bottom: 1px solid #333;
    text-align: center;
    font-size: 14px;
    color: #e0e0e7;
    transition: all 0.3s ease;
    vertical-align: middle;
    line-height: 1.6;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
}

.upc-content-area table.upc-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.upc-content-area table.upc-orders-table tbody tr {
    transition: background 0.3s ease;
}

.upc-content-area table.upc-orders-table tbody tr:hover {
    background: rgba(39, 174, 96, 0.08);
}

/* استایل ستون شماره سفارش */
.upc-content-area table.upc-orders-table tbody td:nth-child(1) {
    font-family: monospace;
    font-weight: bold;
    color: #27ae60;
    font-size: 15px;
}

/* استایل ستون مبلغ */
.upc-content-area table.upc-orders-table tbody td:nth-child(4) {
    font-weight: 800;
    color: #fff;
}

/* =========================================
   📱 ریسپانسیو کامل (تبلت و موبایل)
   ========================================= */

/* --- تبلت (حداکثر 992px) --- */
@media (max-width: 992px) {
    .upc-sidebar { 
        width: 260px; 
    }
    .upc-content-area {
        padding: 20px;
    }
}

/* --- موبایل (حداکثر 768px) --- */
@media (max-width: 768px) {
    .upc-panel-wrapper { 
        flex-direction: column;
        gap: 15px;
        border-radius: 12px;
        min-height: auto;
        overflow: visible; /* برای استیکی شدن تب‌ها */
    }

    /* تبدیل سایدبار به حالت بالا */
    .upc-sidebar { 
        width: 100%; 
        padding: 20px 0 0 0; /* پدینگ پایین صفر تا تب به لبه بچسبد */
        border-radius: 12px;
        overflow: visible; /* برای استیکی شدن تب‌ها */
    }

    .upc-avatar-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px 20px;
        text-align: right;
        gap: 15px;
        border-bottom: none;
    }

    .upc-avatar-wrapper {
        width: 80px;
        height: 80px;
        margin: 0;
        flex-shrink: 0;
    }

    .upc-avatar-section h3 {
        margin: 0;
        font-size: 15px;
    }

    /* 🌟 فیکس شدن نوار تب‌ها در موبایل */
    .upc-tabs-nav { 
        position: -webkit-sticky;
        position: sticky;
        top: 0; 
        z-index: 999; 
        
        flex-direction: row;
        padding: 12px 10px;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        
        background: var(--upc-bg-dark);
        border-top: 1px solid #333;
        border-bottom: 1px solid #333;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        
        margin: 0 -1px; 
    }

    .upc-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    .upc-tab-item { 
        flex-direction: column;
        padding: 8px 15px;
        font-size: 13px;
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
        gap: 5px;
        min-width: 90px;
        justify-content: center;
        text-align: center;
        background: transparent;
        box-shadow: none;
    }

    .upc-tab-item i {
        font-size: 20px;
    }

    .upc-tab-item.active {
        border-right: none;
        border-bottom: 3px solid #27ae60;
        background: var(--upc-bg-card);
        color: #fff;
    }

    .upc-content-area { 
        padding: 15px !important; 
        border-radius: 12px;
        width: 100%;
        margin-top: 10px;
    }

    /* ریسپانسیو دوره‌ها */
    .playBtn, .downBtn {
        width: 85px !important;
        height: 50px;
        min-width: 70px;
    }
    .downloadBtn {
        height: 50px;
        font-size: 14px;
    }
    .accordion-title {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        background: transparent !important;
        padding: 10px !important;
    }
    .downloadLink {
        background: #2b2b2b;
        color: #fff !important;
        border-radius: 50px;
        width: 100%;
        height: 50px;
        border: none;
        justify-content: center;
    }

    /* =========================================
       رسپانسیو جدول سفارشات (تبدیل به کارت)
       ========================================= */
    .upc-content-area table.upc-orders-table thead {
        display: none;
    }

    .upc-content-area table.upc-orders-table {
        display: block;
        width: 100%;
        background: transparent;
        box-shadow: none;
        border: none !important; 
        margin-top: 0;
    }

    .upc-content-area table.upc-orders-table tbody {
        display: block;
        width: 100%;
    }

    .upc-content-area table.upc-orders-table tbody tr {
        display: flex;
        flex-direction: column;
        background: var(--upc-bg-card);
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 15px;
        border: 1px solid #444;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        width: 100%;
        box-sizing: border-box;
    }

    .upc-content-area table.upc-orders-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 12px 0;
        border-bottom: 1px dashed #444;
        width: 100%;
        box-sizing: border-box;
    }

    .upc-content-area table.upc-orders-table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .upc-content-area table.upc-orders-table tbody td:first-child {
        padding-top: 0;
        border-bottom: 1px solid #444;
        margin-bottom: 5px;
        padding-bottom: 15px;
        font-size: 16px;
    }

    .upc-content-area table.upc-orders-table tbody td::before {
        font-weight: bold;
        color: var(--upc-text-muted);
        font-size: 13px;
        margin-left: 15px;
    }

    .upc-content-area table.upc-orders-table tbody td:nth-child(1)::before { content: "شماره سفارش:"; }
    .upc-content-area table.upc-orders-table tbody td:nth-child(2)::before { content: "محصول:"; }
    .upc-content-area table.upc-orders-table tbody td:nth-child(3)::before { content: "تاریخ:"; }
    .upc-content-area table.upc-orders-table tbody td:nth-child(4)::before { content: "مبلغ کل:"; }
    .upc-content-area table.upc-orders-table tbody td:nth-child(5)::before { content: "وضعیت:"; }
}

/* --- موبایل کوچک (حداکثر 480px) --- */
@media (max-width: 480px) {
    .upc-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .upc-avatar-wrapper {
        width: 90px;
        height: 90px;
    }

    .upc-tab-item {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .upc-tab-item i {
        font-size: 18px;
    }

    .upc-content-area {
        padding: 15px 20px  !important;
        min-height: 60vh;
    }
}

.upc-form-actions { 
    margin-top: 20px;
}

/* استایل فیلدهای پسورد و آیکون چشم */
.upc-password-wrapper {
    position: relative;
    width: 100%;
}

.upc-password-wrapper input {
    padding-left: 45px !important; 
}

.upc-toggle-password {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    transition: 0.3s;
}

.upc-toggle-password:hover {
    color: #fff;
}