* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

h1 {
    font-size: 2.8rem;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.courses-section {
    flex: 1;
    min-width: 300px;
    background: rgba(0, 15, 46, 0.7);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.pdf-section {
    flex: 2;
    min-width: 500px;
    background: rgba(0, 15, 46, 0.7);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00c6ff;
}

.course-list {
    list-style: none;
}

.course-item {
    background: rgba(0, 40, 85, 0.6);
    margin-bottom: 15px;
    padding: 18px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.course-item:hover, .course-item.active {
    background: rgba(0, 60, 120, 0.8);
    transform: translateX(5px);
}

.pdf-container {
    flex: 1;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 30, 60, 0.7);
    border-bottom: 1px solid rgba(0, 198, 255, 0.3);
}

.pdf-controls button {
    background: rgba(0, 150, 255, 0.7);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.pdf-controls button:hover {
    background: rgba(0, 180, 255, 0.9);
}

.pdf-viewer-container {
    flex: 1;
    position: relative;
    overflow: auto;
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #333;
}

.no-pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.protection-info {
    background: rgba(200, 0, 0, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.5);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

/* --- Fullscreen Styles --- */
.close-maximize {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

body.is-maximized {
    padding: 0;
    overflow: hidden;
}

body.is-maximized .container {
    max-width: 100%;
    height: 100vh;
    padding: 0;
}

body.is-maximized header,
body.is-maximized .courses-section,
body.is-maximized footer,
body.is-maximized .protection-info,
body.is-maximized .section-title {
    display: none;
}

body.is-maximized .pdf-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    padding: 0;
    border-radius: 0;
}

body.is-maximized .pdf-container {
    border-radius: 0;
}

body.is-maximized .close-maximize {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Protection (General overlay, for random elements) */
.content-protection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

/* Access Blocked Page */
.access-blocked {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460);
    display: none; /* Initially hidden */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    text-align: center;
    padding: 20px;
}

.block-icon {
    font-size: 5rem;
    color: #ff4d4d;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.block-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ff9999;
}

.block-message {
    font-size: 1.3rem;
    max-width: 600px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.block-button {
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
}

.block-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 65, 108, 0.6);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}



/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    /* 💥 MODIFICATION: Base z-index برای تمام مُدال‌ها */
    z-index: 100000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

/* 💥 ADDED: z-index stacking برای مُدال‌های ورود/بازیابی رمز عبور */
/* این تضمین می‌کند که آنها روی سایر مُدال‌ها مانند #accessOptionsModal ظاهر می‌شوند. */
#authModal {
    z-index: 100001;
}

#forgotPasswordModal {
    z-index: 100002;
}

#verifyResetModal {
    z-index: 100003;
}
/* 💥 END ADDITION */

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    position: relative;
    color: #333;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.tab-container {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 17px;
    flex-grow: 1;
    text-align: center;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #ccc;
    border-bottom: 3px solid #00c6ff;
}

.tab-content {
    display: none;
    padding: 6px 12px;
    border-top: none;
}

.tab-content.active {
    display: block;
}

.modal-form-group {
    margin-bottom: 15px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.modal-submit-button {
    background-color: #00c6ff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    transition: background-color 0.3s ease;
}

.modal-submit-button:hover {
    background-color: #0099cc;
}

.view-question-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: auto;
    font-size: 0.9rem;
}

.view-question-button:hover {
    background-color: #0056b3;
}
/* ================= Anti-Screenshot Moving Shapes ================= */
.anti-screenshot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000; /* بالاتر از همه عناصر به جز مودال و صفحه قفل */
    overflow: hidden;
}

.anti-screenshot-shape {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 10000;
}

/* انیمیشن‌های حرکت */
@keyframes float0 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(100px, 50px); }
    50% { transform: translate(50px, 100px); }
    75% { transform: translate(-100px, 50px); }
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(150px, -100px) rotate(180deg); }
}

@keyframes float2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(300px); }
}

/* انواع اشکال */
.anti-screenshot-shape:nth-child(3n) {
    border-radius: 50%;
    background: rgba(01, 180, 255, 0.8);
}

.anti-screenshot-shape:nth-child(3n+1) {
    border-radius: 50%;
    background: rgba(01, 180, 255, 0.8);
}

.anti-screenshot-shape:nth-child(3n+2) {
    border-radius: 50%;
    background: rgba(01, 180, 255, 0.8);
}


/* Styles for Device Manager Panel */

