﻿/* ================================================
   Browse Exams Page (Student View)
   ================================================ */

.browse-exams-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
}

.exams-hero {
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
    padding: 4rem 2rem;
    border-radius: 0 0 3rem 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 20px 40px rgba(118, 75, 162, 0.2);
}

.hero-content {
    text-align: center;
    margin-bottom: 3rem;
}

    .hero-content h1 {
        font-size: 3rem;
        font-weight: 800;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1.25rem;
        opacity: 0.9;
    }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

    .stat-box:hover {
        transform: translateY(-5px);
        background: rgba(255, 255, 255, 0.25);
    }

    .stat-box i {
        font-size: 2.5rem;
    }

    .stat-box strong {
        display: block;
        font-size: 2rem;
        font-weight: 800;
    }

    .stat-box span {
        font-size: 0.9rem;
        opacity: 0.9;
    }

.exams-toolbar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

    .search-box i {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--gray-400);
    }

    .search-box input {
        width: 100%;
        padding: 0.875rem 1rem 0.875rem 3rem;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-lg);
        font-size: 1rem;
        transition: all 0.3s ease;
        background: white;
    }

        .search-box input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
        }

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .filter-btn:hover {
        border-color: var(--primary-color);
        background: rgba(118, 75, 162, 0.05);
        transform: translateY(-2px);
    }

    .filter-btn.active {
        background: var(--primary-gradient);
        color: white;
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    }

.browse-exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
}

.browse-exam-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    position: relative;
}

    .browse-exam-card:hover {
        transform: translateY(-12px);
        box-shadow: var(--shadow-xl);
        border-color: var(--primary-color);
    }

.exam-card-ribbon {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
}

.ribbon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

    .ribbon.new {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
    }

    .ribbon.attempted {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
    }

.exam-card-top {
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.exam-category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.exam-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.exam-card-description {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.exam-card-meta {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 2px solid var(--gray-100);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

    .meta-row:last-child {
        margin-bottom: 0;
    }

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 600;
}

    .meta-item i {
        color: var(--primary-color);
        font-size: 1rem;
    }

.exam-card-instructor {
    padding: 1rem 2rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 600;
}

    .exam-card-instructor i {
        color: var(--primary-color);
    }

.exam-last-attempt {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-top: 2px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attempt-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.score-label {
    color: #1e293a;
    font-size: 0.9rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 800;
}

    .score-value.passed {
        color: var(--success-color);
    }

    .score-value.failed {
        color: var(--danger-color);
    }

.attempts-info {
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
}

.exam-card-actions {
    padding: 1.5rem 2rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ================================================
   Instructor Results Page
   ================================================ */

.instructor-results-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
    padding: 2rem 0;
}

.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-md);
    }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

    .stat-icon.primary {
        background: var(--primary-gradient);
    }

    .stat-icon.info {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
    }

    .stat-icon.success {
        background: linear-gradient(135deg, #10b981, #059669);
    }

    .stat-icon.success-alt {
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
    }

    .stat-icon.warning {
        background: linear-gradient(135deg, #f59e0b, #d97706);
    }

    .stat-icon.danger {
        background: linear-gradient(135deg, #ef4444, #dc2626);
    }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 600;
}

.results-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

    .results-filters .filter-select {
        flex: 1;
        min-width: 200px;
    }

    .results-filters .search-box {
        flex: 2;
        min-width: 300px;
    }

.results-table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

    .results-table thead {
        background: linear-gradient(135deg, #764ba2, #667eea);
        color: white;
    }

    .results-table th {
        padding: 1.25rem 1rem;
        text-align: right;
        font-weight: 700;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }

    .results-table tbody tr {
        border-bottom: 1px solid var(--gray-100);
        transition: all 0.3s ease;
    }

        .results-table tbody tr:hover {
            background: var(--gray-50);
        }

        .results-table tbody tr.passed-row {
            border-right: 4px solid var(--success-color);
        }

        .results-table tbody tr.failed-row {
            border-right: 4px solid var(--danger-color);
        }

    .results-table td {
        padding: 1.25rem 1rem;
        color: var(--gray-700);
    }

.student-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.student-name {
    font-weight: 600;
    color: var(--gray-900);
}

.attempt-badge {
    padding: 0.375rem 0.875rem;
    background: rgba(118, 75, 162, 0.1);
    color: var(--primary-color);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.date-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .date-cell i {
        color: var(--primary-color);
        margin-left: 0.25rem;
    }

    .date-cell small {
        color: var(--gray-500);
        font-size: 0.8rem;
    }

.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: var(--gray-100);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}

    .time-badge i {
        color: var(--primary-color);
    }

.percentage-bar {
    position: relative;
    height: 30px;
    background: var(--gray-100);
    border-radius: 9999px;
    overflow: hidden;
}

.percentage-fill {
    height: 100%;
    transition: width 0.5s ease;
}

    .percentage-fill.passed {
        background: linear-gradient(90deg, #10b981, #059669);
    }

    .percentage-fill.failed {
        background: linear-gradient(90deg, #ef4444, #dc2626);
    }

.percentage-text {
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    font-weight: 700;
    color: var(--gray-900);
    font-size: 0.85rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
}

    .status-badge.success {
        background: rgba(16, 185, 129, 0.1);
        color: var(--success-color);
    }

    .status-badge.danger {
        background: rgba(239, 68, 68, 0.1);
        color: var(--danger-color);
    }

    .status-badge.pending {
        background: rgba(245, 158, 11, 0.1);
        color: var(--warning-color);
    }

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.performance-distribution {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

    .performance-distribution h3 {
        font-size: 1.5rem;
        color: var(--gray-900);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.distribution-item {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    gap: 1rem;
    align-items: center;
}

.range-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.range-bar {
    height: 40px;
    background: var(--gray-100);
    border-radius: 9999px;
    overflow: hidden;
}

.range-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 1s ease;
}

.range-count {
    font-weight: 700;
    color: var(--gray-700);
    text-align: left;
}

/* ================================================
   Responsive Design
   ================================================ */

@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .browse-exams-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .results-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .distribution-item {
        grid-template-columns: 120px 1fr 80px;
    }
}

@media (max-width: 768px) {
    .exams-hero {
        padding: 3rem 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .exams-toolbar {
        flex-direction: column;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .browse-exams-grid {
        grid-template-columns: 1fr;
    }

    .results-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-filters {
        flex-direction: column;
    }

    .results-table-container {
        overflow-x: auto;
    }

    .results-table {
        min-width: 900px;
    }

    .distribution-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .performance-distribution {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .exams-hero {
        padding: 2rem 1rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .stat-box {
        padding: 1rem;
    }

        .stat-box i {
            font-size: 2rem;
        }

        .stat-box strong {
            font-size: 1.5rem;
        }

    .exam-card-title {
        font-size: 1.25rem;
    }

    .results-stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}
