﻿/* ========================= */
/* MODAL (پاپ‌آپ‌ها) */
/* ========================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

.modal-content {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 600px;
    width: 95%;
    background: var(--popup-bg); /* هماهنگ با پس‌زمینه پاپ‌آپ تم‌ها */
    color: var(--text-dynamic); /* متن‌های popup */
    transition: var(--transition);
}

.close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface-alt); /* هماهنگ با تم */
    color: var(--text-dynamic); /* هماهنگ با رنگ نوشته داینامیک */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: end;
    color: var(--text-dynamic); /* رنگ title ها */
    margin-top: 25px;
}

.modal-text {
    line-height: 2.1;
    font-size: 14px;
    color: var(--text-dynamic); /* رنگ متن پاپ‌آپ */
}


/* ========================= */
/* LEVELS & CARDS (سطوح کاربری) */
/* ========================= */

.hidden {
    display: none;
}

.level-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.level-card {
    min-height: 10vh;
    padding: 12px;
    border-radius: 18px;
    color: var(--text-dynamic); /* تبعیت از سیستم رنگ نوشته */
    border: 1px solid var(--border-color); /* بوردر داینامیک */
    direction: ltr;
    position: relative;
}

    .level-card h3 {
        margin-bottom: 8px;
        color: var(--text-dynamic);
    }

    .level-card p {
        font-size: 13px;
        color: var(--text-dynamic);
        opacity: 0.8;
        line-height: 1.8;
    }

.level-price {
    margin-top: 12px;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-dynamic);
}

/* دکمه‌های سطوح */
.level-btn {
    margin-top: 5px;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    font-weight: bold;
    background: var(--btn-success); /* رنگ دکمه successfully */
    color: #fff; /* متن دکمه عملیاتی سفید ثابت برای خوانایی */
}

/* وضعیت‌های مختلف سطوح کاربری (رنگ‌های بهینه بر اساس تم) */

/* غیر فعال */
.level-disabled {
    background: var(--btn-disabled) !important;
    opacity: .4;
    pointer-events: none;
}

/* سطح فعلی (طلایی شیک) */
.level-current {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    border: 2px solid #fff;
    color: #000 !important; /* متن مشکی برای خوانایی روی طلایی */
}

    .level-current h3, .level-current p, .level-current .level-price {
        color: #000 !important;
    }

/* قابل خرید */
.level-buy {
    background: var(--btn-confirm); /* هماهنگ با دکمه تایید تم */
}

/* مدرس */
.level-teacher {
    background: var(--btn-check); /* هماهنگ با رنگ دکمه بررسی */
}

/* هوش مصنوعی / ادمین */
.level-admin, .level-master {
    background: #7c3aed; /* رنگ بنفش ثابت مد نظر شما */
}

.level-card h3 {
    position: absolute;
    right: 5%;
}


/* ========================= */
/* BUTTONS & TABS (دکمه‌ها و تب‌ها) */
/* ========================= */

/* دکمه خروج */
.logout-btn {
    padding: 10px;
    border-radius: 9px;
    border: none;
    background-color: var(--btn-danger); /* هماهنگ با رنگ دکمه خروج/danger در تم‌ها */
    color: #ffffff; /* رنگ نوشته دکمه */
    font-weight: bold;
    font-size: medium;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    width: fit-content;
}

    .logout-btn:hover {
        opacity: 0.9;
    }

/* تب‌های لاگین */
.tab-login {
    width: 50%;
    color: var(--text-dynamic);
    background-color: var(--surface-alt); /* هماهنگ با استایل اینپوت و سلکت تم */
    border: solid 1px var(--border-color);
    padding: 10px;
    cursor: pointer;
}

.activeTab {
    width: 50%;
    color: var(--text-dynamic);
    background-color: var(--btn-confirm); /* هماهنگ با تب یا دکمه فعال تم */
    border: solid 1px var(--border-color);
    padding: 10px;
    cursor: pointer;
}


/* ========================= */
/* LOCKED CARDS (کارت‌های قفل شده) */
/* ========================= */

.locked-card {
    filter: grayscale(80%) blur(1px);
    position: relative;
}

.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 80px;
    color: var(--text-dynamic); /* هماهنگ با رنگ نوشته انتخابی */
    background: rgba(0, 0, 0, 0.4); /* ماسک تیره روی کارت */
    z-index: 10;
    border-radius: inherit;
}
#levelModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

    #levelModal .modal-content {
        width: min(700px,100%);
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
    }