/*
 * badge_card.css
 * Complete rewrite — clean slate.
 * All badge card styles. No theme variable dependencies.
 * Background is always dark (#1e1e1e), text always light.
 * Only the rarity header strip gets color.
 */


/* ============================================
   GRID CONTAINERS
   ============================================ */

/* Recently Earned — fixed 3-column, never flexible */
.pf-badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 160px);
    gap: 16px;
    margin-top: 16px;
    padding-top: 8px;
    justify-content: start;
    overflow: visible;
}

/* Badge hub page — fixed 160px columns */
.category-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 20px;
    margin-top: 20px;
    justify-content: start;
}

/* Featured badge slots — always 2 side by side */
.pf-feat-badges {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: nowrap;
    padding-top: 8px;
    overflow: visible;
}


/* ============================================
   SPECIAL WRAPPERS
   Legendary and Obsidian need a positioned
   wrapper so the border animation sits outside
   the card overflow:hidden boundary.
   ============================================ */

.bc-legendary-wrap,
.bc-obsidian-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: top;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.bc-legendary-wrap:hover {
    transform: translateY(-6px) scale(1.03);
    filter: drop-shadow(0 10px 15px rgba(243,156,18,0.45));
}

.bc-obsidian-wrap:hover {
    transform: translateY(-6px) scale(1.03);
    filter: drop-shadow(0 10px 15px rgba(255,215,0,0.45));
}

.bc-legendary-wrap .bc-leg-border,
.bc-obsidian-wrap .bc-obs-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bc-legendary-wrap.bc-size-small,
.bc-obsidian-wrap.bc-size-small  { width: 130px; }

.bc-legendary-wrap.bc-size-medium,
.bc-obsidian-wrap.bc-size-medium { width: 160px; }

.bc-legendary-wrap .bc,
.bc-obsidian-wrap .bc {
    width: 100%;
    position: relative;
    z-index: 1;
}


/* ============================================
   BASE CARD
   ============================================ */