.simple-button {
    background-color: rgba(0, 123, 255, 0.8);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

.simple-button:hover {
    background-color: rgba(0, 100, 220, 1);
}

.device-list-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.device-info .this-device-tag {
    background-color: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.remove-device-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-device-btn:hover {
    background-color: #c82333;
}

.remove-device-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
/* Welcome Message Style */
.welcome-message {
    color: #00e1ff;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
    height: 22px; /* اختصاص فضا برای جلوگیری از پرش صفحه */
    text-shadow: 0 0 5px rgba(0, 225, 255, 0.5);
    text-align: center;
}

/* User Actions Container in Footer */
.user-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.user-actions .logout-btn {
    background-color: rgba(220, 53, 69, 0.8);
}

.user-actions .logout-btn:hover {
    background-color: rgba(200, 35, 50, 1);
}
/* Custom Alert/Toast Styles */
.custom-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 100001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, top 0.3s, visibility 0.3s;
    font-size: 1.1rem;
}

.custom-toast.show {
    top: 50px;
    opacity: 1;
    visibility: visible;
}

.custom-toast.error {
    background-color: #dc3545;
}

.custom-toast.success {
    background-color: #28a745;
}
/* ===== 1. Developer Link Styles ===== */

.developer-link {
    color: #ffeb3b !important; /* رنگ زرد طلایی برای تضاد بهتر */
    text-decoration: none; /* حذف خط زیر لینک */
    font-weight: bold; /* پررنگ کردن متن */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* سایه متن برای خوانایی */
    padding: 5px 10px; /* ایجاد کمی فاصله داخلی */
    border-radius: 5px; /* گرد کردن گوشه‌ها */
    transition: all 0.3s ease; /* انیمیشن نرم برای تغییرات */
}

.developer-link:hover {
    color: #ffffff !important; /* تغییر رنگ متن به سفید هنگام هاور */
    background-color: rgba(255, 235, 59, 0.2); /* پس‌زمینه نیمه‌شفاف زرد */
    transform: translateY(-2px); /* کمی حرکت به بالا */
}


/* ===== 2. Responsive Design for Mobile Devices ===== */
/* این قوانین زمانی اعمال می‌شوند که عرض صفحه نمایش 768 پیکسل یا کمتر باشد */

@media (max-width: 768px) {
    body {
        padding: 10px; /* کاهش فاصله از اطراف در موبایل */
    }

    h1 {
        font-size: 2rem; /* کوچک کردن عنوان اصلی */
    }

    .main-content {
        flex-direction: column; /* بخش لیست دروس و نمایش PDF زیر هم قرار می‌گیرند */
        gap: 20px;
    }

    .courses-section,
    .pdf-section {
        min-width: 100%; /* عرض کامل صفحه را اشغال می‌کنند */
        padding: 15px;
    }

    .section-title {
        font-size: 1.5rem; /* کوچک کردن عناوین بخش‌ها */
    }

    .course-item {
        padding: 15px;
        flex-wrap: wrap; /* اجازه شکستن خط در آیتم‌های دروس */
    }

    .view-question-button {
        margin-top: 10px;
        width: 100%; /* دکمه مشاهده تمام عرض را بگیرد */
        text-align: center;
    }

    .modal-content {
        width: 95%; /* مودال‌ها کمی پهن‌تر شوند تا بهتر دیده شوند */
    }

    .protection-info h4 {
        font-size: 0.9rem; /* کوچک کردن متن اخطار */
    }
}

/* Payment Modal Styles */
.card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 1.3rem;
    direction: ltr;
    border: 2px dashed #adb5bd;
}

.card-info button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}
/* Unique Price Style */
.unique-price {
    color: #dc3545;
    font-size: 1.3rem;
    background-color:#fff3cd;
    padding: 0px 3px;
    border-radius: 0px;
    border: 0px solid #ffeeba;
}
/* ===== Advanced & Secure Watermark Styles ===== */

.watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.watermark-text {
    position: absolute;
    /* اندازه فونت واکنش‌گرا: ۲.۵٪ از عرض صفحه نمایش */
    font-size: 2.5vw; 
    font-weight: 600; /* کمی ضخیم‌تر */
    color: rgba(255,255,255, 1); /* رنگ سفید خالص */
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    /* افزایش کدری برای ناخوانا کردن اسکرین‌شات */
    opacity: 0.9; 
    /* افزودن سایه برای سخت‌تر کردن حذف واترمارک در نرم‌افزارهای ویرایش عکس */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6); 
}

/* در صفحه‌های کوچک‌تر (موبایل)، فونت را کمی بزرگتر می‌کنیم تا خواناتر باشد */
@media (max-width: 768px) {
    .watermark-text {
        font-size: 4.5vw;
        opacity: 0.9; /* در موبایل کمی شفاف‌تر می‌کنیم تا مزاحم خواندن نباشد */
    }
}
/* New Styles for Filter & Search Interface */
.filter-section {
    width: 100%;
    background: rgba(0, 15, 46, 0.7);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}
.search-container { margin-bottom: 30px; }
.search-form { display: flex; gap: 10px; }
.search-form input {
    flex-grow: 1;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid rgba(0, 198, 255, 0.5);
    background-color: rgba(0, 30, 60, 0.7);
    color: white;
    font-size: 1.1rem;
    direction: ltr;
    text-align: center;
}
.search-form button {
    padding: 0 25px;
    border-radius: 8px;
    border: none;
    background-color: #00c6ff;
    color: white;
    font-weight: bold;
    cursor: pointer;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.filter-grid select {
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 40, 85, 0.6);
    color: white;
    border: 1px solid rgba(0, 198, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
}
.filter-grid select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* =================================================== */
/* بخش اصلاح شده چیدمان نتیجه جستجو          */
/* =================================================== */

.result-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center; /* تراز عمودی آیتم‌ها در یک ردیف */
    gap: 20px; /* فاصله بین آیتم‌ها */
    flex-wrap: wrap; /* 👈 مهم: اجازه می‌دهد آیتم‌ها به خط بعدی بشکنند */
}

.resource-result {
    flex-grow: 1; /* کادر توضیحات تا جای ممکن رشد می‌کند */
    flex-basis: 300px; /* حداقل عرض پایه قبل از رشد کردن */
    background-color: rgba(0,0,0,0.2);
    padding: 15px; /* کمی پدینگ بیشتر */
    border-radius: 8px;
    line-height: 1.7; /* فاصله خطوط خواناتر */
}

.view-resource-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0; /* 👈 مهم: جلوگیری از کوچک شدن دکمه */
    white-space: nowrap; /* جلوگیری از شکستن متن دکمه */
}

