/* STUDENT_ACHIEVEMENTS_PHASE3C_STUDENT_PAGE */

#studentAchievementsPage {
    --sa-green: #1d563f;
    --sa-green-dark: #123f2e;
    --sa-navy: #183f5b;
    --sa-gold: #c39136;
    --sa-ivory: #f7f1e6;
    --sa-border: #e6dccb;
    --sa-text: #19342a;
    --sa-muted: #6f7f77;
    direction: rtl;
}

.sa-page {
    display: grid;
    gap: 18px;
    padding: 18px;
    background: #f7f3eb;
    min-height: 100vh;
    color: var(--sa-text);
}

.sa-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 28px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(244,235,218,.96)),
        #fff;
    box-shadow: 0 18px 46px rgba(43,60,49,.09);
}

.sa-hero::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 42%;
    height: 5px;
    background: linear-gradient(90deg, var(--sa-gold), var(--sa-green));
    border-radius: 999px 0 0 0;
}

.sa-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
}

.sa-hero-glow-one {
    width: 220px;
    height: 220px;
    inset-inline-end: -80px;
    top: -90px;
    background: rgba(29,86,63,.12);
}

.sa-hero-glow-two {
    width: 150px;
    height: 150px;
    inset-inline-start: 24%;
    bottom: -90px;
    background: rgba(195,145,54,.13);
}

.sa-hero-profile,
.sa-level-card {
    position: relative;
    z-index: 1;
}

.sa-hero-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.sa-avatar {
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    border-radius: 26px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 3px solid rgba(195,145,54,.4);
    background: linear-gradient(145deg, var(--sa-green), var(--sa-navy));
    color: #fff;
    font-size: 34px;
    font-weight: 900;
    box-shadow: 0 14px 26px rgba(24,63,91,.16);
}

.sa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sa-hero-copy {
    min-width: 0;
}

.sa-hero-copy small,
.sa-next-copy small,
.sa-section-head small,
.sa-featured-card > small {
    display: block;
    color: var(--sa-gold);
    font-weight: 900;
    letter-spacing: .2px;
}

.sa-hero-copy h1 {
    margin: 5px 0 7px;
    color: var(--sa-green-dark);
    font-size: clamp(25px, 3vw, 42px);
    line-height: 1.25;
}

.sa-hero-copy p {
    margin: 0;
    color: var(--sa-muted);
    font-weight: 700;
}

.sa-level-card {
    min-width: 280px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(195,145,54,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    backdrop-filter: blur(10px);
}

.sa-level-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 23px;
    background: linear-gradient(145deg, var(--sa-gold), #a87422);
}

.sa-level-card div {
    min-width: 0;
}

.sa-level-card small {
    display: block;
    color: var(--sa-muted);
    font-size: 12px;
    font-weight: 800;
}

.sa-level-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sa-green-dark);
}

.sa-level-card > b {
    grid-column: 1 / -1;
    justify-self: stretch;
    padding-top: 10px;
    border-top: 1px solid #eadfce;
    color: var(--sa-gold);
    text-align: center;
}

.sa-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.sa-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--sa-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 9px 24px rgba(51,67,57,.055);
}

.sa-summary-card > span {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--sa-ivory);
    font-size: 22px;
}

.sa-summary-card div {
    min-width: 0;
}

.sa-summary-card strong {
    display: block;
    color: var(--sa-green-dark);
    font-size: 24px;
    line-height: 1;
}

.sa-summary-card small {
    display: block;
    margin-top: 5px;
    color: var(--sa-muted);
    font-weight: 700;
}

.sa-next-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 22px;
    border-radius: 25px;
    border: 1px solid rgba(29,86,63,.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(29,86,63,.1), transparent 35%),
        linear-gradient(145deg, #fff, #f5f9f6);
}

.sa-next-card-empty {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.sa-next-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 21px;
    background: linear-gradient(145deg, var(--sa-green), var(--sa-navy));
    font-size: 29px;
    box-shadow: 0 12px 26px rgba(29,86,63,.16);
}