.bc {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: #0d0d0d;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.bc.bc-size-small  { width: 130px; }
.bc.bc-size-medium { width: 160px; }


/* ============================================
   HOVER EFFECTS
   ============================================ */

.bc:hover {
    transform: translateY(-6px) scale(1.03);
}

.bc.earned.rarity-common:hover {
    border-color: #95a5a6;
    box-shadow: 0 10px 24px rgba(149,165,166,0.4);
}
.bc.earned.rarity-rare:hover {
    border-color: #3498db;
    box-shadow: 0 10px 24px rgba(52,152,219,0.4);
}
.bc.earned.rarity-epic:hover {
    border-color: #9b59b6;
    box-shadow: 0 10px 24px rgba(155,89,182,0.4);
}
.bc.locked:hover {
    transform: translateY(-3px) scale(1.01);
    opacity: 0.8;
}


/* ============================================
   LOCKED STATE
   ============================================ */

.bc.locked {
    opacity: 0.65;
    border: 2px dashed rgba(255,255,255,0.12);
    background: #0a0a0a;
}


/* ============================================
   RARITY HEADER STRIP
   ============================================ */

.bc-header {
    padding: 7px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.bc-header::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.bc:hover .bc-header::before { left: 100%; }

.bc-rarity-label {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
}

.bc-header-common      { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.bc-header-rare        { background: linear-gradient(135deg, #3498db, #2980b9); }
.bc-header-epic        { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.bc-header-placeholder { background: #222222; }

.bc-header-legendary {
    background: linear-gradient(135deg, #b8860b 0%, #ffd700 40%, #f39c12 60%, #b8860b 100%);
    background-size: 200% 100%;
    animation: legHeaderShim 2.5s ease-in-out infinite;
}

.bc-header-obsidian {
    background: linear-gradient(135deg, #7a5000 0%, #ffd700 50%, #7a5000 100%);
    background-size: 200% 100%;
    animation: obsHeader 3s ease-in-out infinite;
}

@keyframes legHeaderShim {
    0%,100% { background-position: 0% 50%;   filter: brightness(1); }
    50%     { background-position: 100% 50%; filter: brightness(1.3); }
}
@keyframes obsHeader {
    0%,100% { background-position: 0% 50%;   filter: brightness(1); }
    50%     { background-position: 100% 50%; filter: brightness(1.3); }
}


/* ============================================
   CARD BODY
   ============================================ */

.bc-body {
    padding: 14px 12px 10px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bc-size-medium .bc-body {
    min-height: 150px;
}


/* ============================================
   BADGE IMAGE AREA
   ============================================ */

.bc-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.bc-size-medium .bc-img-wrap { width: 90px;  height: 81px; }
.bc-size-small  .bc-img-wrap { width: 66px;  height: 59px; }

.bc-size-medium .bc-img-wrap img { width: 88px;  height: 79px; object-fit: contain; display: block; }
.bc-size-small  .bc-img-wrap img { width: 64px;  height: 57px; object-fit: contain; display: block; }

.bc.earned .bc-img-wrap img {
    animation: badgeFloat 3s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%,100% { transform: translateY(0px); }
    50%     { transform: translateY(-4px); }
}

.bc.locked .bc-img-wrap img {
    filter: grayscale(1) brightness(0.6);
    opacity: 0.4;
    animation: none;
}

.bc-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bc-lock-icon {
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================================
   TEXT — all hardcoded, no theme variables
   ============================================ */

.bc-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.bc-desc {
    font-size: 11px;
    color: #aaaaaa;
    line-height: 1.4;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.bc-date {
    font-size: 10px;
    color: #888888;
    margin-top: 4px;
    margin-bottom: 2px;
}

.bc-date i { margin-right: 3px; }


/* ============================================
   CARD FOOTER
   ============================================ */

.bc-footer {
    padding: 0 12px 12px;
    flex-shrink: 0;
}


/* ============================================
   PROGRESS BAR
   ============================================ */

.bc-progress {
    margin-top: 8px;
    width: 100%;
}

.bc-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.bc-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.bc-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.bc-progress-fill-common    { background: linear-gradient(90deg, #7f8c8d, #95a5a6); }
.bc-progress-fill-rare      { background: linear-gradient(90deg, #2980b9, #3498db); }
.bc-progress-fill-epic      { background: linear-gradient(90deg, #8e44ad, #9b59b6); }
.bc-progress-fill-legendary { background: linear-gradient(90deg, #b8860b, #ffd700); }
.bc-progress-fill-obsidian  { background: linear-gradient(90deg, #c41f20, #e42526); }

.bc-progress-text {
    font-size: 10px;
    color: #888888;
    font-weight: 700;
    text-align: center;
}


/* ============================================
   FEATURE BUTTON
   ============================================ */

.bc-feat-btn,
.bc-featured-btn {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 0;
    border-radius: 6px;
    transition: all 0.2s;
    margin-top: 8px;
    display: block;
    text-align: center;
    cursor: pointer;
}

.bc-feat-btn {
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: #aaaaaa;
}

.bc-feat-btn:hover {
    background: rgba(228,37,38,0.1);
    border-color: #e42526;
    color: #e42526;
}

.bc-featured-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border: none;
    color: white;
    cursor: not-allowed;
}


/* ============================================
   MOTIVATOR
   ============================================ */

.bc-motivator-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #e42526;
    text-align: center;
    margin-bottom: 4px;
}

.bc-motivator-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    vertical-align: top;
}

.bc-motivator-wrap.bc-size-medium { width: 160px; }
.bc-motivator-wrap.bc-size-small  { width: 130px; }


/* ============================================
   PLACEHOLDER SLOT
   ============================================ */

.bc-placeholder-slot {
    border-radius: 14px;
    border: 2px dashed rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 10px;
    gap: 8px;
    opacity: 0.35;
    box-sizing: border-box;
}

.bc-placeholder-slot.bc-size-small  { width: 130px; min-height: 168px; }
.bc-placeholder-slot.bc-size-medium { width: 160px; min-height: 210px; }

.bc-placeholder-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px dashed rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bc-placeholder-text {
    font-size: 10px;
    color: #666666;
    line-height: 1.4;
}


.bc-legendary-wrap .bc:hover,
.bc-obsidian-wrap .bc:hover {
    transform: none;
    box-shadow: none;
}


/* ============================================
   LEGENDARY
   ============================================ */

.bc-legendary-wrap .bc {
    border: none;
    background: #0d0d0d;
}

.bc-legendary-wrap .bc:hover {
    border: 2px solid #ffd700;
}

.bc-leg-border {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    z-index: 0;
    pointer-events: none;
    padding: 2px;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
}

.bc-leg-border::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        transparent 0deg,
        transparent 300deg,
        rgba(184,134,11,0.3) 320deg,
        rgba(255,215,0,0.7) 340deg,
        #ffd700 350deg,
        #ffe066 354deg,
        rgba(255,215,0,0.7) 357deg,
        transparent 360deg
    );
    transform: translate(-50%, -50%) rotate(0deg);
    animation: legBorderRotate 4s linear infinite;
}

@keyframes legBorderRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.bc-legendary-wrap .bc-name {
    background: linear-gradient(90deg, #a07010 0%, #ffd700 40%, #f0a500 55%, #a07010 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nameShimmerGold 3.5s ease-in-out infinite;
}

.bc-legendary-wrap .bc.earned .bc-img-wrap img {
    animation: badgeFloatGold 3s ease-in-out infinite;
}

@keyframes badgeFloatGold {
    0%,100% { transform: translateY(0px);  filter: drop-shadow(0 0 3px rgba(243,156,18,0.2)); }
    50%     { transform: translateY(-4px); filter: drop-shadow(0 0 8px rgba(243,156,18,0.6)); }
}

@keyframes nameShimmerGold {
    0%   { background-position: 100% 50%; }
    50%  { background-position: 0%   50%; }
    100% { background-position: 100% 50%; }
}


/* ============================================
   OBSIDIAN
   ============================================ */

.bc-obsidian-wrap {
    box-shadow: 0 0 0 2px #ffd700, 0 0 10px rgba(255,215,0,0.3);
    animation: obsWrapGlow 2.5s ease-in-out infinite;
}

@keyframes obsWrapGlow {
    0%,100% { box-shadow: 0 0 0 2px #ffd700, 0 0 8px rgba(255,215,0,0.25); }
    50%     { box-shadow: 0 0 0 2px #ffd700, 0 0 22px rgba(255,215,0,0.7), 0 0 40px rgba(255,215,0,0.2); }
}

.bc-obsidian-wrap .bc {
    background: radial-gradient(ellipse at 50% 30%, #1a1200 0%, #0d0d0d 70%);
    border: none;
}

.bc-obsidian-wrap .bc:hover {
    border-color: #ffd700;
}

.bc-matrix-canvas {
    display: none;
}

.bc-obs-border {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    z-index: 0;
    pointer-events: none;
    padding: 2px;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
}

.bc-obs-border::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(
        transparent 0deg,
        transparent 270deg,
        rgba(255,215,0,0.3) 300deg,
        rgba(255,215,0,0.85) 330deg,
        #ffffff 343deg,
        #ffe066 348deg,
        rgba(255,215,0,0.85) 354deg,
        transparent 360deg
    );
    transform: translate(-50%, -50%) rotate(0deg);
    animation: obsBorderRotate 1.5s linear infinite;
}

@keyframes obsBorderRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.bc-obsidian-wrap .bc-header,
.bc-obsidian-wrap .bc-body,
.bc-obsidian-wrap .bc-footer {
    position: relative;
    z-index: 2;
}

.bc-obsidian-wrap .bc-name {
    background: linear-gradient(90deg, #7a5000 0%, #ffd700 35%, #ffe066 50%, #ffd700 65%, #7a5000 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: nameShimmerGold 3.5s ease-in-out infinite;
}

.bc-obsidian-wrap .bc-desc { color: #e6c97a; }
.bc-obsidian-wrap .bc-date { color: #c8a44a; }
.bc-obsidian-wrap .bc-feat-btn { border-color: #5a3e00; color: #e6c97a; }

.bc-obsidian-wrap .bc.earned .bc-img-wrap img {
    animation: badgeFloatObs 2.5s ease-in-out infinite;
}

@keyframes badgeFloatObs {
    0%,100% { transform: translateY(0px) scale(1);     filter: drop-shadow(0 0 5px rgba(255,215,0,0.5)); }
    50%     { transform: translateY(-9px) scale(1.06); filter: drop-shadow(0 0 18px rgba(255,215,0,1)); }
}

@keyframes nameShimmerRed {
    0%   { background-position: 100% 50%; }
    50%  { background-position: 0%   50%; }
    100% { background-position: 100% 50%; }
}


/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .pf-badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .pf-badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bc.bc-size-medium,
    .bc-motivator-wrap.bc-size-medium,
    .bc-placeholder-slot.bc-size-medium,
    .bc-legendary-wrap.bc-size-medium,
    .bc-obsidian-wrap.bc-size-medium {
        width: 130px;
    }
    .bc-size-medium .bc-img-wrap     { width: 66px; height: 59px; }
    .bc-size-medium .bc-img-wrap img { width: 64px; height: 57px; }
    .category-content {
        grid-template-columns: repeat(auto-fill, 130px);
        gap: 12px;
    }
}

@media (max-width: 360px) {
    .bc.bc-size-small,
    .bc-legendary-wrap.bc-size-small,
    .bc-obsidian-wrap.bc-size-small {
        width: 110px;
    }
}

/* ============================================
   HEIGHT CONSISTENCY FIXES
   ============================================ */

/* Spacer shown when no progress data — matches height of real progress block */
.bc-progress-spacer {
    margin-top: 8px;
    height: 22px; /* matches bc-progress-bar (6px) + bc-progress-text (~10px) + margins */
}

/* Spacer shown when no feature button — matches height of feature button */
.bc-footer-spacer {
    height: 31px; /* matches bc-feat-btn padding + font height */
}

/* overflow:hidden removed — was clipping the border tracer animation */

/* ============================================
   DARK MODE — category progress oval text
   ============================================ */

/* Force black text on the grey section count ovals in dark mode */
html:not([data-theme="light"]) .category-progress {
    color: #000000 !important;
}
