
/* =========================================
   MY LIBRARY JOURNEY — COLOURFUL BADGES
   ========================================= */

/* ===== Attractive Badge Cards ===== */
.student-badge-card {
    --badge-primary: #2457a7;
    --badge-tint: #eaf1ff;
    --badge-border: #c9d9ff;

    position: relative;
    height: 100%;
    padding: 0 20px 22px;
    overflow: hidden;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--badge-border);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(30, 41, 59, 0.09);
    transition: transform .25s ease, box-shadow .25s ease;
}

.student-badge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 13px 28px rgba(30, 41, 59, 0.15);
}

.student-badge-card::before {
    content: "";
    display: block;
    height: 7px;
    margin: 0 -20px 18px;
    background: linear-gradient(
        90deg,
        var(--badge-primary),
        var(--badge-border)
    );
}

/* 1. Reading Badge — Royal Blue */
.student-badge-card.badge-reading {
    --badge-primary: #2457a7;
    --badge-tint: #eaf1ff;
    --badge-border: #c5d7ff;
}

/* 2. Book Review Badge — Purple */
.student-badge-card.badge-review {
    --badge-primary: #7138a8;
    --badge-tint: #f2eaff;
    --badge-border: #ddc8ff;
}

/* 3. Library Points Badge — Orange */
.student-badge-card.badge-points {
    --badge-primary: #b45309;
    --badge-tint: #fff0d9;
    --badge-border: #f4d09b;
}

/* Badge category heading */
.student-badge-heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 13px;
    margin-bottom: 8px;
    border-radius: 30px;
    color: #fff;
    background: #006b25;
    border: 1px solid var(--badge-border);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
}

/* Circular badge holder */
.student-badge-icon {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px auto 18px;
    border: 3px solid #ffffff;
    border-radius: 12px; /* Slightly rounded square */
    background: #fff;
    box-shadow: 0 0 0 4px var(--badge-border),
                0 7px 17px rgba(30, 41, 59, .12);
    color: var(--badge-primary);
    font-size: 3.1rem;
    box-sizing: border-box;
}

.student-badge-image {
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
    transition: transform .25s ease;
}

.student-badge-card:hover .student-badge-image {
    transform: scale(1.08) rotate(-3deg);
}

/* Main badge title — always dark */
.student-badge-card h3 {
    color: #ab0213;
    font-size: 1.15rem;
    font-weight: 850;
    margin: 0 0 10px;
    line-height: 1.4;
}

/* Description — readable dark grey */
.student-badge-card .badge-description {
    min-height: 58px;
    color: #000;
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Achievement statistics */
.badge-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--badge-border);
    border-radius: 12px;
    background: var(--badge-tint);
    color: #222222;
    font-size: .87rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* Additional details */
.badge-detail {
    display: block;
    margin-top: 11px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #f4f6f9;
    border: 1px solid #e0e5ec;
    color: #292929;
    font-size: .84rem;
    line-height: 1.55;
}

/* Intro panel */
.my-badges-intro {
    background: linear-gradient(120deg, #e8f0ff, #f4eaff, #fff2dc);
    border: 1px solid #d8deeb;
    border-radius: 18px;
    color: #222222;
}

.my-badges-intro h2,
.my-badges-intro h3,
.my-badges-intro p,
.my-badges-intro .text-muted {
    color: #222222 !important;
}

/* Student avatar */
.my-badges-avatar {
    background: linear-gradient(135deg, #2457a7, #7138a8);
    color: #ffffff;
}

/* Encouragement banner */
.my-badges-encouragement {
    padding: 17px 20px;
    border-radius: 14px;
    border: 1px solid #b9d5ff;
    background: linear-gradient(110deg, #e7f1ff, #f2eaff);
    color: #222222;
}

.my-badges-encouragement h4,
.my-badges-encouragement p,
.my-badges-encouragement span {
    color: #222222 !important;
}

/* Ensure nested text does not inherit pale colours */
.student-badge-card p,
.student-badge-card small,
.student-badge-card .text-muted {
    color: #343a40 !important;
}


/* Responsive cards */
@media (max-width: 575.98px) {
    .student-badge-card {
        padding: 0 17px 19px;
        border-radius: 17px;
    }

    .student-badge-card::before {
        margin-left: -17px;
        margin-right: -17px;
    }

    .student-badge-icon {
        width: 96px;
        height: 96px;
        font-size: 2.7rem;
    }

    .student-badge-card .badge-description {
        min-height: 0;
    }

    .my-badges-intro {
        padding: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-badge-card,
    .student-badge-image {
        transition: none;
    }

    .student-badge-card:hover,
    .student-badge-card:hover .student-badge-image {
        transform: none;
    }
}

.next-badge-panel {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef4ff, #f5edff);
    border: 1px solid #d7def4;
    text-align: center;
}

.next-badge-title {
    color: #252525;
    font-size: .9rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.next-badge-title i {
    color: #6741c8;
    margin-right: 5px;
}

.next-badge-progress {
    color: #343434;
    font-size: .84rem;
    line-height: 1.5;
}

.next-badge-points {
    color: #b45309;
    font-weight: 850;
    font-size: 1rem;
}