.view-resource-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 👈 استایل جدید برای متن راهنما (توجه) */
.resource-hint {
    width: 100%; /* کل عرض را اشغال می‌کند */
    flex-basis: 100%; /* اطمینان از اینکه همیشه در یک خط جداگانه است */
    margin-top: 15px; /* فاصله از ردیف بالایی */
    background-color: rgba(0, 30, 60, 0.7); /* پس‌زمینه همرنگ با فیلتر */
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem; /* کمی بزرگتر برای خوانایی */
    text-align: center;
    line-height: 1.6;
}

.resource-hint i {
    color: #00c6ff; /* رنگ آیکون‌ها */
}
/* Login Button Container */
.login-btn-container {
    position: absolute;
    top: 20px;
    left: 20px;
}
.simple-button.login-btn {
    background-color: #007bff;
    padding: 10px 20px;
}
.simple-button.login-btn:hover {
    background-color: #0056b3;
}

/* Purchased Courses Modal */
.purchased-list-container {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}
.purchased-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    border-right: 5px solid #007bff;
}
.purchased-item-info {
    font-size: 1.1rem;
}
.purchased-item-info small {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
}
.view-purchased-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* =================================================== */
/* بخش جدید: بهبودهای ریسپانسیو برای موبایل      */
/* =================================================== */

/* این قوانین زمانی اعمال می‌شوند که عرض صفحه نمایش ۷۶۸ پیکسل یا کمتر باشد */
@media (max-width: 768px) {

    /* کاهش فاصله کلی صفحه در موبایل */
    body {
        padding: 10px;
    }

    /* کوچک کردن عنوان اصلی */
    h1 {
        font-size: 1.8rem;
        line-height: 1.4;
    }

    /* مدیریت هدر و دکمه ورود */
    header {
        position: relative;
        padding-bottom: 15px;
    }

    .login-btn-container {
        position: static; /* حذف حالت شناور */
        margin-bottom: 15px;
        text-align: center;
    }
    
    .welcome-container {
        flex-direction: column; /* عناصر زیر هم قرار می‌گیرند */
        gap: 10px;
    }

    .user-actions {
        width: 100%;
        justify-content: center;
    }

    /* اصلاح چیدمان بخش جستجو */
    .search-form {
        flex-direction: column; /* فیلد جستجو و دکمه زیر هم قرار می‌گیرند */
        align-items: stretch; /* تمام عرض را اشغال می‌کنند */
    }

    .search-form button {
        padding: 12px;
    }

    /* اصلاح چیدمان منوهای کشویی */
    .filter-grid {
        /* در موبایل، همیشه یک ستون نمایش داده می‌شود */
        grid-template-columns: 1fr; 
    }

    /* اصلاح چیدمان بخش نتیجه */
    .result-container {
        flex-direction: column;
        align-items: stretch;
    }

    .view-resource-btn {
        width: 100%;
        text-align: center;
    }
    
    /* اصلاح چیدمان مودال‌ها */
    .modal-content {
        width: 95%;
        padding: 15px;
    }
}
/* ===== Device Warning Box Styles ===== */

.device-warning {
    display: flex;
    align-items: flex-start; /* آیکون و متن از بالا تراز شوند */
    gap: 10px;
    background-color: #fff3cd; /* رنگ زرد هشدار */
    color: #664d03; /* رنگ متن تیره برای خوانایی */
    border: 1px solid #ffeeba;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px; /* فاصله از فرم ورود */
    font-size: 0.9rem;
    line-height: 1.6;
}

