/* Rewards System Styles */

/* --- Layouts --- */
.rewards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.rewards-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, #a55eea, #e84393);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.star-badge {
    background-color: rgba(75, 47, 137, 0.1);
    border: 2px solid #6c5ce7;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.star-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f1c40f;
}

/* Shop Grid */
.card-shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns */
    gap: 2rem;
    width: 100%;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .card-shop-grid {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
    }
}

.card-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* --- Card Component --- */
/* The root container fixes the aspect ratio and width */
.reward-card-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    perspective: 1000px;
    user-select: none;
    cursor: pointer;
}

/* Inner wrapper for 3D/Positioning */
.reward-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.reward-card-container:hover .reward-card {
    transform: scale(1.03);
}

.reward-card.unowned {
    filter: grayscale(100%) opacity(0.6);
}

/* The visual card face */
.reward-card-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #2d3436;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* Styles for Standard vs Gold */
.reward-card-face.standard {
    border: 5px solid #dfe6e9;
    /* Slate/White border */
}

.reward-card-face.gold {
    border: 5px solid #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

/* Card Header */
.card-header {
    min-height: 40px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    position: relative;
}

.card-header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
    max-width: 70%;
}

.card-group {
    font-size: 0.75rem;
    opacity: 0.9;
}

.card-category {
    font-size: 0.6rem;
    opacity: 0.7;
}

.card-rarity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.standard .card-header {
    background: #636e72;
    color: #dfe6e9;
}

.gold .card-header {
    background: linear-gradient(to right, #f1c40f, #f39c12);
    color: #2d3436;
}

.gold .card-rarity-badge {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    color: #2d3436;
}

.diamond .card-rarity-badge {
    background: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Card Body */
.card-body {
    flex-grow: 1;
    position: relative;
    /* For absolute centering */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    /* Default white background for content */
    overflow: hidden;
    padding: 10px;
}

.standard .card-body {
    background: linear-gradient(135deg, #f5f6fa 0%, #dcdde1 100%);
}

.gold .card-body {
    background: radial-gradient(circle, #fff 10%, #f6e58d 100%);
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 10;
}

.card-text-big {
    font-size: 4rem;
    font-weight: 800;
    color: #2d3436;
    z-index: 10;
}

.card-text-medium {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3436;
    text-align: center;
    z-index: 10;
}

/* Card Footer */
.card-footer {
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.standard .card-footer {
    background: #ffffff;
    color: #2d3436;
}

.gold .card-footer {
    background: linear-gradient(to bottom, #f1c40f, #f39c12);
    color: #2d3436;
}

.card-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.card-meta {
    font-size: 0.65rem;
    opacity: 0.8;
    margin: 0;
}

/* Count Badge */
.card-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #0984e3;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gold .card-count-badge {
    background-color: #f39c12;
    border-color: #fff;
    color: black;
}

/* Shop Specifics */
.shop-pack {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid #eee;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.shop-pack:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.shop-pack-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.shop-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Button Reset for Card Selection */
.card-select-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    /* Reset inheritance */
}

/* Category Filter Chips */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid #6c5ce7;
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
    background-color: #6c5ce7;
    color: white;
}

/* Diamond Tier Styles */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

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

.reward-card-face.diamond {
    border: 5px solid #00cec9;
    box-shadow: 0 0 20px rgba(0, 206, 201, 0.6);
}

.diamond .card-header {
    background: linear-gradient(90deg, #0984e3, #00cec9, #0984e3);
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.diamond .card-body {
    background: radial-gradient(circle at center, #fff 20%, #81ecec 100%);
}

.diamond .card-footer {
    background: linear-gradient(to right, #00cec9, #0984e3);
    color: white;
}

.diamond .card-count-badge {
    background: linear-gradient(135deg, #00cec9, #0984e3);
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.8);
    color: white;
}