/* ==========================================================================
   1. تنظیمات پایه و متغیرها (THEME CONFIG)
   ========================================================================== */

/* لود فونت وزیر */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/vazir.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* نکته مهم: تمام استایل‌ها داخل .sap-wrapper محصور شده‌اند 
   تا هیچ تداخلی با قالب اصلی سایت یا المنتور نداشته باشند.
*/
.sap-wrapper {
    /* --- پالت رنگی --- */
    --sap-navy: #020228;        /* سرمه‌ای عمیق */
    --sap-navy-light: #10104e;  /* سرمه‌ای روشن‌تر (گرادینت) */
    --sap-gold: #FFCD03;        /* زرد طلایی اصلی */
    --sap-gold-hover: #ffdb4d;  /* طلایی روشن */
    --sap-bg: #f8f9fa;          /* پس‌زمینه کلی */
    --sap-surface: #ffffff;     /* رنگ کارت‌ها */
    --sap-text: #2d3436;        /* متن اصلی */
    --sap-text-muted: #636e72;  /* متن فرعی */
    --sap-border: #eef2f5;      /* بوردرها */
    --sap-input-bg: #f1f5f9;    /* پس‌زمینه اینپوت */

    /* --- رنگ‌های وضعیت --- */
    --sap-success: #00b894;     /* سبز موفقیت */
    --sap-error: #ff7675;       /* قرمز خطا */
    --sap-info: #0984e3;        /* آبی اطلاع‌رسانی */
    --sap-warning: #fdcb6e;     /* زرد هشدار */
    
    /* --- تنظیمات ظاهری --- */
    --sap-radius: 16px;
    --sap-font: 'Vazir', Tahoma, sans-serif;
    --sap-shadow-sm: 0 4px 6px rgba(0, 0, 37, 0.02);
    --sap-shadow-md: 0 10px 30px rgba(0, 0, 37, 0.08);
    --sap-shadow-lg: 0 20px 40px rgba(0, 0, 37, 0.12);
    
    /* تنظیمات کانتینر */
    font-family: var(--sap-font);
    direction: rtl;
    text-align: right;
    background-color: var(--sap-bg);
    color: var(--sap-text);
    line-height: 1.7;
    padding: 40px 0;
    width: 100%;
    box-sizing: border-box;
}

/* ریست باکس مدل */
.sap-wrapper *, .sap-wrapper *::before, .sap-wrapper *::after {
    box-sizing: border-box;
    outline: none;
}

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

.sap-wrapper a { text-decoration: none; transition: all 0.3s ease; }
.sap-wrapper img { max-width: 100%; height: auto; }

/* اسکرول بار اختصاصی */
.sap-wrapper ::-webkit-scrollbar { width: 8px; height: 8px; }
.sap-wrapper ::-webkit-scrollbar-track { background: #f1f1f1; }
.sap-wrapper ::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.sap-wrapper ::-webkit-scrollbar-thumb:hover { background: var(--sap-gold); }


/* ==========================================================================
   2. دکمه‌ها و فرم‌ها (UI COMPONENTS)
   ========================================================================== */

/* دکمه اصلی (گرادینت طلایی) */
.sap-wrapper .sap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sap-gold) 0%, #ffb302 100%);
    color: var(--sap-navy);
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(255, 205, 3, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sap-wrapper .sap-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 205, 3, 0.5);
    color: var(--sap-navy);
}

.sap-wrapper .sap-btn:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* دکمه دورخط (Outline) */
.sap-wrapper .sap-btn-outline {
    background: transparent;
    border: 2px solid var(--sap-navy);
    color: var(--sap-navy);
    box-shadow: none;
}

.sap-wrapper .sap-btn-outline:hover {
    background: var(--sap-navy);
    color: #fff;
}

.sap-wrapper .sap-btn-full { width: 100%; }
.sap-wrapper .sap-btn-xs { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; font-weight: 600; }

/* اینپوت‌ها و سلکت‌ها (Filled Style) */
.sap-wrapper input[type="text"],
.sap-wrapper input[type="tel"],
.sap-wrapper input[type="email"],
.sap-wrapper select,
.sap-wrapper textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid transparent;
    background: var(--sap-input-bg);
    border-radius: 12px;
    font-family: var(--sap-font);
    font-size: 0.95rem;
    color: var(--sap-text);
    transition: 0.3s ease;
}

.sap-wrapper input:focus, .sap-wrapper select:focus, .sap-wrapper textarea:focus {
    background: #fff;
    border-color: var(--sap-gold);
    box-shadow: 0 0 0 4px rgba(255, 205, 3, 0.15);
}

