/* Owlypia Gamify Integration Styles */

/* Season Label */
.season-label {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-top: -20px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Avatar and Name Container */
.avatar-name-container {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.student-avatar {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.student-name {
    margin: 15px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
}

.you-label {
    color: #f97316;
    font-weight: 700;
    margin-left: 8px;
}

/* Rank Display in Stats Box */
.rank-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.rank-badge-large {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.rank-emoji {
    font-size: 110px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Owl emoji colors based on rank */
.rank-emoji[data-rank*="apprentice"] { filter: grayscale(50%) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="wise-watcher"] { filter: hue-rotate(30deg) brightness(1.2) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="knowledge-seeker"] { filter: hue-rotate(270deg) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="mystic-feather"] { filter: hue-rotate(90deg) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="silver-wing"] { filter: hue-rotate(200deg) brightness(1.3) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="master"] { filter: hue-rotate(330deg) brightness(1.2) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="sage"] { filter: hue-rotate(250deg) saturate(1.5) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="moonlit"] { filter: hue-rotate(15deg) saturate(2) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.rank-emoji[data-rank*="wise-owl"] { filter: hue-rotate(45deg) brightness(1.5) drop-shadow(0 0 10px gold); }

.rank-name {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-rank {
    color: #94a3b8;
    font-size: 14px;
    margin: 20px 0;
}

/* Rank Progress Mini */
.rank-progress-mini {
    width: 100%;
    margin-top: 15px;
}

.progress-bar-mini {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text-mini {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
    text-align: center;
}

.max-rank-label {
    color: #f59e0b;
    font-weight: 700;
    font-size: 16px;
    margin-top: 10px;
}

/* Badge Box (gradient applied with other stat cards below) */

.badge-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.achievement-badge {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-name {
    color: #92400e;
    font-size: 16px;
    font-weight: 700;
    margin: 5px 0;
    text-align: center;
}

.badge-description {
    color: #b45309;
    font-size: 13px;
    text-align: center;
    margin: 0;
}

.badge-count {
    color: #6b21a8;
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-top: 10px;
    line-height: 1.2;
}

.no-badge {
    color: #b45309;
    font-size: 14px;
    text-align: center;
    margin: 10px 0;
}

/* Badges List Container */
.badges-list-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

.badges-list-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e8f0;
}

.badges-list-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

.badges-list-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

.badge-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
    max-width: 200px;
    flex: 0 0 auto;
}

.badge-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.badge-icon-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.badge-icon-emoji {
    font-size: 40px;
    flex-shrink: 0;
}

.badge-icon-name {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    line-height: 1.3;
    word-wrap: break-word;
}

/* Rank Badge Mini in Table */
.rank-badge-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.no-rank-mini {
    color: #cbd5e1;
    font-size: 14px;
}

/* Main Container */
.owlypia-top-scores {
    margin: 40px auto;
    max-width: 1000px;
    padding: 40px 30px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Main Title Styles */
.scoreboard-main-title {
    font-size: 40px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #f97316, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.9px;
    text-transform: uppercase;
}

/* Stats Section */
.stats-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
    margin-bottom: 50px;
}

.stats-box {
    flex: 1;
    max-width: 380px;
    min-height: 280px;
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid transparent;
}

/* Higher specificity than other plugins' later `.stats-box { background: #fff }` */
.owlypia-top-scores .stats-box.rank-box {
    background: linear-gradient(165deg, #ecfdf5 0%, #86efac 52%, #4ade80 100%) !important;
    border-color: #22c55e;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.owlypia-top-scores .stats-box.points-box {
    background: linear-gradient(165deg, #fef3c7 0%, #fbbf24 52%, #f59e0b 100%) !important;
    border-color: #d97706;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);
}

.owlypia-top-scores .stats-box.badge-box {
    background: linear-gradient(165deg, #f3e8ff 0%, #c084fc 52%, #a855f7 100%) !important;
    border-color: #9333ea;
    box-shadow: 0 10px 24px rgba(168, 85, 247, 0.22);
}

.stats-title {
    color: #1e293b;
    font-weight: bold;
    white-space: nowrap;
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.owlypia-top-scores .stats-box .stats-value,
.owlypia-top-scores .stats-box .badge-count {
    font-size: 40px !important;
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
    margin: 10px 0 0;
}

/* Student and teacher/supervisor reports: align icons, and numbers with the progress bar */
.owlypia-scoreboard-section .stats-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
    align-items: start;
    align-content: start;
    column-gap: 30px;
    row-gap: 0;
}

.owlypia-scoreboard-section .stats-box {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 4;
    align-items: center;
    align-content: start;
    justify-items: center;
    min-height: 0;
    height: auto;
    padding: 14px 16px 22px;
    position: relative;
}

.owlypia-scoreboard-section .rank-display,
.owlypia-scoreboard-section .rank-progress-mini,
.owlypia-scoreboard-section .points-badge-container,
.owlypia-scoreboard-section .badge-display {
    display: contents;
}

.owlypia-scoreboard-section .stats-box :is(.stats-title, .rank-name, .stats-value, .badge-count, .progress-text-mini, img) {
    margin: 0 !important;
}

.owlypia-scoreboard-section .rank-name {
    margin-top: 4px !important;
}

.owlypia-scoreboard-section .scoreboard-align-spacer {
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.owlypia-scoreboard-section .progress-bar-mini {
    width: 100%;
    margin: 4px 0 0;
}

.owlypia-scoreboard-section .progress-text-mini {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 6px;
    margin: 0 !important;
}

.owlypia-scoreboard-section .stats-box .stats-value,
.owlypia-scoreboard-section .stats-box .badge-count,
.comprehensive-student-report .owlypia-scoreboard-section .stats-box .stats-value,
.comprehensive-student-report .owlypia-scoreboard-section .stats-box .badge-count {
    margin: 0;
}

/* Points Badge Styles */
.points-badge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.points-badge {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.owlypia-top-scores img.rank-badge-large,
.owlypia-top-scores img.points-icon,
.owlypia-top-scores img.badges-icon {
    max-width: none;
    border: 0;
}

.points-icon,
.badges-icon {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18));
}

/* Leaderboard Title */
.owlypia-leaderboard-title {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(45deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.2;
    padding: 0 12px;
    word-break: break-word;
}

.owlypia-lb-tablist {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}

.owlypia-top-scores .owlypia-lb-tab,
.owlypia-top-scores .owlypia-lb-tab:hover,
.owlypia-top-scores .owlypia-lb-tab:focus,
.owlypia-top-scores .owlypia-lb-tab:focus-visible,
.owlypia-top-scores .owlypia-lb-tab:active {
    border: 2px solid #2563eb;
    background: #fff;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    font-weight: 800;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
    font-family: inherit;
    text-decoration: none;
    box-shadow: none;
}

.owlypia-top-scores .owlypia-lb-tab:hover,
.owlypia-top-scores .owlypia-lb-tab:focus,
.owlypia-top-scores .owlypia-lb-tab:focus-visible {
    background: #eff6ff;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
}

.owlypia-top-scores .owlypia-lb-tab.is-active,
.owlypia-top-scores .owlypia-lb-tab.is-active:hover,
.owlypia-top-scores .owlypia-lb-tab.is-active:focus,
.owlypia-top-scores .owlypia-lb-tab.is-active:focus-visible,
.owlypia-top-scores .owlypia-lb-tab.is-active:active {
    background: #2563eb;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.owlypia-top-scores .owlypia-lb-tab.is-active:hover,
.owlypia-top-scores .owlypia-lb-tab.is-active:focus,
.owlypia-top-scores .owlypia-lb-tab.is-active:focus-visible {
    background: #1d4ed8;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.owlypia-lb-panel {
    display: none;
}

.owlypia-lb-panel.is-active {
    display: block;
}

.owlypia-lb-empty {
    text-align: center;
    color: #475569;
    padding: 18px 10px 8px;
}

/* Leaderboard Table Styles */
.leaderboard-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-table thead {
    background: linear-gradient(45deg, #2563eb, #3b82f6);
    color: white;
}

.leaderboard-table th {
    padding: 20px;
    font-weight: 700;
    text-align: left;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-table th.points-column,
.leaderboard-table th.level-column {
    text-align: center;
}

.leaderboard-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
}

.leaderboard-table tbody tr {
    transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

/* Current User Row Highlight */
.current-user-row {
    background-color: #fef3c7 !important;
    border-left: 4px solid #f97316;
}

.current-user-row:hover {
    background-color: #fde68a !important;
}

/* Table Cell Styles */
.rank-cell {
    font-weight: 900;
    color: #64748b;
    width: 80px;
    text-align: center;
}

.name-cell {
    padding: 10px 20px;
    height: 65px;
}

.level-cell {
    text-align: center;
    padding: 10px 15px;
}

.points-cell {
    font-weight: 700;
    color: #2563eb;
    text-align: center;
}

/* User Position Box */
.your-position-box {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 10px;
    border-left: 4px solid #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.2);
}

.your-position-text {
    color: #92400e;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

/* Top 3 Rankings */
.top-three .rank-cell {
    font-size: 20px;
}

.rank-1 .rank-cell {
    color: #fbbf24; /* Gold */
}

.rank-2 .rank-cell {
    color: #94a3b8; /* Silver */
}

.rank-3 .rank-cell {
    color: #b45309; /* Bronze */
}



/* Responsive Design */
@media screen and (max-width: 768px) {

        .student-avatar {
        width: 35px !important;
        height: 35px !important;
    }

        .avatar-name-container {
        gap: 10px;
    }

    .owlypia-top-scores {
        margin: 20px 10px;
        padding: 20px;
    }

    .scoreboard-main-title {
        font-size: 32px;
    }

    .stats-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .owlypia-scoreboard-section .stats-container {
        display: flex;
        grid-template-rows: none;
    }

    .owlypia-scoreboard-section .stats-box {
        display: flex;
        flex-direction: column;
        grid-row: auto;
    }

    .owlypia-scoreboard-section .rank-display,
    .owlypia-scoreboard-section .points-badge-container,
    .owlypia-scoreboard-section .badge-display {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .owlypia-scoreboard-section .rank-progress-mini {
        display: block;
        width: 100%;
    }

    .owlypia-scoreboard-section .scoreboard-align-spacer {
        display: none;
    }

    .stats-box {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        min-height: auto;
    }


    .stats-title {
        font-size: 24px;
    }

    .owlypia-top-scores .stats-box .stats-value,
    .owlypia-top-scores .stats-box .badge-count {
        font-size: 40px !important;
    }

    .rank-badge-large {
        width: 120px;
        height: 120px;
    }

    .points-icon,
    .badges-icon {
        width: 104px;
        height: 104px;
    }

    .owlypia-leaderboard-title {
        font-size: 20px;
        padding: 0 8px;
    }

    .owlypia-lb-tablist {
        flex-direction: column;
        align-items: stretch;
    }

    .owlypia-lb-tab {
        width: 100%;
        text-align: center;
    }

    /* Mobile: leaderboard as cards (no horizontal scroll) */
    .leaderboard-table-wrapper {
        overflow-x: visible;
        box-shadow: none;
    }

    .leaderboard-table thead {
        display: none;
    }

    .leaderboard-table tbody tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 14px 16px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: box-shadow 0.2s ease;
    }

    .leaderboard-table tbody tr:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .leaderboard-table tbody tr.current-user-row {
        border-left-width: 4px;
        border-left-color: #f97316;
    }

    .leaderboard-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 15px;
    }

    .leaderboard-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .leaderboard-table td:first-child {
        padding-top: 0;
    }

    .leaderboard-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
    }

    .leaderboard-table .rank-cell {
        font-size: 18px;
        width: auto;
    }

    .leaderboard-table .name-cell {
        height: auto;
        min-height: auto;
        padding: 10px 0;
    }

    .leaderboard-table .name-cell .avatar-name-container {
        flex: 1;
        min-width: 0;
    }

    .leaderboard-table .name-cell::before {
        align-self: flex-start;
        padding-top: 4px;
    }

    .leaderboard-table .points-cell {
        font-size: 16px;
    }

    .country-flag {
        width: 35px;
        height: 35px;
    }

    .top-three .rank-cell {
        font-size: 18px;
    }
}

/* ============================================
   QUIZ REPORTS STYLES
   ============================================ */

.owlypia-quiz-reports {
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Overview Cards */
.quiz-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.overview-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
}

.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.overview-card .card-icon {
    font-size: 40px;
    line-height: 1;
    flex-shrink: 0;
}

.overview-card .card-content {
    flex: 1;
}

.overview-card .card-value {
    font-size: 32px;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 8px;
}

.overview-card .card-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recent Quiz Activity */
.recent-quiz-activity {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.recent-quiz-activity h3 {
    font-size: 24px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.quiz-table-wrapper {
    overflow-x: auto;
}

.quiz-activity-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
}

.quiz-activity-table thead {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.quiz-activity-table th {
    padding: 16px 20px;
    text-align: left;
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-activity-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.quiz-activity-table tbody tr:hover {
    background: #f8fafc;
}

.quiz-activity-table tbody tr:last-child {
    border-bottom: none;
}

.quiz-activity-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

/* Quiz Table Cells */
.quiz-name {
    max-width: 300px;
}

.quiz-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.quiz-course {
    font-size: 13px;
    color: #64748b;
}

.quiz-score {
    text-align: center;
}

.score-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

.score-badge.score-high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.score-badge.score-medium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.score-badge.score-low {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.quiz-status {
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.status-badge.status-perfect {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fbbf24;
}

.status-badge.status-pass {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.status-badge.status-fail {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.quiz-date {
    text-align: center;
}

.date-display {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.time-ago {
    font-size: 12px;
    color: #64748b;
}

.quiz-points {
    text-align: center;
}

.points-earned {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

/* Performance Trend */
.performance-trend {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.performance-trend h3 {
    font-size: 24px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.trend-chart {
    height: 300px;
    position: relative;
}

/* Two Column Layout - single child (Achievements & Ranking) spans full width */
.quiz-reports-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.quiz-reports-columns .achievements-ranking {
    grid-column: 1;
    width: 100%;
}

/* Subject Performance */
.subject-performance {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.subject-performance h3 {
    font-size: 20px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.subject-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subject-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
}

.subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.subject-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.subject-stats {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.subject-progress {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Achievements & Ranking - Recent Achievements and Your Ranking side by side */
.achievements-ranking {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 30px;
}

.achievements-ranking .achievement-highlights,
.achievements-ranking .ranking-comparison {
    flex: 1;
    min-width: 280px;
}

/* Achievement Highlights */
.achievement-highlights {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.achievement-highlights h3 {
    font-size: 20px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    border-left: 4px solid #f59e0b;
}

.achievement-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-weight: 700;
    color: #92400e;
    font-size: 14px;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 12px;
    color: #b45309;
}

/* Ranking Comparison */
.ranking-comparison {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ranking-comparison h3 {
    font-size: 20px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.ranking-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #8b5cf6;
}

.ranking-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ranking-value {
    font-size: 20px;
    font-weight: 900;
    color: #1e293b;
}

.ranking-value.points-value {
    color: #8b5cf6;
}

.status-excellent {
    color: #059669;
    font-weight: 700;
}

.status-good {
    color: #2563eb;
    font-weight: 700;
}

.status-needs-improvement {
    color: #dc2626;
    font-weight: 700;
}

/* No Data Message */
.no-data {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 40px 20px;
    font-style: italic;
}

/* Responsive Design for Quiz Reports */
@media screen and (max-width: 768px) {
    .owlypia-quiz-reports {
        padding: 0 10px;
    }

    .quiz-overview-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .overview-card {
        padding: 20px;
    }

    .overview-card .card-icon {
        font-size: 32px;
    }

    .overview-card .card-value {
        font-size: 24px;
    }

    .recent-quiz-activity,
    .performance-trend,
    .subject-performance,
    .achievement-highlights,
    .ranking-comparison {
        padding: 20px;
    }

    .recent-quiz-activity h3,
    .performance-trend h3,
    .subject-performance h3,
    .achievement-highlights h3,
    .ranking-comparison h3 {
        font-size: 18px;
    }

    .quiz-activity-table th,
    .quiz-activity-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .quiz-reports-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .achievements-ranking {
        flex-direction: column;
    }

    .achievements-ranking .achievement-highlights,
    .achievements-ranking .ranking-comparison {
        min-width: 100%;
    }

    .trend-chart {
        height: 250px;
    }

    /* Performance by Course – mobile: completion & score bars */
    .owlypia-completion-rows {
        max-width: 100% !important;
        padding: 0 4px;
    }
    .owlypia-completion-row {
        flex-wrap: nowrap !important;
    }
    .owlypia-completion-label {
        min-width: 52px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    .owlypia-score-label {
        min-width: 68px !important;
    }
    .owlypia-completion-bar-wrap {
        flex: 1 1 auto !important;
        min-width: 60px !important;
        max-width: none !important;
    }
    .owlypia-completion-ratio {
        flex-shrink: 0 !important;
    }
    .owlypia-course-card-unified {
        padding: 0 !important;
    }
    .owlypia-course-card-body {
        padding: 14px 12px 16px !important;
    }
    .owlypia-course-cover {
        height: 140px !important;
    }
    .course-progress-grid {
        grid-template-columns: 1fr !important;
        padding: 0 4px;
    }
}

@media screen and (max-width: 480px) {
    .owlypia-completion-rows {
        padding: 0 2px;
    }
}

/* Desktop: moderate bar length so "Lesson" fits and bars stay readable */
.owlypia-completion-bar-wrap {
    max-width: 280px;
}
.owlypia-completion-label {
    min-width: 52px;
}
.owlypia-score-label {
    min-width: 68px;
}

/* ============================================
   SUPERVISOR VIEW STYLES
   ============================================ */

.supervisor-view .supervisor-header,
.parent-view .parent-header {
    text-align: center;
    margin-bottom: 40px;
}

.supervisor-title,
.parent-title {
    font-size: 32px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 10px;
}

.supervisor-subtitle,
.parent-subtitle {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

/* No Students Empty State */
.no-students-message {
    background: #ffffff;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 40px 0;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-students-message h3 {
    font-size: 28px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 15px;
}

.no-students-message p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
}

.empty-state-tips {
    background: #f8fafc;
    border-radius: 12px;
    padding: 25px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    border-left: 4px solid #3b82f6;
}

.empty-state-tips strong {
    display: block;
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 12px;
}

.empty-state-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.empty-state-tips li {
    padding: 8px 0 8px 30px;
    color: #64748b;
    font-size: 14px;
    position: relative;
    line-height: 1.5;
}

.empty-state-tips li:before {
    content: "•";
    position: absolute;
    left: 12px;
    color: #3b82f6;
    font-weight: bold;
    font-size: 18px;
}

/* Supervisor Filters */
.supervisor-filters {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-form {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #475569;
    font-size: 14px;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-group select:hover {
    border-color: #3b82f6;
}

.filter-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-button {
    padding: 10px 30px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Supervisor Table */
.supervisor-table .student-name-cell {
    max-width: 250px;
}

.supervisor-table .student-name-cell strong {
    display: block;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
}

.supervisor-table .student-username {
    font-size: 13px;
    color: #94a3b8;
}

.supervisor-table .text-center {
    text-align: center;
}

.supervisor-table .points-cell {
    font-weight: 700;
    color: #8b5cf6;
}

.status-indicator {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.status-indicator.status-excellent {
    background: #d1fae5;
    color: #065f46;
}

.status-indicator.status-good {
    background: #dbeafe;
    color: #1e40af;
}

.status-indicator.status-needs-improvement {
    background: #fee2e2;
    color: #991b1b;
}

/* Table Header with Info */
.table-header-with-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-header-with-info h3 {
    margin: 0;
}

.table-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

/* Pagination */
.supervisor-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.page-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.page-number.current {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: white;
    cursor: default;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.page-dots {
    color: #94a3b8;
    font-weight: 600;
    padding: 0 8px;
}

/* Subject Performance Breakdown */
.supervisor-subject-breakdown {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.supervisor-subject-breakdown h3 {
    font-size: 24px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.subject-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #3b82f6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.subject-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subject-card-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.subject-average {
    font-size: 24px;
    font-weight: 900;
    color: #3b82f6;
}

.subject-meta {
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
}

/* ============================================
   PARENT VIEW STYLES
   ============================================ */

.child-report-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
}

.child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.child-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.child-name {
    font-size: 24px;
    font-weight: 900;
    color: #1e293b;
    margin: 0;
}

.child-username {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

.child-status .status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
}

.status-badge.status-excellent {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 2px solid #f59e0b;
}

.status-badge.status-good {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.status-badge.status-needs-attention {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
}

/* Mini Cards for Parent View */
.quiz-overview-cards.mini {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.overview-card.mini {
    padding: 15px;
}

.overview-card.mini .card-icon {
    font-size: 28px;
}

.overview-card.mini .card-value {
    font-size: 24px;
}

.overview-card.mini .card-label {
    font-size: 12px;
}

/* Child Recent Activity */
.child-recent-activity,
.child-subjects {
    margin-top: 25px;
}

.child-recent-activity h4,
.child-subjects h4 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
}

.recent-quiz-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-quiz-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.quiz-info {
    flex: 1;
}

.quiz-name-mini {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 4px;
}

.quiz-date-mini {
    font-size: 12px;
    color: #94a3b8;
}

.quiz-score-mini .score-badge {
    font-size: 13px;
    padding: 5px 12px;
}

/* Subject Mini Cards */
.subject-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.subject-mini-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid #8b5cf6;
}

.subject-name-mini {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 8px;
}

.subject-score-mini {
    font-size: 20px;
    font-weight: 900;
    color: #8b5cf6;
    margin-bottom: 8px;
}

.progress-bar-mini {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Responsive for Supervisor & Parent Views */
@media screen and (max-width: 768px) {
    .supervisor-title,
    .parent-title {
        font-size: 24px;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-button {
        width: 100%;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

    .quiz-overview-cards.mini {
        grid-template-columns: repeat(2, 1fr);
    }

    .child-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .subject-mini-grid {
        grid-template-columns: 1fr;
    }

    .supervisor-table th,
    .supervisor-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .table-header-with-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .supervisor-pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
    }

    .page-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ============================================
   STUDENT JOURNEY HUB [owlypia_quiz_reports_new]
   ============================================ */

.owlypia-journey-hub {
    margin: 40px auto;
    max-width: 1100px;
    padding: 0 20px;
}

.owlypia-journey-hub-intro {
    max-width: 720px;
    margin: 0 auto 36px;
    text-align: center;
    color: #334155;
}

.owlypia-journey-hub-intro h2 {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: #1e293b;
}

.owlypia-journey-hub-intro p {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.6;
}

.owlypia-journey-hub-lead {
    font-weight: 700;
    color: #1e293b;
}

.owlypia-journey-hub-intro ul {
    display: inline-block;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.owlypia-journey-hub-intro li {
    position: relative;
    margin: 0 0 8px;
    padding-left: 22px;
    font-size: 16px;
    line-height: 1.5;
}

.owlypia-journey-hub-intro li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
}

.owlypia-journey-hub-tagline {
    margin-top: 8px !important;
    font-size: 20px !important;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: #2563eb !important;
}

.owlypia-journey-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.owlypia-journey-hub .owlypia-top-scores {
    margin-top: 36px;
    margin-bottom: 0;
}

.owlypia-journey-hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 180px;
    padding: 28px 20px;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.owlypia-journey-hub-card:hover,
a.owlypia-journey-hub-card:focus {
    transform: translateY(-4px);
    border-color: #bfdbfe;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
    color: #1e293b;
    outline: none;
}

.owlypia-journey-hub-icon {
    font-size: 42px;
    line-height: 1;
}

.owlypia-journey-hub-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

@media screen and (max-width: 900px) {
    .owlypia-journey-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 640px) {
    .owlypia-journey-hub {
        padding: 0 10px;
    }

    .owlypia-journey-hub-intro h2 {
        font-size: 28px;
    }

    .owlypia-journey-hub-grid {
        grid-template-columns: 1fr;
    }
}
