.progress-section {
    padding: 6rem 0.75rem 3rem;
    min-height: calc(100vh - 150px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.progress-section .container {
    position: relative;
}

.progress-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

@media (min-width: 768px) {
    .progress-section {
        padding: 7rem 1rem 4rem;
        min-height: auto;
    }
}

.class-selection {
    text-align: center;
    margin: 0 0.5rem 2rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: slideUp 0.6s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selection-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.selection-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.selection-header i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
    position: relative;
    z-index: 1;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.selection-header h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    font-family: 'Nunito', sans-serif;
}

.selection-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    margin: 0;
}

.class-buttons {
    display: grid;
    gap: 1rem;
    padding: 2rem 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .class-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

.class-btn {
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.btn-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.btn-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.selection-footer {
    padding: 0;
    margin: 0;
}

.footer-img {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 0 0 20px 20px;
}

@media (min-width: 768px) {
    .class-selection {
        margin-bottom: 3rem;
    }
    
    .selection-header {
        padding: 2.5rem 2rem;
    }
    
    .selection-header i {
        font-size: 3rem;
    }
    
    .selection-header h3 {
        font-size: 1.8rem;
    }
    
    .selection-header p {
        font-size: 1rem;
    }
    
    .class-buttons {
        gap: 2rem;
        padding: 3rem 2rem;
    }
    
    .class-btn {
        padding: 2rem 1.5rem;
    }
    
    .btn-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .btn-text {
        font-size: 1.2rem;
    }
}

.class-btn:hover .btn-shine {
    left: 100%;
}

.class-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.class-btn:hover .btn-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.3);
}

.class-btn:active {
    transform: scale(0.98);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.students-list {
    max-width: 1400px;
    margin: 0 0.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 1.8rem 1.2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: slideUp 0.6s ease;
}

.list-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.list-header i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 0.8rem;
    display: block;
}

.list-header h3 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-family: 'Nunito', sans-serif;
}

.list-header p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.students-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 480px) {
    .students-grid {
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .students-list {
        margin: 0 auto;
        padding: 2.5rem;
    }
    
    .list-header {
        margin-bottom: 2.5rem;
        padding-bottom: 2rem;
    }
    
    .list-header i {
        font-size: 2.5rem;
    }
    
    .list-header h3 {
        font-size: 1.8rem;
    }
    
    .list-header p {
        font-size: 1rem;
    }
    
    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
}

.student-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1rem 0.6rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: visible;
    touch-action: manipulation;
}

@media (min-width: 768px) {
    .student-card {
        padding: 2rem 1.2rem;
        border-radius: 20px;
    }
}

.student-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

@media (min-width: 768px) {
    .student-card::before {
        border-radius: 20px;
    }
}

.student-card:active {
    transform: scale(0.96);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.student-card:active::before {
    opacity: 1;
}

@media (hover: hover) {
    .student-card:hover::before {
        opacity: 1;
    }
    
    .student-card:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 15px 35px rgba(102, 126, 234, 0.25);
    }
}

.student-avatar {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 0.7rem;
}

.student-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    z-index: 0;
}

.student-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.student-card:active img {
    transform: scale(1.08);
}

@media (hover: hover) {
    .student-card:hover img {
        transform: scale(1.05) rotate(3deg);
    }
}

.student-card h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
    font-family: 'Nunito', sans-serif;
}

.student-card p {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

@media (min-width: 480px) {
    .student-avatar {
        width: 80px;
        height: 80px;
        margin-bottom: 0.8rem;
    }
    
    .student-card img {
        width: 80px;
        height: 80px;
    }
    
    .student-card h4 {
        font-size: 0.9rem;
    }
    
    .student-card p {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }
}

@media (min-width: 768px) {
    .student-avatar {
        width: 100px;
        height: 100px;
        margin-bottom: 1.2rem;
    }
    
    .student-card img {
        width: 100px;
        height: 100px;
        border: 5px solid white;
    }
    
    .student-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
    }
    
    .student-card p {
        font-size: 0.9rem;
        padding: 0.5rem 1.2rem;
        border-radius: 20px;
    }
}