/* بج‌های وضعیت (Badges) */
.sap-wrapper .sap-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}


/* ==========================================================================
   3. جستجو و فیلترها (SEARCH & FILTER)
   ========================================================================== */
.sap-wrapper .sap-search-bar {
    background: var(--sap-surface);
    padding: 20px;
    border-radius: var(--sap-radius);
    box-shadow: var(--sap-shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    border: 1px solid #fff;
}

.sap-wrapper .sap-filters form {
    display: flex; gap: 15px; flex-wrap: wrap; width: 100%; align-items: center;
}

/* در موبایل، سلکت‌ها تمام عرض شوند */
.sap-wrapper .sap-filters select {
    flex: 1;
    min-width: 200px;
}

/* دکمه‌های تاگل نقشه/لیست */
.sap-wrapper .sap-view-toggle {
    background: #f0f2f5;
    padding: 4px;
    border-radius: 12px;
    display: flex;
}

.sap-wrapper .sap-view-toggle button {
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--sap-font);
    font-weight: 600;
    color: #777;
    transition: 0.3s;
    display: flex; align-items: center; gap: 8px;
}

.sap-wrapper .sap-view-toggle button.active {
    background: #fff;
    color: var(--sap-navy);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}


/* ==========================================================================
   4. نقشه و کارت‌ها (MAP & GRID)
   ========================================================================== */
.sap-wrapper #sap-map-container {
    height: 550px;
    border-radius: var(--sap-radius);
    overflow: hidden;
    box-shadow: var(--sap-shadow-md);
    border: 5px solid #fff;
    z-index: 1;
}

/* سیستم گرید هوشمند (Responsive Grid) */
.sap-wrapper #sap-grid-container {
    display: grid;
    /* این خط باعث می‌شود تعداد ستون‌ها بر اساس عرض صفحه خودکار تنظیم شود */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* کارت آکادمی */
