/* ==================== CONTAINER ==================== */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 25px;
}

/* ==================== HEADER بخش ==================== */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title-icon {
    font-size: 32px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.section-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* ==================== GRID پایه‌ها ==================== */
.grades {
    display: grid;
    grid-template-columns: repeat(6, 1fr);   /* 👈 همیشه ۶ ستون */
    gap: 18px;
    padding: 20px 0;
    max-width: 100%;
}

/* ==================== کارت پایه ==================== */
.grade-card {
    text-decoration: none;
    display: block;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 1000px;
}

.grade-card-inner {
    border-radius: 20px;
    padding: 14px 12px 16px;
    box-shadow:
        0 6px 20px rgba(59, 130, 246, 0.1),
        0 2px 5px rgba(59, 130, 246, 0.05);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.grade-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
}

.grade-card:hover .grade-card-inner {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.05);
}

.grade-card:hover .grade-card-inner::before {
    left: 100%;
}

/* ---------- تصویر پایه (با گوشه‌های گرد) ---------- */
.grade-image-wrapper {
    width: 115px;
    height: 115px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    padding: 8px;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.5),
                0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s ease;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.grade-card:hover .grade-image-wrapper {
    transform: scale(1.05) rotate(-3deg);
    background: rgba(255, 255, 255, 0.7);
}

.grade-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
    transition: transform 0.35s ease;
    border-radius: 14px;
}

.grade-card:hover .grade-image {
    transform: scale(1.05);
}

.grade-image-default {
    font-size: 55px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* ---------- اطلاعات پایه ---------- */
.grade-info {
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
}

.grade-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.grade-card:hover .grade-badge {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.badge-icon {
    font-size: 13px;
}

/* ==================== رنگ‌های پاستلی به ترتیب ==================== */
/* ترتیب: آبی → سبز → زرد → گلبهی → بنفش → نارنجی */

/* کارت 1 - آبی */
.grade-card:nth-child(6n+1) .grade-card-inner {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe);
}
.grade-card:nth-child(6n+1) .grade-title { color: #1e40af; }
.grade-card:nth-child(6n+1) .grade-badge { color: #1e40af; }

/* کارت 2 - سبز */
.grade-card:nth-child(6n+2) .grade-card-inner {
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
}
.grade-card:nth-child(6n+2) .grade-title { color: #065f46; }
.grade-card:nth-child(6n+2) .grade-badge { color: #065f46; }

/* کارت 3 - زرد */
.grade-card:nth-child(6n+3) .grade-card-inner {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
}
.grade-card:nth-child(6n+3) .grade-title { color: #92400e; }
.grade-card:nth-child(6n+3) .grade-badge { color: #92400e; }

/* کارت 4 - گلبهی */
.grade-card:nth-child(6n+4) .grade-card-inner {
    background: linear-gradient(145deg, #fce7f3, #fbcfe8);
}
.grade-card:nth-child(6n+4) .grade-title { color: #9f1239; }
.grade-card:nth-child(6n+4) .grade-badge { color: #9f1239; }

/* کارت 5 - بنفش */
.grade-card:nth-child(6n+5) .grade-card-inner {
    background: linear-gradient(145deg, #ede9fe, #ddd6fe);
}
.grade-card:nth-child(6n+5) .grade-title { color: #5b21b6; }
.grade-card:nth-child(6n+5) .grade-badge { color: #5b21b6; }

/* کارت 6 - نارنجی */
.grade-card:nth-child(6n+6) .grade-card-inner {
    background: linear-gradient(145deg, #ffedd5, #fed7aa);
}
.grade-card:nth-child(6n+6) .grade-title { color: #9a3412; }
.grade-card:nth-child(6n+6) .grade-badge { color: #9a3412; }

/* ==================== LESSONS ==================== */
#lessons {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.lesson {
    padding: 15px 25px;
    background: linear-gradient(135deg, #ffffff, #f0f7ff);
    border: 2px solid #e0f2fe;
    border-radius: 15px;
    text-decoration: none;
    color: #1e3a8a;
    font-weight: 700;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.lesson:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    border-color: transparent;
}

/* ==================== RESPONSIVE ==================== */

/* لپ‌تاپ متوسط - ۶ ستون */
@media (max-width: 1024px) {
    .grades {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }

    .grade-image-wrapper {
        width: 100px;
        height: 100px;
    }

    .grade-title {
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
    }
}

/* تبلت - ۳ ستون */
@media (max-width: 900px) {
    .grades {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .grade-image-wrapper {
        width: 115px;
        height: 115px;
    }

    .grade-title {
        font-size: 16px;
    }
}

/* موبایل - ۳ ستون فشرده */
@media (max-width: 768px) {
    .container {
        padding: 25px 15px;
    }

    .grades {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .grade-card-inner {
        padding: 12px 8px 14px;
    }

    .grade-image-wrapper {
        width: 90px;
        height: 90px;
        border-radius: 16px;
        padding: 6px;
    }

    .grade-image {
        border-radius: 12px;
    }

    .grade-title {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .grade-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .section-title {
        font-size: 20px;
    }

    .section-subtitle {
        font-size: 13px;
    }
}

/* موبایل کوچک - ۲ ستون */
@media (max-width: 500px) {
    .grades {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .grade-image-wrapper {
        width: 100px;
        height: 100px;
    }

    .grade-title {
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .grade-image-wrapper {
        width: 85px;
        height: 85px;
        padding: 5px;
    }

    .grade-title {
        font-size: 13px;
    }
}
/* تنظیمات مخصوص موبایل */
@media (max-width: 768px) {
    /* تغییر جهت چیدمان به ستونی */
    .home-container, 
    .main-wrapper, 
    .app-layout { /* کلاس کانتینر اصلی دو ستونه سایت */
        display: flex !important;
        flex-direction: column !important;
    }

    /* ۱. اول کارت کاربر در بالا قرار بگیرد */
    .player-card, 
    .user-profile-card {
        order: 1 !important;
        margin-bottom: 15px !important;
    }

    /* ۲. دوم محتوای اصلی (بنرها، پایه‌ها، ویدیوها و...) */
    .home-main-content, 
    main, 
    .content-area {
        order: 2 !important;
    }

    /* ۳. سوم جدول قهرمانان در انتهای صفحه */
    .leaderboard-card, 
    .global-leaderboard {
        order: 3 !important;
        margin-top: 20px !important;
    }
}