/* ===== STORE STYLES ===== */

.store-header {
    margin-bottom: 24px;
}

.store-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.store-subtitle {
    color: var(--text-muted);
    font-size: 16px;
}

.wallet-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

.wallet-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-primary);
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

.wallet-icon {
    color: var(--accent-primary);
}

.store-tabs-wrapper {
    margin-top: 32px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    padding-bottom: 8px;
    margin-bottom: 30px;
}

.store-tabs {
    display: flex;
    gap: 32px;
}

.store-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 12px;
    position: relative;
    transition: color 0.2s;
}

.store-tab-btn:hover {
    color: var(--text-secondary);
}

.store-tab-btn.active {
    color: var(--text-primary);
}

.store-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--accent-primary);
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Store Cards */
.store-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.store-item-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.15);
}

.store-item-card.purchased {
    border-color: rgba(34, 197, 94, 0.4);
}

.store-item-card.purchased:hover {
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.15);
}

.store-item-preview {
    height: 140px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.store-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.store-item-card:hover .store-item-preview img {
    transform: scale(1.05);
}

.store-item-badge-preview {
    font-size: 64px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.store-preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-secondary);
    position: relative;
    /* Frame animations will use pseudo elements generally */
}

.store-preview-avatar.lg {
    width: 100px;
    height: 100px;
    font-size: 36px;
}

.store-item-name-preview {
    font-size: 28px;
    font-weight: 800;
}

.store-item-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.store-item-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.store-item-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.store-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.store-item-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-primary);
}

.store-item-price.affordable {
    color: var(--accent-primary);
}

.store-item-price.expensive {
    color: #ef4444;
    /* red */
}

.store-item-price.free {
    color: #22c55e;
}

.store-btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.store-btn-buy {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.store-btn-buy:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.store-btn-disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

.store-btn-owned {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.store-btn-owned:hover {
    background: rgba(34, 197, 94, 0.2);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.store-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 400px;
    max-width: 90%;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: all 0.3s;
}

.modal-overlay.active .store-modal-card {
    transform: translateY(0);
}

.modal-img-preview {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-img-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sparkle-effect {
    position: absolute;
    pointer-events: none;
    background: white;
    border-radius: 50%;
    width: 4px;
    height: 4px;
    box-shadow: 0 0 10px 2px white, 0 0 20px 5px var(--accent-primary);
    animation: sparkleAnim 1.5s ease-in-out forwards;
    z-index: 10;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) translateY(0);
        opacity: 0;
    }

    50% {
        transform: scale(1) translateY(-20px);
        opacity: 1;
    }

    100% {
        transform: scale(0.5) translateY(-40px);
        opacity: 0;
    }
}