.sap-wrapper .sap-card {
    background: var(--sap-surface);
    border-radius: var(--sap-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: all 0.4s ease;
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
    display: flex;
    flex-direction: column;
}

.sap-wrapper .sap-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.sap-wrapper .sap-card-header {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.sap-wrapper .sap-card-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s ease;
}
.sap-wrapper .sap-card:hover .sap-card-img { transform: scale(1.1); }

/* بج شناور روی عکس کارت */
.sap-wrapper .sap-card-meta-float {
    position: absolute; top: 15px; right: 15px;
    background: rgba(255,255,255,0.9);
    color: var(--sap-navy);
    padding: 6px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sap-wrapper .sap-card-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sap-wrapper .sap-card-title {
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    font-weight: 800;
}
.sap-wrapper .sap-card-title a { color: var(--sap-navy); }
.sap-wrapper .sap-card-title a:hover { color: var(--sap-gold-hover); }

.sap-wrapper .sap-card-meta {
    font-size: 0.9rem;
    color: var(--sap-text-muted);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.sap-wrapper .sap-card-meta .dashicons { color: var(--sap-gold); }

.sap-wrapper .sap-card .sap-btn-full { margin-top: auto; } /* دکمه به پایین بچسبد */


/* ==========================================================================
   5. صفحه تکی آکادمی (SINGLE PAGE)
   ========================================================================== */
.sap-wrapper .sap-single-hero {
    background: var(--sap-navy);
    background: linear-gradient(135deg, var(--sap-navy) 0%, var(--sap-navy-light) 100%);
    padding: 50px;
    border-radius: var(--sap-radius);
    color: #fff;
    display: flex; align-items: center; gap: 40px;
    margin-bottom: 40px;
    box-shadow: var(--sap-shadow-md);
    position: relative;
    overflow: hidden;
}

/* المان دکوراتیو */
.sap-wrapper .sap-single-hero::after {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 300px; height: 300px; background: var(--sap-gold);
    filter: blur(120px); opacity: 0.15; border-radius: 50%;
}

.sap-wrapper .sap-hero-content { flex: 2; z-index: 2; }
.sap-wrapper .sap-hero-image { flex: 1; z-index: 2; text-align: center; }

.sap-wrapper .sap-hero-content h1 {
    font-size: 2.2rem; margin: 15px 0; line-height: 1.3; color: #fff;
}

/* بج‌های شیشه‌ای */
.sap-wrapper .sap-single-hero .sap-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: var(--sap-gold);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem; font-weight: bold;
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid rgba(255,205,3,0.3);
}

.sap-wrapper .sap-meta-item {
    color: rgba(255,255,255,0.9); display: flex; align-items: center; gap: 10px; margin-bottom: 5px;
}

/* --- تب‌های فیکس شده (TAB SYSTEM) --- */
.sap-wrapper .sap-tabs-wrapper {
    margin-bottom: 40px;
}

/* مخفی‌سازی تب‌ها با !important */
.sap-wrapper .sap-tab-pane {
    display: none !important; opacity: 0; padding: 30px;
    background: #fff; border-radius: 24px; box-shadow: var(--sap-shadow-sm);
    transition: opacity 0.3s;
}
.sap-wrapper .sap-tab-pane.active {
    display: block !important; opacity: 1; animation: sapFadeIn 0.5s forwards;
}

/* نوار نویگیشن تب‌ها (با قابلیت اسکرول در موبایل) */
.sap-wrapper .sap-tabs-nav {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    list-style: none !important; padding: 0 !important; margin: 0 0 20px 0 !important;
    border-bottom: 1px solid var(--sap-border); background: #fafafa;
    gap: 10px; padding-bottom: 5px;
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در iOS */
}
/* مخفی کردن اسکرول بار تب‌ها */
.sap-wrapper .sap-tabs-nav::-webkit-scrollbar { display: none; }

.sap-wrapper .sap-tabs-nav li {
    padding: 15px 25px;
    font-weight: 700; color: var(--sap-text-muted);
    cursor: pointer; transition: 0.3s;
    white-space: nowrap; /* جلوگیری از شکستن متن */
    flex-shrink: 0;
    border-bottom: 3px solid transparent;
}

.sap-wrapper .sap-tabs-nav li:hover { background: #f0f0f0; color: var(--sap-navy); }

.sap-wrapper .sap-tabs-nav li.active {
    background: #fff; color: var(--sap-navy); border-bottom-color: var(--sap-gold);
}

/* --- لیست دوره‌ها و رویدادها (EXPANDED ROW) --- */
.sap-wrapper .sap-course-row.expanded {
    border: 1px solid var(--sap-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 25px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.01);
    transition: 0.3s;
}
.sap-wrapper .sap-course-row.expanded:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); transform: translateY(-3px);
}

.sap-wrapper .sap-course-header {
    background: #f8f9fa; padding: 20px 30px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--sap-border);
    flex-wrap: wrap; gap: 10px;
}
.sap-wrapper .sap-course-header h4 { margin: 0; font-size: 1.1rem; color: var(--sap-navy); font-weight: 800; }

.sap-wrapper .sap-price-tag {
    color: var(--sap-success); background: rgba(0, 184, 148, 0.1);
    padding: 5px 12px; border-radius: 8px; font-weight: 800; font-size: 1rem;
}

/* گرید اطلاعات دوره */
.sap-wrapper .sap-course-details-grid {
    display: grid;
    /* ریسپانسیو: موبایل 2 ستون، دسکتاپ 4 ستون */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 20px; padding: 30px;
}
.sap-wrapper .sap-detail-item strong { display: block; margin-top: 5px; color: var(--sap-text); font-size: 0.9rem; }
.sap-wrapper .sap-detail-item .dashicons { 
    color: var(--sap-gold); font-size: 24px; margin-bottom: 5px;
    background: rgba(255, 205, 3, 0.15); padding: 8px; border-radius: 10px; width: 40px; height: 40px;
}

/* --- گرید مربیان --- */
.sap-wrapper .sap-grid-coaches {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px;
}
.sap-wrapper .sap-coach-card {
    background: #fff; border: 1px solid #f0f0f0; border-radius: 16px;
    padding: 20px; text-align: center; transition: 0.3s;
}
.sap-wrapper .sap-coach-card img { width: 80px; height: 80px; }


/* ==========================================================================
   6. صفحه تکی دوره (SINGLE COURSE LAYOUT - NEW)
   ========================================================================== */
.sap-wrapper .sap-course-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* دو سوم محتوا، یک سوم سایدبار */
    gap: 40px;
    align-items: start;
}

/* تصویر دوره */
.sap-wrapper .sap-course-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: var(--sap-shadow-lg);
}
.sap-wrapper .sap-course-image img { width: 100%; height: auto; display: block; }

.sap-wrapper .sap-badge-overlay {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.95); color: var(--sap-navy);
    padding: 8px 16px; border-radius: 30px; font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sap-wrapper .sap-course-header-content h1 {
    font-size: 2rem; color: var(--sap-navy); margin-bottom: 15px; line-height: 1.3;
}

