/* =============================================================================
   external_stats.css
   Styles for external stat chips, commends, CS2 pins, Leetify Analysis panel
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Stat chip row  (flex wrapper injected by JS)
   --------------------------------------------------------------------------- */

.ext-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Base chip */
.ext-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: badge-pop-in 0.28s ease both;
}

.potential-friend-card .ext-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Text stack inside chip */
.ext-chip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.ext-chip-text b {
    font-size: 13px;
    font-weight: 700;
}

.ext-chip-text small {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.6;
}

/* ---------------------------------------------------------------------------
   Premier Rating Badge
   --------------------------------------------------------------------------- */

.premier-rating {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px 5px 22px;
    height: 24px;
    transform: skewX(-10deg);
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
    background: linear-gradient(135deg, var(--pr-b) 0%, rgba(0, 0, 0, .4) 100%);
    background-color: var(--pr-b);
    transition: box-shadow .3s ease;
}

.premier-rating:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 0 1px var(--pr-a);
}

.premier-rating::before,
.premier-rating::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--pr-a);
    clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%);
}

.premier-rating::before {
    left: 4px;
}

.premier-rating::after {
    left: 10px;
}

.premier-rating .premier-rating-inner {
    transform: skewX(10deg);
    font-weight: 900;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--pr-a);
    text-shadow: 0 0 6px rgba(0, 0, 0, .5);
    line-height: 1;
}

.premier-rating .premier-rating-inner .pr-dec {
    font-size: 0.55rem;
    opacity: .8;
    color: var(--pr-a);
}

/* Tier colour variables */
.pr-gray {
    --pr-a: #b0c3d9;
    --pr-b: #40464d;
}

.pr-cyan {
    --pr-a: #65d5ff;
    --pr-b: #2d5a73;
}

.pr-blue {
    --pr-a: #4a69e3;
    --pr-b: #1e2858;
}

.pr-purple {
    --pr-a: #8847ff;
    --pr-b: #422b73;
}

.pr-pink {
    --pr-a: #d32ee6;
    --pr-b: #5c2b73;
}

.pr-red {
    --pr-a: #eb4b4b;
    --pr-b: #732b2b;
}

.pr-gold {
    --pr-a: #e4ae39;
    --pr-b: #735c2b;
}

/* Layout helpers for contexts that embed the badge */
.profile-info-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item--premier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* ---------------------------------------------------------------------------
   Faceit image
   --------------------------------------------------------------------------- */

.ext-faceit-img {
    height: 32px;
    width: auto;
    display: block;
}

/* ---------------------------------------------------------------------------
   Steam level chip  (wraps the circle / sprite)
   --------------------------------------------------------------------------- */

.ext-steam {
    border-color: rgba(102, 192, 244, 0.28);
    background: rgba(23, 26, 33, 0.75);
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
}

.ext-steam:hover {
    box-shadow: 0 4px 12px rgba(102, 192, 244, 0.16);
}

.ext-steam small {
    font-size: 9px;
    color: #66c0f4;
    opacity: 0.7;
    font-weight: 400;
}

/* ---------------------------------------------------------------------------
   Leetify rating chip  (friend cards)
   --------------------------------------------------------------------------- */

.ext-leetify-r {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    border-color: rgba(248, 73, 130, 0.32);
    background: rgba(248, 73, 130, 0.06);
    color: #F84982;
}

.ext-leetify-r:hover {
    box-shadow: 0 4px 12px rgba(248, 73, 130, 0.18);
}

.ext-leetify-r b {
    font-size: 13px;
}

.ext-leetify-r small {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.65;
}

/* ---------------------------------------------------------------------------
   Steam level circle / sprite  (shared across all contexts)
   --------------------------------------------------------------------------- */

.steam-lvl-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--lvl-color, #888);
    background: rgba(0, 0, 0, 0.35);
    color: var(--lvl-color, #888);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    font-family: "Motiva Sans", Arial, sans-serif;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.steam-lvl-sprite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-size: auto 32px;
    background-repeat: no-repeat;
    position: relative;
}

.steam-lvl-num {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    line-height: 1;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Commends row
   --------------------------------------------------------------------------- */

.ext-commends-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: center;
}

/* Compact — friend cards (two-line: icon on top, count below) */
.ext-commend {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-text-secondary);
    animation: badge-pop-in 0.28s ease both;
}