.device-warning i {
    font-size: 1.5rem;
    margin-top: 3px;
    color: #856404;
}
/* ===== Attendance Button Styles ===== */
.attendance-btn {
    background: linear-gradient(45deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.attendance-btn:hover {
    background: linear-gradient(45deg, #218838, #1e7e34);
    transform: translateY(-2px);
}

/* محل ثابت گوشه صفحه (اختیاری) */
.attendance-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 768px) {
    .attendance-btn {
        width: 100%;
        font-size: 1.1rem;
        padding: 15px;
    }
    .simple-button.logout-btn {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.6), rgba(200, 35, 50, 0.6)) !important;
}
    .attendance-fixed {
        position: static; /* در موبایل به صورت عادی در جریان صفحه */
        margin-top: 15px;
    }
}
/* Add to your CSS file */
.header-top-bar {
    width: 100%;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.button-group {
    display: flex;
    gap: 12px;
    background: rgba(0, 30, 60, 0.4);
    padding: 8px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.simple-button {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.simple-button.login-btn {
    background: linear-gradient(135deg, #1a5276, #2980b9);
    padding: 10px 24px;
}

.simple-button.attendance-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    padding: 10px 20px;
}

.simple-button i {
    transition: transform 0.3s ease;
}

.simple-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.simple-button:hover i {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        border-radius: 15px;
        padding: 10px;
        gap: 8px;
        width: 100%;
    }
    
    .simple-button {
        justify-content: center;
        width: 100%;
    }
}
/* بخش جدید برای تنظیمات مخصوص موبایل */
/* Update existing mobile styles */
@media (max-width: 768px) {
   .header-top-bar {
        display: flex;
        justify-content: center;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .header-actions {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }
    
    .button-group {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 16px;
        padding: 8px;
        gap: 8px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        align-items: center; /* Center buttons horizontally */
    }
    
    .simple-button {
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(5px);
        padding: 12px 20px;
        transition: all 0.3s ease;
        width: 100%; /* Full width within container */
        max-width: 280px; /* Limit maximum width */
        text-align: center;
        display: flex;
        justify-content: center; /* Center button content */
    }
    
    .simple-button.login-btn {
        background: linear-gradient(135deg, rgba(26, 82, 118, 0.6), rgba(41, 128, 185, 0.6)) !important;
    }
    
    .simple-button.attendance-btn {
        background: linear-gradient(135deg, rgba(39, 174, 96, 0.6), rgba(46, 204, 113, 0.6)) !important;
    }
    
    .simple-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
    }

.simple-button.device-manager-btn {
    background: linear-gradient(135deg, rgba(160, 80, 200, 0.6), rgba(120, 60, 160, 0.6)) !important;
}

.simple-button.purchased-btn {
    background: linear-gradient(135deg, rgba(46, 134, 193, 0.6), rgba(52, 152, 219, 0.6)) !important;
}
/* داخل بلاک @media (max-width: 768px) */
.simple-button.logout-btn {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.6), rgba(200, 35, 50, 0.6)) !important;
}

}
/* استایل گالری شبیه‌سازی‌ها (اضافه‌شده جدید) */
/* استایل گالری شبیه‌سازی‌ها (اضافه‌شده جدید) */
/* استایل گالری شبیه‌سازی‌ها (اصلاح شده) */
.simulation-gallery {
    width: 100%;
    max-width: 1000px; /* کاهش حداکثر عرض برای نمایش بهتر ۳ ستون */
    margin-left: auto;
    margin-right: auto;
    background: rgba(0, 15, 46, 0.7);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* نمایش ۳ ستون با عرض یکسان */
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.gallery-item {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    /* نسبت ابعاد برای تصاویر مربعی (اختیاری) */
    aspect-ratio: 1 / 1; 
    object-fit: cover;
}

/* برای موبایل و تبلت، چیدمان را به ۱ ستون تغییر دهید */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
/* لوگوی وبسایت */
.logo-link {
    position: absolute;
    top: 23px;
    right: 40px;
    z-index: 100;
}

.website-logo {
    width: 150px; /* یا هر ابعاد مناسب دیگری */
    height: auto;
    transition: transform 0.3s ease;
}

.website-logo:hover {
    transform: scale(1.05);
}

/* اصلاحات برای موبایل */
@media (max-width: 768px) {
    /* جایگزین استایل قبلی .logo-link */
    .logo-link {
        position: absolute;
        top: 0px;
        right: 0px;
        z-index: 100;
    }

    .website-logo {
        width: 55px; /* ابعاد لوگو را به دلخواه تنظیم کنید */
        height: auto;
    }
}
/* استایل برای فیلدهای ضروری */
.required {
    color: red;
    margin-right: 2px;
}

/* استایل برای لینک فراموشی رمز */
.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: -10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #007bff; /* یا هر رنگی که می‌خواهید */
    text-decoration: none;
}
.forgot-password-link:hover {
    text-decoration: underline;
}
/* ============================================== */
/* ارتقای ظاهری TOAST (جدید)           */
/* ============================================== */

#customToast {
    /* موقعیت ثابت و بالا - تغییر موقعیت به راست */
    visibility: hidden; 
    /* عرض اولیه بزرگتر برای دسکتاپ */
    min-width: 320px; 
    max-width: 450px; /* حداکثر عرض در دسکتاپ */
    position: fixed; 
    z-index: 100004; 
    top: 50px; 
    
    /* 💥 تغییر کلیدی: انتقال از وسط به راست 💥 */
    right: 30px; /* فاصله از سمت راست صفحه */
    left: auto; /* حذف تنظیمات قبلی left: 50% */
    transform: none; /* حذف transform: translateX(-50%) */
    
    /* طراحی و ظاهر مدرن */
    padding: 15px 25px;
    border-radius: 12px; 
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2); 
    transition: all 0.4s ease-in-out;
    opacity: 0;
}

#customToast.show {
    visibility: visible;
    opacity: 1;
    transform: none; /* در این موقعیت جدید نیازی به transform: translateY(0) نیست */
}

/* 🚀 بخش ریسپانسیو برای موبایل: عرض کامل و پایین صفحه 🚀 */
@media (max-width: 768px) {
    #customToast {
        /* در موبایل، آن را به پایین و عرض کامل منتقل می‌کنیم تا بهتر دیده شود */
        min-width: 90%; 
        max-width: 90%; 
        bottom: 20px; /* بالا آمدن از پایین */
        top: auto; /* حذف موقعیت بالا */
        right: 5%; /* وسط‌چین کردن در موبایل با تنظیم right و left */
        left: 5%;
        text-align: center;
        border-radius: 8px; /* گوشه‌های کمتر گرد */
        font-size: 0.9rem;
    }
    
    /* اگر کاربر دکمه‌های پایینی را می‌بیند، می‌توان این Toast را کمی شفاف‌تر کرد تا محتوای زیرین کاملا پنهان نشود. */
    #customToast.show {
        /* تنظیمات موبایل برای نمایش */
        transform: translateY(0);
    }
}

/* رنگ و استایل جذاب‌تر برای پیام "info" */
#customToast.info {
    background-color: #007bff; /* آبی نفتی یا سرمه‌ای */
    color: #ffffff; /* متن سفید */
    border: 1px solid #0056b3;
}
/* این کد را در فایل /assets/style.css قرار دهید */

