/*
 * Stylesheet for Top Students Plugin v7.0 - Interactive Version
 */
#top-students-app.ts-final-design {
    direction: rtl;
    background: transparent;
    padding: 20px 0;
    font-family: inherit;
    text-align: center;
}
#top-students-app .ts-header {
    margin-bottom: 35px;
}
#top-students-app .ts-header h1 {
    color: #334155;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    margin: 0;
    display: inline-block;
}

/* ===== فیلترها ===== */
.ts-filters-container {
    max-width: 900px;
    margin: 0 auto 50px auto;
    padding: 0;
}
.ts-filters-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ts-select-wrapper { position: relative; }
#top-students-app select {
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 20px 12px 45px;
    font-size: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align-last: right;
}
#top-students-app select:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}
.ts-filters-wrapper .ts-select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: #94a3b8;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ===== گرید دانشجو ===== */
.students-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 420px;
    align-items: stretch;
}
.student-card {
    width: 280px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.student-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* ===== تصویر ===== */
.student-image-container {
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    position: relative;
}
.student-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* ===== اطلاعات ===== */
.student-info {
    padding: 25px 15px;
    position: relative;
    flex-grow: 1;
}
.student-info h3 {
    font-size: 22px;
    color: #1e293b;
    font-weight: 700;
    margin: 10px 0 5px 0;
}
.student-info p.marks {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* ===== نشان رتبه ===== */
.rank-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.student-card.gold .rank-badge { background: linear-gradient(135deg, #fceabb, #f8b500); }
.student-card.silver .rank-badge { background: linear-gradient(135deg, #e6e9f0, #eef1f5); color: #848b92; }
.student-card.bronze .rank-badge { background: linear-gradient(135deg, #d7a98b, #a97142); color: white; }

p.no-data {
    font-size: 18px;
    color: #94a3b8;
    margin-top: 60px;
    width: 100%;
    text-align: center;
}

/* ===== کاور (کلیک کنید) ===== */
.student-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.4s ease, visibility 0.4s;
    border-radius: 15px;
}

/* وقتی کارت فعال بشه کاور میره و محتوا میاد */
.student-card-content {
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}
.student-card.active .student-cover {
    opacity: 0;
    visibility: hidden;
}
.student-card.active .student-card-content {
    opacity: 1;
}

/* ===== موبایل ===== */
@media (max-width: 992px) {
    .students-grid { align-items: flex-start; }
    .ts-filters-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    #top-students-app select {
        width: 320px;
        max-width: 90%; 
        height: 50px; 
    }
    .student-card { width: calc(50% - 10px); }

    .student-image-container {
        height: auto;
        aspect-ratio: 2 / 3; 
        border-radius: 15px;
        background-color: #f8fafc;
        overflow: hidden;
        position: relative;
    }
    .student-card img {
        border-radius: 15px;
        object-fit: cover;
        object-position: top;
    }
    .student-info {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2;
        padding: 30px 10px 15px;
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 40%, transparent 70%);
        border-radius: 0 0 15px 15px;
        text-align: center;
    }
    .student-card.gold .student-info {
        background: linear-gradient(to top, rgba(60, 42, 0, 0.9) 0%, rgba(60, 42, 0, 0.5) 40%, transparent 70%);
    }
    .student-card.silver .student-info {
        background: linear-gradient(to top, rgba(50, 55, 60, 0.9) 0%, rgba(50, 55, 60, 0.5) 40%, transparent 70%);
    }
    .student-card.bronze .student-info {
        background: linear-gradient(to top, rgba(80, 45, 10, 0.9) 0%, rgba(80, 45, 10, 0.5) 40%, transparent 70%);
    }
    .student-info h3, .student-info p.marks {
        color: white;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    }
    .student-info h3 { font-size: 16px; }
    .student-info p.marks { font-size: 13px; margin-top: 3px; }
    .rank-badge {
        top: 10px;
        right: 10px;
        left: auto;
        transform: none;
        width: 35px;
        height: 35px;
        font-size: 18px;
        z-index: 3;
    }
}
