/* ==================== MAIN CONTAINER ==================== */
.edurank-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.edurank-header {
    text-align: center;
    margin: 30px 0 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.edurank-title {
    font-size: 2.8em;
    margin: 0 0 10px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.edurank-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 0;
}

/* ==================== FILTERS ==================== */
.edurank-filters {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edurank-filter-btn,
.edurank-reset-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
}

.edurank-filter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edurank-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.edurank-reset-btn {
    background: #e0e6ed;
    color: #2c3e50;
}

.edurank-reset-btn:hover {
    background: #d1d9e6;
    transform: translateY(-2px);
}

/* ==================== STATS BAR ==================== */
.edurank-stats-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #5a6c7d;
}

.stat-icon {
    font-size: 24px;
}

.stat-item strong {
    color: #2c3e50;
    font-weight: 700;
}

/* ==================== GRID VIEW ==================== */
.edurank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.edurank-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.4s ease;
    border: 1px solid #f0f3f7;
}

.edurank-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Position Ribbon */
.position-ribbon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.position-number {
    font-size: 36px;
    font-weight: 800;
}

.position-suffix {
    font-size: 20px;
    vertical-align: super;
    margin-left: -5px;
}

.trophy-icon {
    font-size: 28px;
    margin-left: 10px;
}

/* Photo */
.student-photo {
    width: 100%;
    height: 185px;
    overflow: hidden;
}


.student-photo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.student-photo img {
    width: 50% !important;
    aspect-ratio: 1 / 1;
    border-radius: 50% !important;
    object-fit: cover;
    margin-top: auto;
    border:5px solid #ffcc4d !important;
    box-shadow:1px 8px 23px #6b6fd5 !important;
}




.edurank-card:hover .student-photo img {
    transform: scale(1.05);
}

/* Student Info */
.student-info {
    padding: 10px;
}

/* Name Section */
.name-section {
    margin-bottom: 20px;
}

.student-name {
    margin: 0;
    color: #2c3e50;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Detail Section */
.detail-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e6ed;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
}

.detail-value {
    font-weight: 700;
    color: #2c3e50;
    flex: 1;
}

