/* --- breadcrumb.css --- */
/* breadcrumb.css - Compact & Clean Design */
.compact-breadcrumb { 
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; 
    margin-bottom: 16px;
    gap: 6px;
}

.crumb-link { 
    display: flex;
    align-items: center;
    background: var(--bg-card); 
    padding: 6px 12px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    font-size: 13px; 
    font-weight: 600;
    color: var(--text-muted); 
    text-decoration: none; 
    transition: all 0.2s;
}

.crumb-link:hover { 
    color: var(--primary); 
    border-color: var(--primary-soft);
    background: var(--primary-soft);
}

.crumb-link.current { 
    color: var(--primary); 
    background: var(--primary-soft);
    border-color: rgba(59, 130, 246, 0.2);
    pointer-events: none; 
}

.crumb-sep { 
    display: flex;
    align-items: center;
    color: var(--text-muted); 
    opacity: 0.5;
}


/* --- cards.css --- */
@import url('../variables.css');

/* cards.css */
.view-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.item-click-area {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.item-card {
    background: var(--bg-card);
    border: var(--border-px) solid var(--border, #eaeaea);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.2s ease;
    overflow: hidden;
}

@media (hover: hover) {
    .item-card:hover {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
        border-color: var(--primary, #007bff);
    }
}

.item-card:active {
    transform: translateY(0) scale(0.97);
    transition: transform 0.1s;
}

.card-file:active {
    background: var();
    transform: scale(1);
}

.item-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    background: var(--bg-soft, #f4f6f8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted, #888);
    margin-bottom: 16px;
    transition: background 0.2s ease;
}

.item-preview svg {
    width: 60px;
    height: 60px;
}

.card-folder .item-preview {
    background: rgba(0, 123, 255, 0.08);
    color: var(--primary, #007bff);
}

.item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between !important;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text-main, #333);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.item-desc {
    font-size: 0.9rem;
    color: var(--text-muted, #666);
    margin-bottom: 12px;
    flex-grow: 1;
}

.item-meta {
    font-size: 0.8rem;
    color: var(--text-muted, #999);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--border, #eaeaea);
}

.card-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 5;
    opacity: 0;
    transition: var(--transition);
}

.item-card:hover .card-actions {
    opacity: 1;
}

.card-actions button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
}

.card-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.card-actions button svg {
    width: 16px;
    height: 16px;
}

.card-add {
    border: var(--border-px) dashed var(--border);
    cursor: pointer;
    background: transparent;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    min-height: var(--card-size);
}

.card-add:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.card-add .item-preview {
    background: transparent;
    border: none;
    height: auto;
    color: var(--text-muted);
}

.card-add .item-title {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
}

.card-add:hover .item-preview,
.card-add:hover .item-title {
    color: var(--primary);
}

.course-card {
    text-decoration: none;
}

.course-card:hover .item-title {
    color: var(--primary);
}

/* List Mode */
.view-container.list-mode {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-container.list-mode .item-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    height: auto;
    transform: none;
}

.view-container.list-mode .item-preview {
    height: 48px;
    width: 48px;
    border: none;
    background: transparent;
    padding: 0;
    margin-left: 16px;
    border-radius: var(--radius-sm);
}

.view-container.list-mode .item-preview svg {
    width: 28px;
    height: 28px;
}

.view-container.list-mode .item-info {
    padding: 0;
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.view-container.list-mode .item-title {
    margin: 0;
    font-size: 15px;
    flex: 1;
}

.view-container.list-mode .item-desc {
    margin-bottom: 0;
}

.view-container.list-mode .item-meta {
    margin-top: 0;
    width: 150px;
}

.view-container.list-mode .card-actions {
    position: relative;
    top: 0;
    left: 0;
    opacity: 1;
    box-shadow: none;
    margin-right: 16px;
    width: fit-content !important;
}

.view-container.list-mode .card-actions button {
    box-shadow: none;
    background: transparent;
    border-color: transparent;
}

.view-container.list-mode .card-actions button:hover {
    background: var(--bg-hover);
}

.view-container.list-mode .card-add {
    min-height: unset;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
}

.view-container.list-mode .card-add .item-preview {
    padding: 0;
    width: auto;
}

/* =========================================
   Course Schedule Section
   ========================================= */
.schedule-section {
    margin-bottom: 32px;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.schedule-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.btn-schedule-manage {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-schedule-manage:hover {
    background: var(--bg-hover);
}

.schedule-table-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: var(--border-px) solid var(--border);
    overflow: hidden;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.schedule-table th {
    padding: 16px;
    color: var(--text-muted);
    font-weight: normal;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}

.schedule-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.schedule-table tr:last-child td {
    border-bottom: none;
}

.schedule-table tr:hover td {
    background: var(--bg-hover);
}

.schedule-day {
    color: var(--text-main);
    font-weight: bold;
}

.schedule-time-badge {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    white-space: nowrap;
}

.schedule-location {
    color: var(--text-muted);
}

/* Responsive Table for Mobile */
/* Responsive Table for Mobile (Compact Version) */
@media (max-width: 768px) {
    .schedule-header {
        margin-bottom: 12px;
    }

    .schedule-table thead {
        display: none;
    }

    .schedule-table,
    .schedule-table tbody {
        display: block;
        width: 100%;
    }

    .schedule-table tr {
        display: grid;
        grid-template-columns: auto 1fr;
        padding: 10px 12px;
        gap: 6px 12px;
        border-bottom: 1px solid var(--border);
        align-items: center;
    }

    .schedule-table td {
        display: block;
        padding: 0;
        border: none;
        text-align: right;
    }

    /* روز در سمت راست */
    .schedule-table td:nth-child(1) {
        grid-column: 1 / 2;
        font-size: 0.95rem;
    }

    /* ساعت در سمت چپ روبه‌روی روز */
    .schedule-table td:nth-child(2) {
        grid-column: 2 / 3;
        justify-self: end;
    }

    /* مکان در خط پایین */
    .schedule-table td:nth-child(3) {
        grid-column: 1 / 3;
        font-size: 0.85rem;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* افزودن آیکون یا لیبل برای مکان به جای لیبل‌های طولانی قبلی */
    .schedule-table td:nth-child(3)::before {
        content: "📍 مکان:";
        font-size: 0.8rem;
        opacity: 0.7;
    }

    /* مخفی کردن لیبل مکان اگر خالی بود (برای خط تیره) */
    .schedule-table td:nth-child(3):empty::before,
    .schedule-table td:nth-child(3):contains("-")::before {
        display: none;
    }

    .schedule-time-badge {
        font-size: 0.8rem;
        padding: 2px 8px;
    }
}


/* =========================================
   Empty State (EduBox)
   ========================================= */
.empty-state-edubox {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    width: 100%;
    min-height: 400px;
}

.edubox-float-anim {
    animation: floatBox 3s ease-in-out infinite;
    margin-bottom: 24px;
}

@keyframes floatBox {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0px);
    }
}

.empty-state-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.empty-state-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 380px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.empty-state-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.edubox-empty-btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.edubox-empty-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.edubox-empty-btn-secondary {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.1);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.edubox-empty-btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* --- course-header.css --- */
/* course-header.css - Modernized */
.course-header {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 260px; /* تغییر از ارتفاع ثابت به حداقل ارتفاع */
    background: var(--bg-card);
    border: var(--border-px) solid var(--border);
    margin-bottom: 24px;
    margin-top: 24px;
    display: flex;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* لایه‌های پس‌زمینه و تصویر */
.course-header-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-hover);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--border);
}

/* گرادیان تیره برای خوانایی بهتر متن روی هر عکسی */
.course-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.85) 100%);
}