.sa-next-copy h2 {
    margin: 4px 0 6px;
    color: var(--sa-green-dark);
    font-size: clamp(20px, 2vw, 29px);
}

.sa-next-copy p {
    margin: 0;
    color: var(--sa-muted);
    line-height: 1.8;
}

.sa-primary-action,
.sa-next-progress a,
.sa-feed-empty a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 18px;
    border-radius: 14px;
    color: #fff;
    background: var(--sa-green);
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.sa-next-progress {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sa-progress-ring {
    --progress: 0;
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, #fff 58%, transparent 60%),
        conic-gradient(var(--sa-gold) calc(var(--progress) * 1%), #e8e2d8 0);
}

.sa-progress-ring strong {
    color: var(--sa-green-dark);
}

.sa-next-progress span {
    display: block;
    margin-bottom: 8px;
    color: var(--sa-muted);
    font-weight: 800;
}

.sa-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px;
}

.sa-tabs::-webkit-scrollbar {
    display: none;
}

.sa-tabs button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 15px;
    border: 1px solid var(--sa-border);
    border-radius: 14px;
    background: #fff;
    color: var(--sa-muted);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.sa-tabs button b {
    min-width: 25px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f1ede6;
    color: var(--sa-green-dark);
}

.sa-tabs button.active {
    color: #fff;
    border-color: var(--sa-green);
    background: var(--sa-green);
}

.sa-tabs button.active b {
    background: rgba(255,255,255,.17);
    color: #fff;
}

.sa-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .65fr);
    gap: 16px;
    align-items: start;
}

.sa-feed-card,
.sa-side-card,
.sa-gallery-card,
.sa-timeline-card {
    border: 1px solid var(--sa-border);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(46,63,52,.055);
}

.sa-feed-card,
.sa-gallery-card,
.sa-timeline-card {
    padding: 20px;
}

.sa-side-column {
    display: grid;
    gap: 16px;
}

.sa-side-card {
    padding: 19px;
}

.sa-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.sa-section-head.compact {
    margin-bottom: 12px;
}

.sa-section-head h2 {
    margin: 3px 0 0;
    color: var(--sa-green-dark);
    font-size: 22px;
}

.sa-section-head > span {
    flex: 0 0 auto;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--sa-ivory);
    color: var(--sa-green-dark);
    font-size: 12px;
    font-weight: 900;
}

.sa-achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sa-achievement-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    padding: 16px;
    border: 1px solid #e4e8e4;
    border-radius: 19px;
    background: #fbfdfc;
}

.sa-achievement-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 4px;
    height: 100%;
    background: var(--tone, var(--sa-green));
}

.sa-achievement-card.tone-green { --tone: #2f7a59; }
.sa-achievement-card.tone-gold { --tone: #c39136; }
.sa-achievement-card.tone-navy { --tone: #183f5b; }
.sa-achievement-card.tone-blue { --tone: #3977a6; }
.sa-achievement-card.tone-rose { --tone: #a95a70; }

.sa-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--sa-ivory);
    font-size: 23px;
}

.sa-card-copy {
    min-width: 0;
}

.sa-card-kicker,
.sa-achievement-card footer,
.sa-featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sa-card-kicker span {
    color: var(--sa-muted);
    font-size: 12px;
    font-weight: 800;
}

.sa-card-kicker b {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(195,145,54,.13);
    color: #966b22;
    font-size: 10px;
}

.sa-achievement-card h3 {
    margin: 6px 0;
    color: var(--sa-green-dark);
    font-size: 17px;
    line-height: 1.45;
}

.sa-achievement-card p {
    margin: 0;
    color: var(--sa-muted);
    font-size: 13px;
    line-height: 1.75;
}

.sa-achievement-card footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #ece8e1;
}

.sa-achievement-card footer time {
    color: #89928d;
    font-size: 11px;
}

.sa-achievement-card footer strong,
.sa-achievement-card footer a {
    color: var(--tone, var(--sa-green));
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.sa-featured-card {
    color: #fff;
    border-color: transparent;
    background:
        radial-gradient(circle at 0 0, rgba(255,255,255,.14), transparent 40%),
        linear-gradient(145deg, var(--sa-green), var(--sa-navy));
}

.sa-featured-card.empty {
    background:
        radial-gradient(circle at 0 0, rgba(195,145,54,.2), transparent 42%),
        linear-gradient(145deg, #234f3d, #24445a);
}

.sa-side-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.13);
    color: #f2ca78;
    font-size: 25px;
}

.sa-featured-card > small {
    color: #e8c678;
}

.sa-featured-card h3 {
    margin: 5px 0 8px;
    color: #fff;
    font-size: 22px;
}

.sa-featured-card p {
    margin: 0;
    color: rgba(255,255,255,.78);
    line-height: 1.8;
}

.sa-featured-footer {
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.75);
    font-size: 12px;
}

.sa-featured-footer b {
    color: #f2ca78;
}

.sa-message-list {
    display: grid;
    gap: 10px;
}

.sa-message-list article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f8f6f1;
}