.ext-commend img {
    height: 20px;
    width: auto;
}

.ext-commend span {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Full — profile / dashboard */
.ext-commend-full {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 11px;
    border-radius: 8px;
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border);
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: default;
}

.ext-commend-full:hover {
    background: var(--theme-card-hover-bg);
    border-color: var(--theme-accent);
}

.ext-commend-full img {
    height: 20px;
    width: auto;
}

.ext-commend-full b {
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-text-primary);
}

.ext-commend-full small {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.7;
    color: var(--theme-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   Friend card external stats wrapper  (injected below profile-header)
   --------------------------------------------------------------------------- */

.external-friend-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 10px;
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

.external-friend-stats .ext-stats-row {
    justify-content: center;
    gap: 10px;
}

.external-friend-stats .ext-commends-row {
    justify-content: center;
    gap: 16px;
}

/* Tighter chips inside friend cards */
.potential-friend-card .ext-chip {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 7px;
}

.potential-friend-card .ext-chip-text b {
    font-size: 11px;
}

.potential-friend-card .ext-chip-text small {
    font-size: 9px;
}


.potential-friend-card .ext-commend {
    font-size: 11px;
}

.potential-friend-card .ext-commend img {
    height: 13px;
}

/* ---------------------------------------------------------------------------
   Profile / dashboard badge containers
   --------------------------------------------------------------------------- */

.external-badges-container {
    margin-top: 6px;
}

/* Centre-align on profile card */
.profile-header .external-badges-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.profile-header .ext-stats-row {
    justify-content: center;
}

.profile-header .ext-commends-row {
    justify-content: center;
}

/* Dashboard / non-profile badge row */
.profile-main-card .external-badges-container .ext-stats-row {
    justify-content: center;
}

.profile-main-card .external-badges-container .ext-commends-row {
    justify-content: center;
}

/* ---------------------------------------------------------------------------
   CS2 Pins / Badges  (profile only)
   --------------------------------------------------------------------------- */

.cs2-pins-container {
    margin-top: 6px;
}

.cs2-pins-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 1rem;
}

.cs2-pin {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    transition: transform 0.15s ease;
    cursor: default;
    position: relative;
}

.cs2-pin:hover {
    transform: scale(1.55);
    z-index: 10;
}

.cs2-pin img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ---------------------------------------------------------------------------
   Badge entrance animation
   --------------------------------------------------------------------------- */

@keyframes badge-pop-in {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---------------------------------------------------------------------------
   Loading shimmer
   --------------------------------------------------------------------------- */

.loading-shimmer {
    background: linear-gradient(90deg,
            var(--theme-card-bg, #282c34) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            var(--theme-card-bg, #282c34) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
    min-height: 1.35em;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---------------------------------------------------------------------------
   Leetify Analysis card
   --------------------------------------------------------------------------- */

.leetify-analysis-card {
    background: var(--theme-card-bg);
    border: 1px solid rgba(248, 73, 130, 0.22);
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.leetify-analysis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #F84982 40%, #ff85b0 60%, transparent 100%);
}

.leetify-analysis-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    font-size: 1.05em;
}

.leetify-analysis-card h3 img {
    height: 26px;
    width: auto;
}

.leetify-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.leetify-metric-card {
    background: rgba(248, 73, 130, 0.04);
    border: 1px solid rgba(248, 73, 130, 0.15);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.leetify-metric-card:hover {
    background: rgba(248, 73, 130, 0.09);
    border-color: rgba(248, 73, 130, 0.32);
}

.leetify-metric-card h4 {
    font-size: 0.72em;
    color: var(--theme-text-secondary);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.leetify-metric-card .value {
    font-size: 1.35em;
    font-weight: 700;
    color: #F84982;
    line-height: 1.2;
    min-height: 1.35em;
}

.skill-bar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    height: 5px;
    border-radius: 3px;
    margin-top: 9px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c44070, #F84982, #ff85b0);
    width: 0%;
    border-radius: 3px;
    transition: width 1.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.leetify-attribution-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(248, 73, 130, 0.12);
}

.leetify-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F84982;
    color: #fff;
    padding: 7px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.88em;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.leetify-view-btn:hover {
    background: #e0386e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 73, 130, 0.35);
    color: #fff;
}

.attribution-link {
    font-size: 0.74em;
    color: var(--theme-text-secondary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.attribution-link:hover {
    opacity: 1;
}