.sap-wrapper .sap-course-meta-row {
    display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 30px;
    padding-bottom: 20px; border-bottom: 1px solid var(--sap-border);
}
.sap-wrapper .sap-course-meta-row span {
    display: flex; align-items: center; gap: 8px; color: var(--sap-text-muted); font-size: 0.95rem;
}
.sap-wrapper .sap-course-meta-row .dashicons { color: var(--sap-gold); }

.sap-wrapper .sap-content-box {
    background: #fff; padding: 30px; border-radius: 20px;
    box-shadow: var(--sap-shadow-sm); margin-bottom: 30px;
}
.sap-wrapper .sap-content-box h3 {
    margin-top: 0; color: var(--sap-navy); border-right: 4px solid var(--sap-gold); padding-right: 15px;
}

/* کارت‌های اطلاعات (مربی/آکادمی) */
.sap-wrapper .sap-info-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.sap-wrapper .sap-info-card {
    background: #fff; padding: 20px; border-radius: 16px;
    display: flex; align-items: center; gap: 15px;
    border: 1px solid var(--sap-border);
}
.sap-wrapper .sap-card-icon {
    width: 50px; height: 50px; background: rgba(255, 205, 3, 0.15);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #eebf00;
}
.sap-wrapper .sap-card-icon .dashicons { font-size: 24px; width: 24px; height: 24px; }
.sap-wrapper .sap-card-text small { display: block; color: var(--sap-text-muted); }
.sap-wrapper .sap-card-text strong { display: block; color: var(--sap-navy); font-size: 1.05rem; }

/* سایدبار چسبان */
.sap-wrapper .sap-sticky-widget {
    background: #fff; padding: 30px; border-radius: 24px;
    box-shadow: var(--sap-shadow-lg); border: 1px solid var(--sap-border);
    position: sticky; top: 100px;
}

.sap-wrapper .sap-price-box {
    text-align: center; margin-bottom: 25px;
    background: #f8f9fa; padding: 20px; border-radius: 16px;
}
.sap-wrapper .sap-label { display: block; color: var(--sap-text-muted); margin-bottom: 5px; }
.sap-wrapper .sap-price-amount { font-size: 2rem; font-weight: 900; color: var(--sap-navy); }
.sap-wrapper .sap-price-amount .currency { font-size: 1rem; font-weight: normal; color: #888; }

.sap-wrapper .sap-features-list { margin-top: 25px; border-top: 1px solid var(--sap-border); padding-top: 20px; }
.sap-wrapper .sap-features-list ul { list-style: none; padding: 0; margin: 0; }
.sap-wrapper .sap-features-list li {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--sap-text); font-size: 0.9rem;
}
.sap-wrapper .sap-features-list .dashicons { color: var(--sap-success); }


/* ==========================================================================
   7. داشبورد و لاگین (DASHBOARD & AUTH)
   ========================================================================== */
.sap-wrapper .sap-auth-container {
    min-height: 70vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top, #f4f7f9, #e0e7ef);
    padding: 20px;
}
.sap-wrapper .sap-auth-box {
    background: #fff; width: 100%; max-width: 450px; padding: 50px 40px;
    border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,37,0.1); text-align: center;
}

.sap-wrapper .sap-dashboard-container {
    background: #fff; border-radius: 24px; box-shadow: var(--sap-shadow-md);
    display: flex; overflow: hidden; min-height: 700px; border: 1px solid var(--sap-border);
}

/* سایدبار داشبورد */
.sap-wrapper .sap-dash-sidebar {
    width: 280px; background: var(--sap-navy); color: #fff;
    padding: 40px 25px; display: flex; flex-direction: column; flex-shrink: 0;
}
.sap-wrapper .sap-avatar img {
    border-radius: 35%; border: 3px solid var(--sap-gold); margin-bottom: 15px;
}
.sap-wrapper .sap-dash-nav { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.sap-wrapper .sap-dash-nav li {
    padding: 15px 20px; border-radius: 12px; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.7);
    font-weight: 500;
}
.sap-wrapper .sap-dash-nav li:hover, .sap-wrapper .sap-dash-nav li.active {
    background: var(--sap-gold); color: var(--sap-navy); font-weight: bold;
}