/* دکمه بازگشت شناور روی هدر عکس */
.course-root-back-btn {
    position: absolute;
    top: 16px;
    left: 16px; /* سمت چپ هدر عکس */
    z-index: 10;
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3); /* پس‌زمینه تیره و شیشه‌ای */
    color: #ffffff;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.course-root-back-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.05);
}

.course-root-back-btn svg {
    width: 20px;
    height: 20px;
}

/* محتوای روی هدر */
.course-header-content {
    position: relative;
    margin-top: 24px;
    z-index: 2;
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-end; /* چسبیدن محتوا به پایین */
    padding: 32px;
    gap: 24px;
}

.course-info {
    flex: 1;
    color: #ffffff; /* متن‌ها اجباراً سفید چون بک‌گراند تیره شده */
}

.course-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f8fafc;
}

.course-info h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.course-info .course-desc {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0;
    max-width: 80%;
    /* جلوگیری از طولانی شدن بیش از حد متن */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* دکمه‌های مدیریت */
.course-manage {
    display: flex;
    gap: 10px;
    align-items: center;
}

.course-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.course-btn.btn-edit {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}
.course-btn.btn-edit:hover { background: #ffffff; transform: translateY(-2px); }

.course-btn.btn-tutor {
    background: rgba(139, 92, 246, 0.9);
    color: #ffffff;
}
.course-btn.btn-tutor:hover { background: #8b5cf6; transform: translateY(-2px); }

.course-btn.btn-delete {
    padding: 10px; /* دکمه حذف فقط آیکون باشه قشنگ تره */
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
}
.course-btn.btn-delete:hover { background: #ef4444; transform: translateY(-2px); }


/* --- enroll-prompt.css --- */
/* enroll-prompt.css */
.enroll-prompt {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(139, 92, 246, 0.12) 100%);
    border: 1px dashed rgba(139, 92, 246, 0.5); border-radius: var(--radius-lg, 16px);
    padding: 20px 24px; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    flex-wrap: wrap; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.enroll-prompt:hover { box-shadow: 0 6px 24px rgba(139, 92, 246, 0.08); border-color: rgba(139, 92, 246, 0.8); }

.enroll-prompt-text { flex: 1; min-width: 250px; color: var(--text-main); font-size: 13px; line-height: 1.7; }
.enroll-prompt-text strong { display: flex; align-items: center; gap: 8px; color: #8b5cf6; font-size: 16px; margin-bottom: 8px; font-weight: 700; }
.enroll-prompt-text strong svg { width: 20px; height: 20px; }
.enroll-prompt-text span { color: var(--text-muted); }

.enroll-prompt-action { flex-shrink: 0; }
.enroll-prompt-action .btn-submit {
    padding: 12px 24px; font-size: 14px; border-radius: 8px; background: #8b5cf6;
    color: #fff; text-decoration: none; display: inline-flex; align-items: center;
    justify-content: center; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s; font-family: inherit; font-weight: 600;
}
.enroll-prompt-action .btn-submit:hover { transform: translateY(-2px); background: #7c3aed; box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4); }

/* حالت موبایل */
@media (max-width: 600px) {
    .enroll-prompt { flex-direction: column; align-items: flex-start; padding: 16px; gap: 16px; }
    .enroll-prompt-action { width: 100%; }
    .enroll-prompt-action .btn-submit { width: 100%; }
}


/* --- grades.css --- */
/* grades.css */
.grade-section { background: var(--bg-card); border: var(--border-px) solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 20px; }
.grade-section-empty { display: flex; justify-content: center; padding: 14px; background: transparent; border-style: dashed; }
.grade-empty-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 13px; padding: 6px 12px; border-radius: var(--radius-sm); transition: color var(--transition), background var(--transition); }
.grade-empty-btn:hover { color: var(--primary); background: var(--primary-soft); }

.grade-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.grade-section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: bold; color: var(--text-main); }

.grade-manage-btn { display: flex; align-items: center; gap: 6px; background: none; border: var(--border-px) solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 5px 10px; transition: all var(--transition); }
.grade-manage-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.grade-components-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.grade-component-card { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px 14px; border: var(--border-px) solid var(--border); transition: border-color var(--transition); }
.grade-component-card:hover { border-color: var(--primary); }

.grade-comp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.grade-comp-title { font-size: 13px; color: var(--text-main); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grade-comp-score { font-size: 18px; font-weight: bold; color: var(--primary); white-space: nowrap; flex-shrink: 0; }
.grade-bar-track { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 5px; }
.grade-bar-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.6s ease; }
.grade-comp-pct { font-size: 11px; color: var(--text-muted); }

.grade-total-row { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.grade-total-value { font-size: 20px; font-weight: bold; color: var(--text-main); }

/* Modal Grade Rows */
.grade-modal-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 6px 8px; background: var(--bg-hover); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.grade-modal-input { flex: 1; background: transparent; border: none; outline: none; font-size: 13px; color: var(--text-main); min-width: 0; padding: 2px 4px; }
.grade-modal-score { width: 70px; background: transparent; border: none; border-right: 1px solid var(--border); outline: none; font-size: 13px; font-weight: bold; color: var(--primary); text-align: center; padding: 2px 6px; }
.grade-modal-order { width: 54px; background: transparent; border: none; border-right: 1px solid var(--border); outline: none; font-size: 12px; color: var(--text-muted); text-align: center; padding: 2px 4px; }
.grade-modal-save { background: none; border: none; cursor: pointer; color: #10b981; padding: 4px; border-radius: 4px; display: flex; align-items: center; transition: background var(--transition); flex-shrink: 0; }
.grade-modal-save:hover { background: #10b98122; }
.grade-modal-del { background: none; border: none; cursor: pointer; color: #ef4444; padding: 4px; border-radius: 4px; display: flex; align-items: center; transition: background var(--transition); flex-shrink: 0; }
.grade-modal-del:hover { background: #ef444422; }


/* --- home.css --- */
/* =========================================
   Home Dashboard Styles (Modern UI)
========================================= */

/* بخش خوش‌آمدگویی */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--primary-soft);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-welcome h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.dashboard-welcome p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* هدر سکشن‌ها (کلاس‌های من / دوره‌های جدید) */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* گرید اختصاصی کارت‌های دوره */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* طراحی مدرن کارت دوره */
.modern-course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) { /* این مقدار را بر اساس عرض صفحه نمایش دسکتاپ خود تنظیم کنید */
  .modern-course-card:hover {
    transform: scale(1.01); /* بزرگ شدن به جای جابجایی */
    border-color: var(--primary-soft);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }
}
  .modern-course-card:active {
    transform: scale(0.99); /* بزرگ شدن به جای جابجایی */
    border-color: var(--primary-soft);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

.m-card-cover {
    height: 160px;
    position: relative;
    background: var(--bg-hover);
}

.m-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.5;
}

/* بج (Badge) روی عکس */
.m-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.m-card-badge.enrolled {
    background: rgba(16, 185, 129, 0.8); /* سبز برای ثبت‌نام شده */
}

.m-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.m-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
}

.m-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.m-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.02);
}

.m-card-footer svg {
    transition: transform 0.2s;
}

.modern-course-card:hover .m-card-footer svg {
    transform: translateX(-4px); /* حرکت فلش به سمت چپ در هاور (راست‌چین) */
}



/* --- timetable.css --- */
/* ===== Timetable / Weekly Schedule (Pro UI Edition) ===== */

.timetable-section {
    margin-bottom: 40px;
    animation: fade-in-up 0.4s ease-out forwards;
}

.timetable-section > h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timetable-section > h2 svg {
    color: var(--primary, #3b82f6);
    background: var(--primary-soft, #eff6ff);
    padding: 4px;
    border-radius: 8px;
    width: 28px;
    height: 28px;
}

/* =========================================
   1. حالت دسکتاپ و تبلت (جدول گرید مدرن و خلوت)
   ========================================= */
.timetable-wrap {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.timetable {
    width: 100%;
    table-layout: fixed; /* باعث میشود عرض ستون ها دقیقا متناسب با colspan باشند */
    border-collapse: collapse;
    direction: rtl;
}

/* هدر ساعت‌ها */
.timetable thead tr {
    border-bottom: 2px solid var(--border);
    background: var(--bg-card);
}

.tt-corner {
    border-left: 1px solid var(--border);
}

.tt-hour-th {
    position: relative;
    height: 40px;
    padding: 0;
    border-left: 1px dashed var(--border);
    vertical-align: bottom;
}

.tt-hour-label {
    position: absolute;
    bottom: 0px;
    right: 0;
    transform: translateX(50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    opacity: 0.7;
    padding: 2px 6px;
    border-radius: 12px;
    z-index: 2;
    pointer-events: none;
}

/* ردیف‌های روز */
.timetable tbody tr {
    border-bottom: 1px dashed var(--border);
}
.timetable tbody tr:last-child {
    border-bottom: none;
}

.tt-day-th {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-hover);
    border-left: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
    height: 80px; /* کمی ارتفاع را کم کردیم تا جمع و جورتر شود */
    padding: 0 8px;
}

/* سلول‌های خالی */
.tt-empty {
    border-left: 1px dashed var(--border);
    height: 80px;
    transition: background 0.2s;
}
.timetable tbody tr:hover .tt-empty {
    background: rgba(0, 0, 0, 0.015);
}

/* سلول کلاس */
.tt-class {
    padding: 4px;
    vertical-align: middle;
    height: 80px;
    border-left: 1px dashed var(--border);
    box-sizing: border-box;
}

/* بلوک داخل سلول */
.tt-block {
    border-radius: 10px;
    padding: 8px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* محتوا دقیقاً وسط قرار میگیرد */
    gap: 4px;
    text-align: right;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.tt-block:hover {
    /* transform: translateY(-2px); */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    z-index: 5;
}

.tt-block-title {
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tt-block-loc {
    font-size: 0.65rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* تنظیمات اختصاصی دسکتاپ و تبلت برای مخفی کردن ساعت */
@media (min-width: 769px) {
    /* چون ساعت در هدر بالایی (محور X) هست، در دسکتاپ از داخل سلول حذف میشود */
    .tt-block-time {
        display: none !important; 
    }
}

@media (max-width: 900px) and (min-width: 769px) {
    .tt-day-th { font-size: 0.75rem; padding: 0 4px; }
    .tt-block { padding: 4px 6px; }
    .tt-block-title { font-size: 0.75rem; }
    .tt-class, .tt-empty, .tt-day-th { height: 70px; }
}

/* =========================================
   2. حالت موبایل (Agenda View / فشرده و حرفه‌ای)
   ========================================= */
@media (max-width: 768px) {
    .timetable-wrap {
        border: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .timetable, .timetable tbody, .timetable tr, .timetable th, .timetable td {
        display: block;
        width: 100% !important;
    }

    .timetable thead, .tt-empty {
        display: none !important;
    }

    /* کارت روزانه فشرده‌تر */
    .timetable tbody tr {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 12px; /* کاهش فاصله بین روزها */
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
        overflow: hidden;
    }

    /* عنوان روز باریک‌تر */
    .tt-day-th {
        height: auto;
        padding: 8px 12px;
        text-align: right;
        border-bottom: 1px solid var(--border);
        font-size: 0.85rem;
        background: var(--bg-hover);
        color: var(--primary, #3b82f6);
    }

    /* کاهش پدینگ سلول‌ها برای صرفه‌جویی در فضای عمودی */
    .tt-class {
        height: auto;
        padding: 8px;
        border-bottom: 1px dashed var(--border);
    }
    .timetable tbody tr td:last-child {
        border-bottom: none;
    }

    /* === تغییر جادویی: استفاده از Grid برای موبایل === */
    .tt-block {
        display: grid;
        /* ستون اول: ساعت (عرض 75px)، ستون دوم: بقیه اطلاعات */
        grid-template-columns: 75px 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "time title"
            "time loc";
        align-items: center;
        gap: 2px 12px;
        padding: 8px;
        border-radius: 8px;
    }

    .tt-block:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    }

    /* بلاک ساعت در سمت راست (موبایل) */
    .tt-block-time {
        grid-area: time;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.04); /* بک‌گراند تیره ملایم برای متمایز شدن ساعت */
        border-radius: 6px;
        padding: 6px 4px;
        font-size: 0.65rem;
        font-weight: 700;
        opacity: 0.9;
        text-align: center;
        line-height: 1.3;
        /* حذف آیکون در موبایل برای خلوت شدن */
    }
    .tt-block-time::before {
        display: none;
    }

    .tt-block-title {
        grid-area: title;
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        margin-top: 2px;
    }

    .tt-block-loc {
        grid-area: loc;
        font-size: 0.7rem;
        opacity: 0.75;
        margin-bottom: 2px;
    }
}


/* --- toolbar.css --- */
/* toolbar.css */
.view-toolbar { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); border: var(--border-px) solid var(--border); padding: 8px 16px; border-radius: var(--radius-lg); margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.minimal-toolbar { display: flex; justify-content: space-between; align-items: center; background: transparent; border: none; padding: 0; margin-bottom: 24px; flex-wrap: wrap; gap: 16px;}
.toolbar-group { display: flex; gap: 12px; align-items: center; }
.minimal-toolbar .btn-back { background: var(--bg-card); border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.minimal-toolbar .slider-container { background: transparent; padding: 0; color: var(--text-muted); }
.minimal-toolbar .icon-btn.small-btn { width: 36px; height: 36px; background: transparent; border-color: transparent; }
.minimal-toolbar .icon-btn.small-btn.active { background: var(--primary-soft); color: var(--primary); }

/* Slider */
.slider-container { display: none !important; align-items: center; gap: 8px; color: var(--text-muted); background: var(--bg-hover); padding: 8px 16px; border-radius: 100px;}
.slider-container input[type=range] { -webkit-appearance: none; width: 100px; background: transparent; padding: 0; min-width: auto; height: auto; border: none; }
.slider-container input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; margin-top: -6px; }
.slider-container input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: var(--border); border-radius: 4px; }