.resource-hint a {
    /* 💥 این خط، رنگ لینک را تغییر می‌دهد 💥 */
    color: #66D9EF; /* مثال: آبی روشن برای کنتراست عالی با پس‌زمینه تیره */
    
    /* اختیاری: برای برجسته‌سازی بیشتر */
    text-decoration: underline; /* برای حفظ زیرخط لینک */
    font-weight: bold; 
}

/* اختیاری: برای زمانی که موس روی لینک می‌رود */
.resource-hint a:hover {
    color: #ffffff; /* تغییر به سفید خالص هنگام هاور کردن */
}
/* ================================================================
   STYLES FOR NEW CATEGORY & PLACEHOLDER SECTIONS (REVISED)
   ================================================================ */

.category-selector-section {
    background-color: #1a1e24;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid #2c333e;
}

.category-selector-section .section-title {
    margin-bottom: 25px;
    color: #e0e0e0;
    font-size: 1.6rem;
}

.category-select-container {
    max-width: 500px;
    margin: 0 auto;
}

#mainCategorySelector {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    background-color: #2c333e;
    color: #fff;
    border: 1px solid #444c5a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300aaff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-13%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2013l128%20127.9c3.6%203.6%207.8%205.4%2013%205.4s9.4-1.8%2013-5.4L287%2095.2c3.5-3.5%205.4-7.8%205.4-13%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: .8em;
    padding-left: 3rem;
}

#mainCategorySelector:hover,
#mainCategorySelector:focus {
    border-color: #00aaff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

/* --- Back Button --- */
.back-button {
    background-color: #3a414e;
    color: #e0e0e0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start; /* Important */
}

.back-button:hover {
    background-color: #0088cc;
    color: #fff;
}

/* --- Placeholder Sections --- */
.placeholder-section {
    display: flex; /* Changed to flex */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #1a1e24;
    padding: 50px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px dashed #444c5a;
    color: #a0a0a0;
    min-height: 300px;
}

.placeholder-section i {
    color: #00aaff;
    margin-bottom: 20px;
}

.placeholder-section h2 {
    color: #e0e0e0;
    margin-bottom: 15px;
}
.placeholder-section .back-button {
    position: absolute;
    top: 100px;
    right: 20px;
}
/* ================================================================
   STYLES FOR NEW CATEGORY & PLACEHOLDER SECTIONS (REVISED)
   ================================================================ */

/* ================================================================
   1. اصلاح کادر اصلی انتخاب دسته بندی (.category-selector-section)
   ================================================================ */

.category-selector-section {
    /* 💥 استایل هارمونیک: مانند courses-section و pdf-section 💥 */
    background: rgba(0, 15, 46, 0.7); /* پس‌زمینه شفاف */
    border-radius: 20px; 
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    
    /* استایل‌های قبلی را حفظ می‌کنیم */
    margin-bottom: 30px;
    text-align: center;
    border: none; /* حذف border */
}

/* اصلاح عنوان داخل کادر برای خوانایی بهتر */
.category-selector-section .section-title {
    margin-bottom: 25px;
    color: #00c6ff; /* رنگ آبی روشن مشابه بقیه عناوین */
    font-size: 1.6rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #00c6ff;
}

/* بقیه استایل‌های category-select-container نیازی به تغییر ندارند */

.category-select-container {
    max-width: 500px;
    margin: 0 auto;
}

#mainCategorySelector {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-family: inherit;
    background-color: rgba(44, 51, 62, 0.8); /* رنگ #2c333e با کمی شفافیت */
    
    color: #fff;
    border: 1px solid #444c5a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300aaff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-13%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2013l128%20127.9c3.6%203.6%207.8%205.4%2013%205.4s9.4-1.8%2013-5.4L287%2095.2c3.5-3.5%205.4-7.8%205.4-13%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: .8em;
    padding-left: 3rem;
}

#mainCategorySelector:hover,
#mainCategorySelector:focus {
    border-color: #00aaff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

/* --- Back Button --- */
.back-button {
    background-color: #3a414e;
    color: #e0e0e0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start; /* Important */
}

.back-button:hover {
    background-color: #0088cc;
    color: #fff;
}

/* --- Placeholder Sections --- */
.placeholder-section {
    display: flex; /* Changed to flex */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #1a1e24;
    padding: 50px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px dashed #444c5a;
    color: #a0a0a0;
    min-height: 300px;
}

.placeholder-section i {
    color: #00aaff;
    margin-bottom: 20px;
}

.placeholder-section h2 {
    color: #e0e0e0;
    margin-bottom: 15px;
}
.placeholder-section .back-button {
    position: absolute;
    top: 180px;
    right: 50px;
}
@media (max-width: 768px) {
    .placeholder-section .back-button {
    position: absolute;
    top:350px;
    right: 35px;
}
    
}
/* =================================================== */
/* استایل ملایم‌تر برای هشدار در تب ورود       */
/* =================================================== */

#loginTab .device-warning {
    background-color: #f8f9fa; /* پس‌زمینه روشن‌تر و خنثی‌تر */
    color: #495057;           /* رنگ متن تیره‌تر اما نه خیلی تند */
    border: 1px solid #dee2e6; /* حاشیه ملایم‌تر */
    font-size: 0.85rem;      /* فونت کمی کوچک‌تر */
    padding: 12px;           /* پدینگ کمی کمتر */
}

#loginTab .device-warning i {
    color: #6c757d;           /* رنگ آیکون ملایم‌تر */
    font-size: 1.2rem;       /* آیکون کمی کوچک‌تر */
}
/* =================================================== */
/* استایل‌های جدید برای نمایش اشتراک و دکمه ارتقا      */
/* =================================================== */

