/*
 * DECAS Exam, Results & Timeline Styles
 * Used in exam pages, result displays, and timeline views
 */

/* ============================================
   TIMELINE
   ============================================ */
.timeline-container {
    position: relative;
    padding: 2rem 0;
}
.timeline-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #0F2D5C;
    transition: all 0.3s ease;
}
.timeline-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}
.timeline-item.today {
    border-left-color: #28a745;
}
.timeline-item.upcoming {
    border-left-color: #F4B400;
}
.timeline-item.completed {
    border-left-color: #6c757d;
    opacity: 0.8;
}
.timeline-date {
    background: linear-gradient(135deg, #0F2D5C, #163D7A);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.timeline-date.today {
    background: linear-gradient(135deg, #28a745, #20c997);
}
.timeline-date.upcoming {
    background: linear-gradient(135deg, #F4B400, #D89C00);
}

/* ============================================
   EXAM CARDS
   ============================================ */
.exam-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #0F2D5C;
    transition: all 0.3s ease;
}
.exam-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.exam-card.active {
    border-left-color: #28a745;
}
.exam-card.upcoming {
    border-left-color: #F4B400;
}
.exam-card.completed {
    border-left-color: #6c757d;
}
.exam-card.missed {
    border-left-color: #dc3545;
}
.exam-title {
    font-weight: 600;
    color: #0F2D5C;
    margin-bottom: 0.25rem;
}
.exam-subject {
    color: #7f8c8d;
    font-size: 0.9rem;
}
.exam-details {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 1rem;
}
.exam-info h5 {
    color: #0F2D5C;
    margin-bottom: 0.5rem;
}
.exam-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.exam-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}
.exam-meta-item i {
    color: #0F2D5C;
}

/* ============================================
   DURATION & STATUS BADGES
   ============================================ */
.duration-badge {
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ============================================
   EXAM BUTTONS
   ============================================ */
.btn-exam {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}
.btn-start {
    background: linear-gradient(135deg, #0F2D5C, #163D7A);
    color: white;
    border: none;
}
.btn-start:hover {
    background: linear-gradient(135deg, #163D7A, #2A5CAA);
    color: white;
    transform: translateY(-2px);
}
.btn-resume {
    background: linear-gradient(135deg, #F4B400, #D89C00);
    color: #0F2D5C;
    border: none;
}
.btn-resume:hover {
    background: linear-gradient(135deg, #D89C00, #F4B400);
    color: #0F2D5C;
}
.btn-completed {
    background: #e9ecef;
    color: #6c757d;
    border: none;
    cursor: default;
}

/* ============================================
   SCORE CELLS
   ============================================ */
.score-cell {
    font-weight: 600;
    text-align: center;
}
.score-pass { color: #11998e; }
.score-fail { color: #eb3349; }

/* ============================================
   GRADE BADGE
   ============================================ */
.grade-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ============================================
   PERFORMER CARDS & RANK
   ============================================ */
.performer-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.performer-card:last-child {
    margin-bottom: 0;
}
.performer-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}
.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #B87333); }

/* ============================================
   STUDENT AVATAR
   ============================================ */
.student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.student-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #0F2D5C;
}

/* ============================================
   NAV PILLS CUSTOM
   ============================================ */
.nav-pills-custom .nav-link {
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    margin-right: 0.5rem;
}
.nav-pills-custom .nav-link.active {
    background: var(--primary-gradient);
    color: white;
}

/* ============================================
   EXPORT BUTTON
   ============================================ */
.export-btn {
    border-radius: 8px;
}

/* ============================================
   HEAT MAP
   ============================================ */
#chartdiv {
    width: 100%;
    height: 500px;
}

/* ============================================
   CALENDAR TABLE (Leave)
   ============================================ */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
}
.calendar-table th {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    font-weight: 600;
}
.calendar-table td {
    border: 1px solid #dee2e6;
    padding: 4px;
    vertical-align: top;
    height: 100px;
    width: 14.28%;
}
.calendar-table td.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}
.calendar-table td .day-number {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.calendar-table td .leave-badge {
    display: block;
    font-size: 11px;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    cursor: pointer;
}
.calendar-table td.today {
    background: #e8f5e9;
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .no-print { display: none !important; }
    .analytics-card { break-inside: avoid; }
}