.back-button-top {
    position: fixed;
    top: 5.5rem;
    left: 1rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border: 2px solid #667eea;
    border-radius: 50%;
    color: #667eea;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    touch-action: manipulation;
}

.back-button-top:active {
    background: #667eea;
    color: white;
    transform: scale(0.9);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@media (hover: hover) {
    .back-button-top:hover {
        background: #667eea;
        color: white;
        transform: scale(1.1);
        box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
    }
}

@media (min-width: 768px) {
    .back-button-top {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        top: 6rem;
        left: 1.5rem;
    }
}

.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box button:hover {
    background: #1d4ed8;
}

.report-card {
    max-width: 100%;
    margin: 0 0 5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: visible;
    display: none;
}

@media (min-width: 768px) {
    .report-card {
        max-width: 1000px;
        margin: 0 auto 3rem;
        border-radius: 24px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

.report-card.show {
    display: block;
    animation: slideIn 0.6s ease;
}

.report-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .report-header {
        padding: 3rem 2rem;
        border-radius: 24px 24px 0 0;
    }
}

.report-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.report-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.student-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    margin: 0 auto 1rem;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    animation: photoFloat 3s ease-in-out infinite;
}

@keyframes photoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.report-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    color: white;
    font-family: 'Nunito', sans-serif;
}

@media (min-width: 768px) {
    .student-photo {
        width: 120px;
        height: 120px;
        border: 6px solid white;
        margin: 0 auto 1.5rem;
    }
    
    .report-header h2 {
        font-size: 2rem;
    }
}

.report-header p {
    position: relative;
    z-index: 1;
    opacity: 0.95;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    .report-header p {
        font-size: 1.1rem;
        padding: 0.5rem 1.5rem;
    }
}

.report-body {
    padding: 1.5rem 1rem;
    overflow: visible;
}

@media (min-width: 768px) {
    .report-body {
        padding: 2.5rem 2.5rem 3rem;
    }
}

.info-grid {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 2rem;
    grid-template-columns: 1fr;
    margin-left: 0;
    margin-right: 0;
}

.info-grid .info-item:has(#attendance) {
    display: none;
}

@media (min-width: 480px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .info-grid {
        gap: 1.5rem;
        margin-bottom: 3rem;
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.info-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 14px;
    z-index: -1;
    opacity: 0.3;
}

@media (min-width: 768px) {
    .info-item {
        padding: 1.3rem 1.5rem;
        border-radius: 16px;
    }
    
    .info-item::before {
        border-radius: 16px;
    }
}

@media (hover: hover) {
    .info-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    }
    
    .info-item:hover::before {
        opacity: 0.5;
    }
}

.info-label {
    font-weight: 700;
    color: #4a5568;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label::before {
    content: '●';
    color: #667eea;
    font-size: 1.2rem;
}

.info-value {
    color: #667eea;
    font-weight: 800;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .info-label {
        font-size: 1rem;
    }
    
    .info-value {
        font-size: 1.1rem;
    }
}

.exams-container {
    margin-top: 2rem;
    margin-left: -1rem;
    margin-right: -1rem;
    contain: layout style paint;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    will-change: scroll-position;
}

@media (min-width: 768px) {
    .exams-container {
        margin-left: 0;
        margin-right: 0;
    }
    
    .table-wrapper {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
}

.marks-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.75rem;
    min-width: 600px;
    table-layout: fixed;
}

.marks-table th,
.marks-table td {
    padding: 0.8rem 0.5rem;
    text-align: center;
    border: 1px solid #d1d5db;
}

.marks-table tbody tr:nth-child(odd) {
    background: #fafbfc;
}

@media (min-width: 768px) {
    .marks-table {
        font-size: 0.95rem;
        min-width: auto;
    }
    
    .marks-table th,
    .marks-table td {
        padding: 1rem 0.8rem;
    }
}