/* تب‌های داشبورد */
.sap-wrapper .sap-dash-pane {
    display: none !important; padding: 50px; flex: 1; overflow-y: auto;
}
.sap-wrapper .sap-dash-pane.active {
    display: block !important; animation: sapFadeIn 0.4s;
}

/* کارت‌های آمار */
.sap-wrapper .sap-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 25px; }
.sap-wrapper .sap-stat-card {
    background: #fff; padding: 30px; border-radius: 18px; text-align: center;
    border: 1px solid #eee; box-shadow: var(--sap-shadow-sm);
}
.sap-wrapper .sap-stat-card h3 { font-size: 3rem; color: var(--sap-gold); margin: 0; line-height: 1; }


/* ==========================================================================
   8. پیام‌ها و پاپ‌آپ (ALERTS)
   ========================================================================== */
.sap-wrapper .sap-alert {
    padding: 15px 20px; border-radius: 12px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.sap-wrapper .sap-error { background: #fff5f5; color: #e53e3e; border: 1px solid #fed7d7; }
.sap-wrapper .sap-success { background: #f0fff4; color: #38a169; border: 1px solid #c6f6d5; }
.sap-wrapper .sap-info { background: #ebf8ff; color: #3182ce; border: 1px solid #bee3f8; }

/* استایل پاپ‌آپ نقشه (Leaflet - گلوبال) */
.leaflet-popup-content-wrapper { border-radius: 16px !important; padding: 0 !important; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important; }
.leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.sap-map-popup-img { width: 100%; height: 130px; object-fit: cover; }
.sap-map-popup-body { padding: 15px; text-align: center; font-family: 'Vazir', sans-serif; }
.footer-bottom p {
    text-align: center;
}

/* انیمیشن */
@keyframes sapFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   9. مدیا کوئری‌ها (RESPONSIVE)
   ========================================================================== */

/* تبلت (کمتر از 992px) */
@media (max-width: 992px) {
    /* داشبورد: سایدبار به بالا می‌رود */
    .sap-wrapper .sap-dashboard-container { flex-direction: column; }
    
    .sap-wrapper .sap-dash-sidebar {
        width: 100%; padding: 15px; flex-direction: row; align-items: center;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    
    .sap-wrapper .sap-user-info { display: none; } /* مخفی کردن آواتار در موبایل */
    
    .sap-wrapper .sap-dash-nav { flex-direction: row; width: 100%; gap: 10px; }
    .sap-wrapper .sap-dash-nav li { white-space: nowrap; justify-content: center; }
    
    .sap-wrapper .sap-dash-pane { padding: 20px; }

    /* Single Course: ستون‌ها زیر هم */
    .sap-wrapper .sap-course-layout { grid-template-columns: 1fr; }
    .sap-wrapper .sap-sticky-widget { position: static; }
}

/* موبایل (کمتر از 768px) */
@media (max-width: 768px) {
    .sap-wrapper { padding: 20px 0; }
    
    /* سرچ بار ستونی */
    .sap-wrapper .sap-search-bar { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
    .sap-wrapper .sap-filters form { flex-direction: column; }
    .sap-wrapper .sap-view-toggle { justify-content: center; width: 100%; }
    .sap-wrapper .sap-view-toggle button { flex: 1; justify-content: center; }

    /* هدر آکادمی */
    .sap-wrapper .sap-single-hero { flex-direction: column-reverse; padding: 20px; text-align: center; }
    .sap-wrapper .sap-meta-list { justify-content: center; display: flex; flex-direction: column; align-items: center; }
    .sap-wrapper .sap-hero-content h1 { font-size: 1.8rem; }

    /* گریدها */
    .sap-wrapper .sap-course-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sap-wrapper .sap-course-details-grid { grid-template-columns: 1fr 1fr; gap: 15px; padding: 15px; } 
    .sap-wrapper .sap-info-cards { grid-template-columns: 1fr; }
    
    /* نقشه */
    .sap-wrapper #sap-map-container { height: 400px; }
    
    .sap-wrapper .sap-stats-grid { grid-template-columns: 1fr; }
    
    /* لیست آیتم‌های داشبورد */
    .sap-wrapper .sap-grid-list > div {
        flex-direction: column; align-items: flex-start; text-align: right;
    }
    .sap-wrapper .sap-grid-list img { margin: 0 0 10px 0; width: 100%; height: 150px; }
    .sap-wrapper .sap-grid-list .sap-btn-xs { width: 100%; text-align: center; margin-top: 10px; }
    .sap-view-toggle {
        justify-content: space-around;
    }
    button#sap-geo-btn {
        width: 100%;
    }
}