/* استایل برای نمایش نوع اشتراک */
.subscription-info {
    font-size: 0.9em;
    color: #ccc;
    margin-left: 5px; /* ایجاد فاصله */
    margin-right: 10px;
}
.subscription-info strong {
    color: #ffc107; /* رنگ طلایی برای نوع اشتراک */
}

/* استایل دکمه ارتقا */
.simple-button.upgrade-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800); /* گرادیانت طلایی */
    color: #333; /* رنگ متن تیره برای خوانایی روی طلایی */
    padding: 8px 15px; /* اندازه کوچکتر */
    font-size: 0.9em;
    border: none;
    margin-left: 10px;
}

.simple-button.upgrade-btn:hover {
    background: linear-gradient(135deg, #ffca2c, #ffa726);
    transform: translateY(-2px);
}

/* در حالت موبایل هم دکمه ارتقا را استایل دهید */
@media (max-width: 768px) {
    .simple-button.upgrade-btn {
         background: linear-gradient(135deg, rgba(255, 193, 7, 0.7), rgba(255, 152, 0, 0.7)) !important;
         border: 1px solid rgba(255, 193, 7, 0.5);
         width: 100%;
         max-width: 280px;
    }
    
    .subscription-info {
        margin: 5px 0;
        text-align: center;
    }
    
    /* هم‌راستا کردن دکمه‌ها در هدر موبایل */
    .welcome-container {
        align-items: center; 
    }
}

/* اطمینان از z-index مودال ارتقا */
#upgradeModal {
    z-index: 100001; /* بالاتر از مودال‌های دیگر باشد */
}
/* =================================================== */
/* استایل‌های هدر (ارتقا یافته) و مودال ارتقا      */
/* =================================================== */

/* هدر در حالت لاگین */
.welcome-container {
    display: flex;
    align-items: center; /* تراز عمودی همه آیتم‌ها */
    justify-content: center; /* وسط‌چین کردن در حالت دسکتاپ */
    flex-wrap: wrap; /* اجازه شکستن در موبایل */
    width: 100%;
}

.subscription-details {
    display: flex;
    align-items: center;
    margin: 0 10px;
    flex-shrink: 0;
}

.subscription-info {
    font-size: 0.9em;
    color: #ccc;
}
.subscription-info strong {
    color: #ffc107; 
}
.expiry-info {
    font-size: 0.8em;
    color: #f0ad4e; /* رنگ نارنجی هشدار */
    margin-right: 5px;
}

.user-actions {
    margin-top: 0; /* حذف مارجین بالا */
    flex-shrink: 0; /* جلوگیری از کوچک شدن دکمه ها */
    margin-left: 10px; /* فاصله از اطلاعات اشتراک */
}

/* دکمه ارتقا */
.simple-button.upgrade-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
    padding: 8px 15px;
    font-size: 0.9em;
    border: none;
    margin-left: 10px; /* فاصله از دکمه‌های دیگر */
    line-height: 1.5; /* تراز بهتر متن */
}

.simple-button.upgrade-btn:hover {
    background: linear-gradient(135deg, #ffca2c, #ffa726);
    transform: translateY(-2px);
}

/* بخش انتخاب پلن در مودال ارتقا */
.plan-selector {
    margin: 15px 0;
}
.plan-selector h4 {
    margin-bottom: 10px;
}
.plan-option {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.plan-option:hover {
    background: #e9e9e9;
    border-color: #007bff;
}
.plan-option input[type="radio"] {
    margin-left: 10px;
}
.plan-option label {
    cursor: pointer;
}
.plan-option label strong {
    color: #0056b3;
}


/* ریسپانسیو هدر */
@media (max-width: 768px) {
    .welcome-container {
        flex-direction: column; /* همه چیز زیر هم */
        gap: 10px;
    }
    .user-actions {
        margin-left: 0; /* حذف مارجین در موبایل */
        flex-wrap: wrap; /* اجازه شکستن دکمه ها */
    }
    .simple-button.upgrade-btn {
         background: linear-gradient(135deg, rgba(255, 193, 7, 0.7), rgba(255, 152, 0, 0.7)) !important;
         border: 1px solid rgba(255, 193, 7, 0.5);
         width: 100%;
         max-width: 280px;
         margin-left: 0;
    }
}

/* اطمینان از z-index مودال ارتقا */
#upgradeModal {
    z-index: 100001;
}
/* =================================================== */
/* استایل بخش پایگاه کتاب درسی (مشابه بخش مدرسه)
/* =================================================== */

#textbookSection {
    /* 1. کپی کردن استایل‌های بخش مدرسه (.filter-section) */
    /* */
    width: 100%;
    background: rgba(0, 15, 46, 0.7);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);

    /* 2. بازنویسی استایل‌های ناخواسته از .placeholder-section */
    /* */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* تغییر از center به stretch تا فیلترها تمام-عرض شوند */
    justify-content: flex-start; /* تغییر از center به start تا محتوا از بالا چیده شود */
    border: none; /* حذف کادر خط‌چین */
    color: #fff; /* تغییر رنگ متن به سفید */
    min-height: auto; /* حذف ارتفاع ثابت */
}
/* =================================================== */
/* بخش جدید: استایل هدر و کاهش فاصله‌ها
/* =================================================== */

/* ۱. استایل برای سطر هدر جدید */
.section-header-row {
    display: flex;
    justify-content: space-between; /* دکمه در انتها، عنوان در ابتدا */
    align-items: center;
    width: 100%;
    margin-bottom: 25px; /* فاصله‌گذاری مانند قبل */
}