.subject-col {
    background: #667eea;
    color: white;
    font-weight: 700;
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

@media (min-width: 768px) {
    .subject-col {
        width: auto;
        min-width: auto;
        max-width: none;
    }
}

.exam-header {
    background: #667eea;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
}

.sub-header {
    background: #f3f4f6;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b5563;
}

.subject-name {
    font-weight: 700;
    color: white;
    text-align: left;
    padding-left: 0.6rem;
    padding-right: 0.4rem;
    background: #667eea;
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .subject-name {
        width: auto;
        min-width: auto;
        max-width: none;
        font-size: inherit;
    }
}

@media (min-width: 768px) {
    .exam-header {
        font-size: 1rem;
    }
    
    .sub-header {
        font-size: 0.85rem;
    }
    
    .subject-name {
        padding-left: 1.5rem;
    }
}

.mark-cell {
    color: #1f2937;
    font-weight: 600;
    background: white;
    transition: all 0.3s ease;
}

.mark-cell.fail {
    color: #dc2626;
    font-weight: 800;
    background: #fee2e2;
}

.mark-cell.low {
    color: #ea580c;
    font-weight: 700;
    background: #ffedd5;
}

.mark-cell.medium {
    color: #1f2937;
    font-weight: 600;
    background: white;
}

.mark-cell.high {
    color: #059669;
    font-weight: 800;
    background: #d1fae5;
}

.mark-cell.total-cell {
    font-weight: 800;
    font-size: 0.85rem;
    background: #eff6ff;
}

.mark-cell.total-cell.fail {
    background: #fee2e2;
}

.mark-cell.total-cell.low {
    background: #ffedd5;
}

.mark-cell.total-cell.medium {
    background: #eff6ff;
}

.mark-cell.total-cell.high {
    background: #d1fae5;
}

.mark-cell.max-cell {
    color: #d97706;
    font-weight: 700;
    font-size: 0.7rem;
    background: #fffbeb;
}

.mark-cell.grand-total {
    font-weight: 900;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.mark-cell.grand-total.fail {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.mark-cell.grand-total.low {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.mark-cell.grand-total.medium {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.mark-cell.grand-total.high {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.mark-cell.grade-cell {
    font-weight: 900;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.grade-A\+, .mark-cell.grade-A\+ {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.grade-A, .mark-cell.grade-A {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.grade-B, .mark-cell.grade-B {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
}

.grade-C, .mark-cell.grade-C {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.grade-D, .mark-cell.grade-D {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    color: white;
}

.grade-F, .mark-cell.grade-F {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.total-row {
    background: linear-gradient(145deg, #f8fafc 0%, #e5e7eb 100%);
    font-weight: 800;
}

.total-row .subject-name {
    background: #667eea;
    color: white;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.total-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .mark-cell.total {
        font-size: 1rem;
    }
    
    .mark-cell.max {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .table-wrapper {
        padding: 1rem;
        border-radius: 20px;
    }
    
    .marks-table {
        font-size: 0.95rem;
        min-width: auto;
        border-radius: 16px;
    }
    
    .marks-table th,
    .marks-table td {
        padding: 1.1rem 0.9rem;
    }
    
    .exam-header {
        font-size: 1rem;
        padding: 1.2rem 1rem;
    }
    
    .sub-header {
        font-size: 0.85rem;
        padding: 0.8rem;
    }
    
    .subject-name {
        padding-left: 1.5rem;
    }
    
    .mark-cell.total {
        font-size: 1rem;
    }
    
    .mark-cell.low,
    .mark-cell.high {
        font-size: 1rem;
    }
    
    .mark-cell.max {
        font-size: 0.85rem;
    }
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

.grade {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .grade {
        padding: 0.35rem 0.85rem;
        font-size: 0.9rem;
        border-radius: 18px;
    }
}

.grade.A\+, .grade-A\+ { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.grade.A, .grade-A { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.grade.B, .grade-B { background: linear-gradient(135deg, #0891b2, #0e7490); color: white; }
.grade.C, .grade-C { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.grade.D, .grade-D { background: linear-gradient(135deg, #ea580c, #c2410c); color: white; }
.grade.F, .grade-F { background: linear-gradient(135deg, #dc2626, #991b1b); color: white; font-weight: 800; }

.performance-summary {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 480px) {
    .performance-summary {
        gap: 0.8rem;
    }
}

@media (min-width: 768px) {
    .performance-summary {
        gap: 1.2rem;
        margin-bottom: 2.5rem;
        grid-template-columns: repeat(3, 1fr);
    }
}

.summary-card {
    padding: 0.9rem 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    min-height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 480px) {
    .summary-card {
        padding: 1rem 0.7rem;
        min-height: 85px;
    }
    
    .attendance-bar {
        height: 38px;
    }
}

@media (min-width: 768px) {
    .summary-card {
        padding: 1.8rem 1.3rem;
        border-radius: 16px;
        min-height: auto;
        overflow: hidden;
    }
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px 14px 0 0;
}

@media (hover: hover) {
    .summary-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    }
}

.summary-card h4 {
    color: #718096;
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    font-family: 'Nunito', sans-serif;
}

.summary-card .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #667eea;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    word-break: break-word;
    line-height: 1.3;
}

@media (min-width: 480px) {
    .summary-card h4 {
        font-size: 0.75rem;
    }
    
    .summary-card .value {
        font-size: 1.3rem;
    }
}

@media (min-width: 768px) {
    .summary-card h4 {
        font-size: 0.9rem;
        margin-bottom: 0.9rem;
    }
    
    .summary-card .value {
        font-size: 2rem;
    }
}

.attendance-bar {
    width: 100%;
    height: 35px;
    background: linear-gradient(to right, #ef4444 0%, #ef4444 85%, #f59e0b 85%, #f59e0b 90%, #3b82f6 90%, #3b82f6 95%, #10b981 95%, #10b981 100%);
    border-radius: 20px;
    overflow: visible;
    margin-top: 0.7rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.attendance-fill {
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    transition: width 1s ease;
    position: relative;
}

.attendance-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 45px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
}

@media (min-width: 768px) {
    .attendance-bar {
        height: 40px;
        margin-top: 1rem;
    }
    
    .attendance-fill {
        font-size: 1rem;
    }
    
    .attendance-fill::after {
        height: 50px;
    }
}

.no-result {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    display: none;
}

.no-result.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    text-align: center;
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
    letter-spacing: 0.5px;
    font-family: 'Nunito', sans-serif;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        margin-bottom: 3rem;
    }
}

@media (min-width: 768px) {
    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .class-buttons {
        gap: 2rem;
    }
    
    .class-btn {
        min-width: 180px;
        font-size: 1.2rem;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .student-card:hover {
        transform: none;
    }
    
    .class-btn:hover {
        transform: none;
    }
    
    .summary-card:hover {
        transform: none;
    }
}

.student-navigation {
    display: flex;
    gap: 1rem;
    margin: 2rem 0 1.5rem;
    padding: 0 1rem;
}

.nav-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    touch-action: manipulation;
}

.prev-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.next-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (hover: hover) {
    .nav-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
}

.students-horizontal-list {
    margin: 0 0 2rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border-top: 3px solid #667eea;
}

.students-horizontal-list h4 {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.students-horizontal-list h4 i {
    color: #667eea;
}

.horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 3px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.horizontal-student-card {
    min-width: 100px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    padding: 0.5rem;
    border-radius: 12px;
    background: white;
    border: 2px solid transparent;
}

.horizontal-student-card.active {
    border-color: #667eea;
    background: linear-gradient(145deg, #ffffff 0%, #f0f4ff 100%);
}

.horizontal-student-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
    margin: 0 auto 0.5rem;
    transition: all 0.3s ease;
}

.horizontal-student-card.active img {
    border-color: #667eea;
    transform: scale(1.1);
}

.horizontal-student-card p {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horizontal-student-card:active {
    transform: scale(0.95);
}

@media (hover: hover) {
    .horizontal-student-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    }
}

@media (min-width: 768px) {
    .student-navigation {
        margin: 3rem 0 2rem;
    }
    
    .nav-btn {
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
    }
    
    .students-horizontal-list {
        padding: 2rem 1.5rem;
    }
    
    .students-horizontal-list h4 {
        font-size: 1.2rem;
    }
    
    .horizontal-student-card {
        min-width: 120px;
    }
    
    .horizontal-student-card img {
        width: 80px;
        height: 80px;
    }
    
    .horizontal-student-card p {
        font-size: 0.85rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .progress-section {
        padding: 4.5rem 0.5rem 1.5rem;
    }
    
    .class-selection {
        margin: 0 0.25rem 1.5rem;
        padding: 1rem;
    }
    
    .students-list {
        margin: 0 0.25rem;
        padding: 1rem;
    }
    
    .report-card {
        margin: 0 0.25rem;
    }
    
    .students-grid {
        gap: 0.6rem;
    }
    
    .student-card {
        padding: 0.8rem 0.5rem;
    }
    
    .student-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 0.6rem;
    }
    
    .student-card img {
        width: 60px;
        height: 60px;
    }
    
    .student-card h4 {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
    
    .student-card p {
        font-size: 0.65rem;
        padding: 0.25rem 0.6rem;
    }
}


/* Mark Fraction Display */`n.mark-fraction {`n    display: flex;`n    flex-direction: column;`n    align-items: center;`n    justify-content: center;`n    line-height: 1.3;`n    gap: 3px;`n    font-size: 1rem;`n    font-weight: 700;`n    padding: 0.3rem 0;`n}`n`n.mark-divider {`n    width: 80%;`n    height: 2px;`n    background: linear-gradient(90deg, transparent, #667eea, transparent);`n    margin: 2px 0;`n    border-radius: 2px;`n}`n`n.mark-max {`n    font-size: 0.75rem;`n    color: #667eea;`n    font-weight: 700;`n    opacity: 0.8;`n}`n`n@media (min-width: 768px) {`n    .mark-fraction {`n        font-size: 1.1rem;`n        gap: 4px;`n        padding: 0.4rem 0;`n    }`n    `n    .mark-divider {`n        height: 2.5px;`n        margin: 3px 0;`n    }`n    `n    .mark-max {`n        font-size: 0.85rem;`n    }`n}`n

.mark-divider { width: 100%; height: 1px; background: #9ca3af; margin: 1px 0; }

.mark-max {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 600;
}

@media (min-width: 768px) {
    .mark-fraction {
        font-size: 1rem;
    }
    
    .mark-divider { width: 100%; height: 1px; background: #9ca3af; margin: 1px 0; }
    
    .mark-max {
        font-size: 0.8rem;
    }
}



/* Improved Mark Fraction Display */
.mark-fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0.5rem 0.2rem;
    min-height: 50px;
}

.mark-obtained {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
}

.mark-divider {
    width: 70%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    margin: 2px 0;
}

.mark-max {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1;
}

@media (min-width: 768px) {
    .mark-fraction {
        gap: 3px;
        padding: 0.6rem 0.3rem;
        min-height: 60px;
    }
    
    .mark-obtained {
        font-size: 1.3rem;
    }
    
    .mark-divider {
        width: 65%;
        height: 2px;
        margin: 3px 0;
    }
    
    .mark-max {
        font-size: 0.9rem;
    }
}


/* Performance optimizations for table rendering */
.report-body {
    content-visibility: auto;
}

.marks-table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: auto 60px;
}

.mark-cell {
    transform: translateZ(0);
    backface-visibility: hidden;
}