/* Grade Colors */
.grade-a+ { color: #27ae60; font-weight: 800; }
.grade-a { color: #2ecc71; font-weight: 700; }
.grade-b { color: #3498db; font-weight: 700; }
.grade-c { color: #9b59b6; font-weight: 700; }
.grade-d { color: #f39c12; font-weight: 700; }
.grade-e { color: #e67e22; font-weight: 700; }
.grade-f { color: #e74c3c; font-weight: 700; }

/* Academic Badges */
.academic-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.academic-badge {
    padding: 0px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.badge-icon {
    font-size: 14px;
}

.level-matric {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.level-intermediate {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.group-science, .group-pre_medical, .group-pre_engineering, .group-general_science {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.group-arts, .group-humanities {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.year-badge {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

/* Institute Section */
.institute-section {
    border-top: 2px dashed #e0e6ed;
    padding-top: 20px;
}

.institute-name {
    margin: 0 0 10px;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.institute-address {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
}

/* ==================== TOP 3 SPECIAL STYLES ==================== */
.top-three-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.top-three-card {
    width: 320px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    border-top: 5px solid transparent;
}

.top-three-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.position-1 {
    border-top-color: gold;
    order: 2;
    transform: scale(1.05);
    z-index: 10;
}

.position-2 {
    border-top-color: silver;
    order: 1;
}

.position-3 {
    border-top-color: #cd7f32;
    order: 3;
}

.top-three-card .position-ribbon {
    font-size: 32px;
    padding: 20px;
}

.top-three-card .position-number {
    font-size: 48px;
}

.top-three-card .trophy-icon {
    font-size: 36px;
}

.top-three-card .student-photo {
    width: 140px;
    height: 140px;
    margin: 30px auto 20px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.top-three-card .student-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-three-card .student-info {
    padding: 20px;
    text-align: center;
}

.top-three-card .student-name {
    justify-content: center;
}

.top-three-card .detail-section {
    text-align: left;
}

/* ==================== TABLE VIEW ==================== */
.edurank-table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.edurank-table {
    width: 100%;
    border-collapse: collapse;
}

.edurank-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edurank-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #f0f3f7;
    vertical-align: middle;
}

.edurank-table tr:hover {
    background: #f8f9fa;
}

.edurank-table tr:last-child td {
    border-bottom: none;
}

.position-cell {
    text-align: center;
}

.table-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.position-icon {
    font-size: 24px;
}

.position-number {
    font-weight: bold;
    font-size: 18px;
    color: #2c3e50;
}

.table-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e6ed;
}

.table-no-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #95a5a6;
}

.marks-cell, .percentage-cell {
    font-weight: 700;
    color: #2c3e50;
}

.table-grade {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    min-width: 35px;
    color: rgb(10, 10, 10);
}

.table-grade.grade-a+ { background: #27ae60; }
.table-grade.grade-a { background: #2ecc71; }
.table-grade.grade-b { background: #3498db; }
.table-grade.grade-c { background: #9b59b6; }
.table-grade.grade-d { background: #f39c12; }
.table-grade.grade-e { background: #e67e22; }
.table-grade.grade-f { background: #e74c3c; }

/* ==================== LIST VIEW ==================== */
.edurank-list {
    margin-top: 30px;
}

.edurank-list-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    gap: 25px;
    align-items: flex-start;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 5px solid #667eea;
}

.edurank-list-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.list-position {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.position-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 5px;
}

.position-text {
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
}

.list-photo {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.list-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #e0e6ed;
}

.list-content {
    flex: 1;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.list-header .student-name {
    margin: 0;
    font-size: 22px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.list-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.level-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.group-badge {
    background: #e8f5e9;
    color: #388e3c;
}

.year-badge {
    background: #fff3e0;
    color: #f57c00;
}

.grade-badge {
    color: white;
    font-weight: 700;
}

.grade-badge.grade-a+ { background: #27ae60; }
.grade-badge.grade-a { background: #2ecc71; }
.grade-badge.grade-b { background: #3498db; }
.grade-badge.grade-c { background: #9b59b6; }
.grade-badge.grade-d { background: #f39c12; }
.grade-badge.grade-e { background: #e67e22; }
.grade-badge.grade-f { background: #e74c3c; }

.list-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #e0e6ed;
    align-items: center;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 100px;
    font-weight: 600;
    color: #2c3e50;
}

.detail-value {
    flex: 1;
    color: #5a6c7d;
}

.list-institute {
    background: #7bdcb5;
    color: white;
    padding: 20px;
    border-radius: 12px;
}

.institute-name {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.institute-address {
    margin: 0;
    font-size: 14px;
    color: #cfc800;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== NO RESULTS ==================== */
.edurank-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    margin: 40px 0;
}

.no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.edurank-no-results h3 {
    color: #2c3e50;
    margin: 0 0 10px;
    font-size: 24px;
}

.edurank-no-results p {
    color: #7f8c8d;
    margin: 0;
    font-size: 16px;
}

/* ==================== ERROR ==================== */
.edurank-error {
    background: #ffeaea;
    border: 2px solid #ffcccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #e74c3c;
    font-weight: 600;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 992px) {
    .edurank-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .top-three-container {
        flex-direction: column;
        align-items: center;
    }
    
    .position-1 {
        transform: none;
        order: 1;
    }
}

@media (max-width: 768px) {
    .edurank-wrapper {
        padding: 15px;
    }
    
    .edurank-title {
        font-size: 2em;
    }
    
    .edurank-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .edurank-stats-bar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .edurank-grid {
        grid-template-columns: 1fr;
    }
    
    .edurank-list-item {
        flex-direction: column;
        text-align: center;
    }
    
    .list-position {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .list-photo {
        margin: 0 auto 20px;
    }
    
    .list-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .detail-row {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .detail-label {
        width: 100%;
    }
    
    .edurank-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .edurank-title {
        font-size: 1.8em;
    }
    
    .edurank-card {
        margin: 0 10px;
    }
    
    .student-info {
        padding: 20px;
    }
    
    .student-name {
        font-size: 20px;
    }
    
    .position-ribbon {
        font-size: 20px;
        padding: 12px 15px;
    }
    
    .position-number {
        font-size: 28px;
    }
}