/* ۲. تنظیمات عنوان برای قرارگیری در وسط */
.section-header-row .section-title {
    text-align: right; 
    margin-bottom: 0; /* حذف فاصله‌های اضافی */
    padding-bottom: 0;
    border-bottom: none; /* حذف خط زیرین قبلی */
}

/* ۳. تنظیمات دکمه بازگشت */
.section-header-row .back-button {
    margin-bottom: 0; /* حذف فاصله‌های اضافی */
    flex-shrink: 0; /* جلوگیری از کوچک شدن دکمه */
}

/* ۴. کاهش فاصله کادر "توجه" از بالا */
.resource-hint {
    /* */
    margin-top: 5px; /* کاهش فاصله از ۱۵ پیکسل به ۵ پیکسل */
}
/* =================================================== */
/* بخش جدید: اصلاحات ریسپانسیو و زیباسازی (نسخه نهایی)
/* =================================================== */

/* ۱. حذف کادر اضافی "مطلب آموزشی" (در دسکتاپ و موبایل) */
/* ۱. حذف کادر اضافی "مطلب آموزشی" ... */


/* =================================================== */
/* بخش جدید: اصلاحات ریسپانسیو و زیباسازی (نسخه نهایی)
/* =================================================== */

/* * ۱. بخش .resource-result سراسری حذف شد تا در دسکتاپ 
 * مشکلی ایجاد نکند. 
 */


/* ۲. اصلاحات فقط برای موبایل */
/* =================================================== */
/* بخش جدید: اصلاحات ریسپانسیو و زیباسازی (نسخه نهایی)
/* =================================================== */

@media (max-width: 768px) {
    /* */
    
    /* === اصلاح هدر موبایل === */
    .section-header-row {
        flex-direction: column; 
        align-items: stretch;
        gap: 15px;
    }
    
    .section-header-row .section-title {
        /* */
        font-size: 1.2rem;
        line-height: 1.4;
        text-align: center; 
    }
    
    .section-header-row .back-button {
        width: 100%;
        justify-content: center; 
    }
    /* === پایان اصلاح هدر موبایل === */

    
    /* در موبایل، کادر نتیجه را وسط‌چین می‌کنیم */
    .result-container {
        /* */
        align-items: center; 
    }
    
    /* * === اصلاح کامل کادر "مطلب آموزشی" (فقط در موبایل) ===
     */
    .resource-result {
        /* حذف کادر */
        background-color: transparent !important;
        padding: 0 !important;
        
        /* جلوگیری از کش آمدن */
        flex-grow: 0 !important; 
        
        /* 💡 راه‌حل کلیدی: حذف ارتفاع پایه ۳۰۰ پیکسلی در موبایل 💡 */
        flex-basis: auto !important; 
        
        /* چیدمان متن */
        font-size: 1.1rem;
        line-height: 1.7;
        text-align: center;
        margin-bottom: 10px; /* فاصله از دکمه پایینی */
    }
}
/* =================================================== */
/* بخش جدید: همسان‌سازی دکمه‌های "مشاهده" در مودال خرید
/* =================================================== */

.view-purchased-btn {
    /* */
    
    /* ۱. یک عرض حداقلی ثابت برای همه دکمه‌ها تنظیم می‌کند */
    min-width: 100px; 
    
    /* ۲. جلوگیری از فشرده شدن دکمه توسط متن طولانی کناری */
    flex-shrink: 0; 
    
    /* ۳. اطمینان از وسط‌چین بودن متن و آیکون */
    text-align: center; 
}
/* =================================================== */
/* استایل‌های بخش نمایش محتوای چندگانه (PDF/Video/App)
/* =================================================== */

.pdf-container {
    /* اطمینان از اینکه کانتینر اصلی flex است */
    display: flex;
    flex-direction: column;
}

.content-tabs {
    display: none; /* در ابتدا مخفی */
    flex-direction: row;
    flex-shrink: 0; /* جلوگیری از فشرده شدن تب‌ها */
    gap: 5px;
    background: rgba(0, 30, 60, 0.7);
    padding: 5px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.content-tabs .tab-link {
    flex-grow: 1;
    background: rgba(0, 40, 85, 0.6);
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.content-tabs .tab-link:hover {
    background: rgba(0, 60, 120, 0.8);
}

.content-tabs .tab-link.active {
    background: #00c6ff;
    color: #000;
    font-weight: bold;
}

.viewer-container {
    flex: 1; /* باعث می‌شود فضای باقی‌مانده را پر کند */
    position: relative;
    overflow: hidden;
    display: none; /* در ابتدا مخفی */
    border: 1px solid rgba(0, 198, 255, 0.3);
    border-top: none; /* چون تب‌ها مرز بالا هستند */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #333; /* پس زمینه تیره برای بارگذاری */
}

/* اطمینان از اینکه واترمارک روی iframe جدید هم کار می‌کند */
.viewer-container .watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}
/* =================================================== */
/* استایل دکمه "تمام-صفحه" جدید و رفع مشکل ارتفاع
/* =================================================== */

/* ۱. نگهدارنده تب‌ها را برای دکمه جدید آماده می‌کند */
.content-tabs {
    align-items: center; /* تراز عمودی */
}

/* ۲. استایل خود دکمه "تمام-صفحه" */
.maximize-button {
    background-color: #3a414e; /* رنگ پس‌زمینه دکمه */
    color: #e0e0e0; /* رنگ آیکون */
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px; /* فاصله از تب‌ها (در RTL) */
    transition: all 0.3s ease;
}

.maximize-button:hover {
    background-color: #0088cc; /* تغییر رنگ هنگام هاور */
}

/* ۳. رفع مشکل ارتفاع کوچک نمایشگر (مانند image_965324.jpg) */
.viewer-container, .content-frame {
    /* یک ارتفاع حداقلی برای نمایشگر تنظیم می‌کند */
    min-height: 500px; 
}

/* ۴. در حالت موبایل، دکمه تمام-صفحه را پنهان می‌کنیم
      (معمولاً در موبایل کاربرد ندارد) */
@media (max-width: 768px) {
    .maximize-button {
        display: none;
    }
    .viewer-container, .content-frame {
        min-height: 400px; /* ارتفاع حداقلی در موبایل */
    }
}
/* =================================================== */
/* ۱. استایل هدر جدید و چیدمان فیلتر کتاب درسی (دسکتاپ)
/* =================================================== */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 25px;
}

