/* ===== COIN DISPLAY SYSTEM ===== */
/* Unified coin component for consistent rendering across all modals, shops, and displays */

/* ===== DESIGN TOKENS ===== */
:root {
    /* Coin gradient - consistent across all coin displays (from hamburger menu) */
    --coin-gradient: linear-gradient(147deg, 
        rgba(255, 234, 143, 1) 0%, 
        rgba(255, 200, 0, 1) 52%, 
        rgba(217, 126, 69, 1) 100%);
    
    /* Coin shadow - consistent depth (from hamburger menu with glow) */
    --coin-shadow: 0 0 8px rgba(255, 200, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    --coin-shadow-hover: 0 0 12px rgba(255, 200, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
    
    /* Coin text shadow (from hamburger menu) */
    --coin-text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* ===== BASE COIN CIRCLE ===== */
/* Based on hamburger menu coin (#topbar-coins-count) - 32px size */
.coin-circle,
#topbar-coins-count {
    /* Sizing - hamburger menu standard */
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: var(--radius-full);
    box-sizing: border-box;
    
    /* Visual - hamburger menu standard */
    background: var(--coin-gradient);
    box-shadow: var(--coin-shadow);
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    
    /* Typography - hamburger menu standard */
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    line-height: 1;
    text-shadow: var(--coin-text-shadow);
}

/* Text content inside coin circles */
.coin-circle span {
    text-shadow: var(--coin-text-shadow);
    position: relative;
    z-index: 2; /* Ensure text is above tint overlay */
}

/* ===== COIN SIZE VARIANTS ===== */
/* Small - for price badges and compact displays (proportional to 32px base) */
.coin-circle.small {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 10px;
}

/* Extra small - for very compact contexts */
.coin-circle.xsmall {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    font-size: 8px;
}

/* ===== COIN DISPLAY WRAPPER ===== */
/* Wrapper for coin + indicator combinations */
.coin-display-wrapper {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ===== COIN INDICATOR ===== */
/* Small icon indicator (for +/- indicators next to coins) - proportional to 32px base */
.coin-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border-radius: var(--radius-full);
    box-sizing: border-box;
    
    /* Visual - same gradient and shadow as coins */
    background: var(--coin-gradient);
    box-shadow: var(--coin-shadow);
    
    /* Typography */
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: 11px;
    line-height: 1;
    text-shadow: var(--coin-text-shadow);
    
    /* Layout */
    flex-shrink: 0;
}

/* Small indicator for small coin contexts */
.coin-indicator.small {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    font-size: 9px;
}

/* Auto-size indicator based on coin size */
.coin-display-wrapper:has(.coin-circle.small) .coin-indicator {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    font-size: 9px;
}

.coin-display-wrapper:has(.coin-circle.xsmall) .coin-indicator {
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    font-size: 7px;
}

/* ===== COIN DISPLAY CONTAINER ===== */
/* Container for coin displays in various contexts */
.coin-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* ===== LIBRARY CARD PRICE BADGE ===== */
/* Price badges on library cards use small size (proportional to 32px base) */
.library-card-price-badge .coin-circle {
    /* Use small size for price badges */
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 10px;
    box-shadow: var(--coin-shadow);
    background: var(--coin-gradient);
    border-radius: var(--radius-full);
}

.library-card-price-badge .coin-indicator {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    font-size: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 375px) {
    /* Smaller coins on very small screens */
    .library-card-price-badge .coin-circle {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        font-size: 9px;
    }
    
    .library-card-price-badge .coin-indicator {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        font-size: 7px;
    }
}

/* ===== STATES ===== */
/* Hover effect for interactive coins */
.coin-circle:hover {
    box-shadow: var(--coin-shadow-hover);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Affordability states (for shop items) */
/* Affordable items - no special effects, just normal coin appearance */
.library-card-price-badge.can-afford .coin-circle {
    /* No special effects - use default coin styling */
}

/* Unaffordable items - tint coin 30% with theme's card background color */
.library-card-price-badge.cannot-afford .coin-circle {
    position: relative;
}

.library-card-price-badge.cannot-afford .coin-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-background-primary);
    opacity: 0.3;
    border-radius: inherit;
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

/* Affordability states on the badge itself (for consistency) */
.library-card-price-badge.can-afford {
    /* No special effects */
}

.library-card-price-badge.cannot-afford {
    /* Tint handled by coin-circle pseudo-element */
}