.sa-message-list article > span {
    color: var(--sa-gold);
    font-size: 22px;
    font-weight: 900;
}

.sa-message-list strong {
    color: var(--sa-green-dark);
}

.sa-message-list p {
    margin: 5px 0;
    color: var(--sa-muted);
    font-size: 13px;
    line-height: 1.7;
}

.sa-message-list small {
    color: #929b96;
    font-size: 10px;
}

.sa-mini-empty,
.sa-gallery-empty,
.sa-timeline-empty,
.sa-feed-empty,
.sa-loading-card,
.sa-error-card {
    display: grid;
    place-items: center;
    text-align: center;
}

.sa-mini-empty {
    min-height: 150px;
    padding: 20px;
    border-radius: 17px;
    background: #f8f6f1;
}

.sa-mini-empty span,
.sa-gallery-empty span,
.sa-timeline-empty span,
.sa-feed-empty span {
    font-size: 34px;
}

.sa-mini-empty p {
    margin: 8px 0 0;
    color: var(--sa-muted);
    line-height: 1.7;
}

.sa-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.sa-gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #e7e4dc;
    cursor: pointer;
}

.sa-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.sa-gallery-item:hover img {
    transform: scale(1.04);
}

.sa-gallery-item > span {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: grid;
    gap: 2px;
    padding: 28px 12px 11px;
    color: #fff;
    text-align: right;
    background: linear-gradient(transparent, rgba(0,0,0,.74));
}

.sa-gallery-item strong {
    font-family: inherit;
    font-size: 13px;
}

.sa-gallery-item small {
    opacity: .76;
    font-family: inherit;
    font-size: 10px;
}

.sa-gallery-empty,
.sa-timeline-empty,
.sa-feed-empty {
    min-height: 230px;
    padding: 28px;
    border: 1px dashed #ddd1bf;
    border-radius: 19px;
    background: #faf8f3;
}

.sa-gallery-empty h3,
.sa-timeline-empty h3,
.sa-feed-empty h3 {
    margin: 9px 0 4px;
    color: var(--sa-green-dark);
}

.sa-gallery-empty p,
.sa-timeline-empty p,
.sa-feed-empty p {
    margin: 0;
    color: var(--sa-muted);
    line-height: 1.8;
}

.sa-feed-empty a {
    margin-top: 14px;
}

.sa-timeline {
    position: relative;
    display: grid;
    gap: 0;
}

.sa-timeline::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    inset-inline-start: 20px;
    width: 2px;
    background: linear-gradient(var(--sa-gold), #dce6df);
}

.sa-timeline article {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 10px 0;
}

.sa-timeline-dot {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--sa-ivory);
    box-shadow: 0 0 0 1px #e5dac8;
}

.sa-timeline article > div {
    padding: 10px 14px;
    border-radius: 16px;
    background: #f8faf8;
}

.sa-timeline small {
    color: var(--sa-gold);
    font-size: 10px;
    font-weight: 900;
}

.sa-timeline h3 {
    margin: 4px 0;
    color: var(--sa-green-dark);
    font-size: 15px;
}

.sa-timeline p {
    margin: 0;
    color: var(--sa-muted);
    font-size: 12px;
    line-height: 1.7;
}