.section-header-row .section-title {
    text-align: right;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-header-row .back-button {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* چیدمان ۳ ستونه برای فیلترهای کتاب درسی در دسکتاپ */
@media (min-width: 769px) {
    #textbookFilterGrid {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 20px;
    }
   /* =================================================== */
/* اصلاح نهایی: نمایش زیر هم با فاصله کم (برای خوانایی بهتر)
/* =================================================== */

/* تنظیمات کلی برای کادر هشدار */
.support-notice {
    text-align: center; /* متن‌ها وسط‌چین باشند */
    padding: 15px;
    /* سایر تنظیمات رنگ و کادر از قبل وجود دارند */
}

/* تنظیم فاصله پاراگراف‌ها */
.support-notice p {
    margin: 0; /* حذف فاصله‌های پیش‌فرض زیاد */
    margin-bottom: 5px; /* فقط ۵ پیکسل فاصله بین خط اول و دوم */
    line-height: 1.6; /* ارتفاع خط مناسب برای خوانایی */
}

/* حذف فاصله از آخرین خط */
.support-notice p:last-child {
    margin-bottom: 0;
}
}

/* =================================================== */
/* ۲. استایل تب‌های نمایش محتوا (PDF/Video/App)
/* =================================================== */
.content-tabs {
    display: none; /* با JS نمایش داده می‌شود */
    flex-direction: row;
    gap: 5px;
    background: rgba(0, 30, 60, 0.7);
    padding: 5px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    align-items: center;
}

.content-tabs .tab-link {
    flex-grow: 1;
    background: rgba(0, 40, 85, 0.6);
    color: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.content-tabs .tab-link:hover { background: rgba(0, 60, 120, 0.8); }
.content-tabs .tab-link.active { background: #00c6ff; color: #000; font-weight: bold; }

.maximize-button {
    background-color: #3a414e;
    color: #e0e0e0;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
}
.maximize-button:hover { background-color: #0088cc; }

.viewer-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: none;
    border: 1px solid rgba(0, 198, 255, 0.3);
    border-top: none;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    min-height: 500px;
}

/* =================================================== */
/* ۳. استایل دکمه شناور و مودال پشتیبانی
/* =================================================== */
.chat-fab-button {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.chat-fab-button:hover { transform: scale(1.1); background: #0056b3; }

.support-notice {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #664d03;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    line-height: 1.7;
}
.support-channels {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}
.support-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
}
.support-button:hover { opacity: 0.85; }
.support-button.eitaa { background-color: #4071A6; }
.support-button.whatsapp { background-color: #25D366; }

/* =================================================== */
/* ۴. استایل انتخاب‌گر روش ثبت‌نام (موبایل/ایمیل)
/* =================================================== */
.reg-method-switcher {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
}
.reg-method-btn {
    flex-grow: 1;
    padding: 12px 10px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    background-color: #f1f1f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.reg-method-btn:first-of-type { border-radius: 0 8px 8px 0; }
.reg-method-btn:last-of-type { border-radius: 8px 0 0 8px; border-right: none; }
.reg-method-btn.active { background-color: #007bff; color: white; border-color: #007bff; }

/* =================================================== */
/* ۵. اصلاحات حیاتی موبایل (رفع باگ‌ها)
/* =================================================== */
@media (max-width: 768px) {
    /* اصلاح هدر */
    .section-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .section-header-row .section-title {
        font-size: 1.2rem;
        line-height: 1.4;
        text-align: center;
    }
    .section-header-row .back-button {
        width: 100%;
        justify-content: center;
    }

    /* اصلاح کادر "مطلب آموزشی" (حذف فضای خالی) */
    .resource-result {
        background-color: transparent !important;
        padding: 0 !important;
        flex-grow: 0 !important;
        flex-basis: auto !important; /* کلید حل مشکل فضای خالی */
        font-size: 1.1rem;
        line-height: 1.7;
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* وسط‌چین کردن کادر نتیجه */
    .result-container { align-items: center; }

    /* کوچک کردن دکمه پشتیبانی */
    .chat-fab-button { width: 50px; height: 50px; font-size: 22px; bottom: 20px; left: 20px; }
    
    /* تنظیم ارتفاع نمایشگر در موبایل */
    .viewer-container, .content-frame { min-height: 400px; }
    .maximize-button { display: none; }
}

/* هم‌اندازه کردن دکمه‌های مشاهده */
.view-purchased-btn {
    min-width: 100px;
    flex-shrink: 0;
    text-align: center;
}
