/* ==========================================
   CAST MEMBER PROFILE BADGES
   SAME SIZE AS ACTIVE MEMBER / APPROVED
========================================== */

.cast-profile-modern .cast-member-achievements {
    margin: 8px 0 0 !important;
    padding: 0 30px 18px !important;
    border: 0 !important;
    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-achievements-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    margin: 0 0 7px !important;
}

.cast-profile-modern .cast-member-achievements-heading > div {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.cast-profile-modern .cast-member-achievements-label {
    display: none !important;
}

.cast-profile-modern .cast-member-achievements-heading h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--cast-muted, #6b7280) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.cast-profile-modern .cast-member-achievements-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: var(--cast-primary-light, #eef5ff) !important;
    color: var(--cast-primary, #0b4db8) !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    box-sizing: border-box !important;
}


/* Badge row */
.cast-profile-modern .cast-member-badges-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* Badge pill - mirrors .cast-profile-badge */
.cast-profile-modern button.cast-member-badge-card {
    appearance: none !important;
    -webkit-appearance: none !important;

    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;

    gap: 5px !important;

    margin: 0 !important;
    padding: 6px 11px !important;

    border: 1px solid
        color-mix(
            in srgb,
            var(--cast-member-badge-color) 28%,
            transparent
        ) !important;

    border-radius: 999px !important;

    background:
        color-mix(
            in srgb,
            var(--cast-member-badge-color) 9%,
            #ffffff
        ) !important;

    color: var(--cast-member-badge-color) !important;

    box-shadow: none !important;

    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    text-align: center !important;
    text-transform: none !important;

    cursor: pointer !important;
    box-sizing: border-box !important;

    transition:
        transform .16s ease,
        border-color .16s ease,
        background .16s ease !important;
}

.cast-profile-modern button.cast-member-badge-card:hover {
    transform: translateY(-1px) !important;

    border-color:
        var(--cast-member-badge-color) !important;

    background:
        color-mix(
            in srgb,
            var(--cast-member-badge-color) 14%,
            #ffffff
        ) !important;
}


/* Tiny icon inside the pill */
.cast-profile-modern .cast-member-badge-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    flex: 0 0 16px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: transparent !important;

    font-size: 11px !important;
    line-height: 1 !important;

    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-badge-icon img,
.cast-profile-modern .cast-member-badge-image {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;
    max-height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
}


/* Badge name */
.cast-profile-modern .cast-member-badge-name {
    display: inline !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: 150px !important;

    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;

    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* Hide helper text */
.cast-profile-modern .cast-member-badge-hint {
    display: none !important;
}


/* ==========================================
   BADGE DETAILS MODAL
========================================== */

.cast-profile-modern .cast-member-badge-modal {
    position: fixed !important;
    z-index: 999999 !important;
    inset: 0 !important;

    display: none !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100vw !important;
    height: 100vh !important;

    margin: 0 !important;
    padding: 18px !important;

    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-badge-modal[aria-hidden="true"] {
    display: none !important;
}

.cast-profile-modern .cast-member-badge-modal.is-open {
    display: flex !important;
}

.cast-profile-modern .cast-member-badge-modal-backdrop {
    position: absolute !important;
    inset: 0 !important;

    background:
        rgba(15, 23, 42, .62) !important;

    backdrop-filter:
        blur(3px) !important;
}

.cast-profile-modern .cast-member-badge-modal-dialog {
    position: relative !important;
    z-index: 1 !important;

    display: block !important;

    width: min(100%, 390px) !important;
    max-height: calc(100vh - 36px) !important;

    margin: 0 !important;
    padding: 24px 20px 20px !important;

    overflow-y: auto !important;

    border-radius: 18px !important;

    background: #fff !important;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, .24) !important;

    text-align: center !important;
    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-badge-modal-close {
    position: absolute !important;
    top: 9px !important;
    right: 10px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 30px !important;
    height: 30px !important;

    padding: 0 !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: #f3f4f6 !important;
    color: #111827 !important;

    font-size: 19px !important;
    line-height: 1 !important;

    cursor: pointer !important;
}

.cast-profile-modern .cast-member-badge-modal-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 68px !important;
    height: 68px !important;

    margin: 0 auto 11px !important;
    padding: 0 !important;

    overflow: hidden !important;

    border:
        2px solid var(--cast-member-badge-color) !important;

    border-radius: 17px !important;

    background: #fff !important;

    font-size: 28px !important;

    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-badge-modal-label {
    display: block !important;

    color: var(--cast-primary, #0b4db8) !important;

    font-size: 8px !important;
    font-weight: 900 !important;
    letter-spacing: .6px !important;
}

.cast-profile-modern .cast-member-badge-modal-dialog h3 {
    margin: 4px 0 7px !important;

    color: var(--cast-text, #111827) !important;

    font-size: 19px !important;
    line-height: 1.2 !important;
}

.cast-profile-modern .cast-member-badge-description {
    margin: 0 auto 14px !important;

    color: var(--cast-muted, #6b7280) !important;

    font-size: 11px !important;
    line-height: 1.55 !important;
}

.cast-profile-modern .cast-member-badge-earned,
.cast-profile-modern .cast-member-badge-awarded {
    padding: 11px !important;

    border-radius: 11px !important;

    background: var(--cast-bg, #f8fafc) !important;

    text-align: left !important;

    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-badge-earned {
    margin-top: 12px !important;
}

.cast-profile-modern .cast-member-badge-awarded {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 10px !important;

    margin-top: 7px !important;
}

.cast-profile-modern .cast-member-badge-earned > span,
.cast-profile-modern .cast-member-badge-awarded > span {
    color: var(--cast-muted, #6b7280) !important;

    font-size: 8px !important;
    font-weight: 800 !important;

    text-transform: uppercase !important;
    letter-spacing: .4px !important;
}

.cast-profile-modern .cast-member-badge-earned p {
    margin: 4px 0 0 !important;
    padding: 0 !important;

    color: var(--cast-text, #111827) !important;

    font-size: 11px !important;
    font-weight: 600 !important;

    line-height: 1.5 !important;

    white-space: pre-line !important;
}

.cast-profile-modern .cast-member-badge-awarded strong {
    font-size: 10px !important;
}

body.cast-badge-modal-open {
    overflow: hidden !important;
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    .cast-profile-modern .cast-member-achievements {
        padding:
            0 16px 14px !important;
    }

    .cast-profile-modern button.cast-member-badge-card {
        padding:
            5px 9px !important;

        font-size:
            11px !important;
    }

    .cast-profile-modern .cast-member-badge-name {
        max-width:
            110px !important;

        font-size:
            11px !important;
    }

    .cast-profile-modern .cast-member-badge-icon {
        width: 14px !important;
        height: 14px !important;
        min-width: 14px !important;
        flex-basis: 14px !important;
    }

    .cast-profile-modern .cast-member-badge-modal-dialog {
        width: min(100%, 350px) !important;

        padding:
            22px 16px 17px !important;
    }
}



/* ==========================================
   SIMPLE MEMBER ACHIEVEMENTS HEADER
   KEEP BADGE STYLE UNCHANGED
========================================== */

.cast-profile-modern .cast-member-achievements {
    margin: 8px 0 0 !important;
    padding: 0 30px 16px !important;
    border: 0 !important;
    background: transparent !important;
}

.cast-profile-modern .cast-member-achievements-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin: 0 0 7px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cast-profile-modern .cast-member-achievements-heading > div {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cast-profile-modern .cast-member-achievements-label {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--cast-muted, #64748b) !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .45px !important;
    text-transform: uppercase !important;
}

.cast-profile-modern .cast-member-achievements-label::before {
    display: none !important;
    content: none !important;
}

.cast-profile-modern .cast-member-achievements-heading h3 {
    display: none !important;
}

.cast-profile-modern .cast-member-achievements-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: auto !important;
    min-width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 5px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--cast-primary-light, #eef5ff) !important;
    color: var(--cast-primary, #0b4db8) !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.cast-profile-modern .cast-member-achievements-count::before {
    content: "🏅" !important;
    display: inline-block !important;
    margin: 0 !important;
    font-size: 8px !important;
    line-height: 1 !important;
}


/* Remove helper text only */
.cast-profile-modern .cast-member-badge-hint,
.cast-profile-modern .cast-member-badge-card small,
.cast-profile-modern button.cast-member-badge-card small {
    display: none !important;
}


/* Mobile header only */
@media (max-width: 600px) {

    .cast-profile-modern .cast-member-achievements {
        margin-top: 5px !important;
        padding: 0 16px 13px !important;
    }

    .cast-profile-modern .cast-member-achievements-heading {
        gap: 5px !important;
        margin-bottom: 6px !important;
    }

    .cast-profile-modern .cast-member-achievements-label {
        font-size: 7px !important;
    }

    .cast-profile-modern .cast-member-achievements-count {
        min-width: 17px !important;
        height: 17px !important;
        padding: 0 4px !important;
        font-size: 7px !important;
    }

    .cast-profile-modern .cast-member-achievements-count::before {
        font-size: 7px !important;
    }
}



/* ==========================================
   FINAL MEMBER ACHIEVEMENTS HEADER SIZE
   Badge styling remains unchanged.
========================================== */

.cast-profile-modern .cast-member-achievements-label {
    font-size: 6px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .3px !important;
}

@media (max-width: 600px) {

    .cast-profile-modern .cast-member-achievements-label {
        font-size: 5.5px !important;
        letter-spacing: .25px !important;
    }
}