.sa-loading-card,
.sa-error-card {
    min-height: 430px;
    padding: 30px;
    border: 1px solid var(--sa-border);
    border-radius: 27px;
    background: #fff;
}

.sa-loading-orb {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 28px;
    background: var(--sa-ivory);
    font-size: 40px;
    animation: saPulse 1.4s infinite;
}

.sa-loading-card strong {
    color: var(--sa-green-dark);
    font-size: 21px;
}

.sa-loading-card small {
    margin-top: 6px;
    color: var(--sa-muted);
}

.sa-error-card > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f8e7e7;
    color: #9b3434;
    font-size: 25px;
    font-weight: 900;
}

.sa-error-card h2 {
    margin: 12px 0 4px;
    color: var(--sa-green-dark);
}

.sa-error-card p {
    color: var(--sa-muted);
}

.sa-error-card button {
    min-height: 42px;
    padding: 0 17px;
    border: 0;
    border-radius: 13px;
    background: var(--sa-green);
    color: #fff;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
}

.sa-image-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(10,23,17,.78);
    backdrop-filter: blur(7px);
}

.sa-image-dialog {
    position: relative;
    overflow: hidden;
    width: min(900px, 96vw);
    max-height: 92vh;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0,0,0,.35);
}

.sa-image-dialog img {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #111;
}

.sa-image-dialog > div {
    padding: 17px 20px;
}

.sa-image-dialog h3 {
    margin: 0;
    color: var(--sa-green-dark);
}

.sa-image-dialog p {
    margin: 6px 0 0;
    color: var(--sa-muted);
}

.sa-modal-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.66);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

@keyframes saPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 1050px) {
    .sa-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sa-content-grid {
        grid-template-columns: 1fr;
    }

    .sa-side-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sa-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sa-page {
        gap: 12px;
        padding: 10px;
    }

    .sa-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px;
        border-radius: 22px;
    }

    .sa-hero-profile {
        gap: 12px;
    }

    .sa-avatar {
        width: 66px;
        height: 66px;
        border-radius: 21px;
        font-size: 28px;
    }

    .sa-hero-copy h1 {
        font-size: 23px;
    }

    .sa-level-card {
        min-width: 0;
        width: 100%;
    }

    .sa-summary-grid {
        gap: 8px;
    }

    .sa-summary-card {
        gap: 8px;
        padding: 12px 10px;
        border-radius: 16px;
    }

    .sa-summary-card > span {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        font-size: 18px;
    }

    .sa-summary-card strong {
        font-size: 20px;
    }

    .sa-summary-card small {
        font-size: 11px;
    }

    .sa-next-card,
    .sa-next-card-empty {
        grid-template-columns: 1fr;
        gap: 13px;
        padding: 17px;
        border-radius: 20px;
    }

    .sa-next-icon {
        width: 50px;
        height: 50px;
        border-radius: 17px;
        font-size: 23px;
    }

    .sa-primary-action {
        width: 100%;
    }

    .sa-next-progress {
        justify-content: space-between;
    }

    .sa-content-grid {
        gap: 12px;
    }

    .sa-side-column {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sa-feed-card,
    .sa-gallery-card,
    .sa-timeline-card,
    .sa-side-card {
        padding: 14px;
        border-radius: 20px;
    }

    .sa-section-head h2 {
        font-size: 19px;
    }

    .sa-achievement-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .sa-achievement-card {
        padding: 13px;
        border-radius: 16px;
    }

    .sa-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .sa-gallery-item {
        border-radius: 15px;
    }

    .sa-timeline article {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
    }

    .sa-timeline::before {
        inset-inline-start: 18px;
    }

    .sa-timeline-dot {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 430px) {
    .sa-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sa-summary-card {
        align-items: flex-start;
    }

    .sa-summary-card small {
        line-height: 1.45;
    }

    .sa-tabs button {
        min-height: 42px;
        padding: 0 12px;
        font-size: 12px;
    }

    .sa-gallery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sa-gallery-item {
        aspect-ratio: 1 / 1;
    }
}
